Prior to development of the Finite Element Method, there existed an approximation

technique for solving differential equations called method of weighted residuals.
Suppose we have a linear differential operator D acting on a
function u to produce function p
D(u(x)) = p(x).
We wish to approximate u by a functions u which is a linear
combinations of base functions chosen from a linearly independent set.
That is
Now, when substituted into the differential operator,
D,the result is
of the operations is not, in general, p(x). Hence a error or
re si dual will
.
The notion in the MWR is to force the residual to zero in
some average sense over the domain . That is
i
n
a
i
i
a u u φ

= ≅
=1
~
0 ) ( ) ( ( ) ( ) (
~
≠ − = = x p x u D x R x E
Method of weighted Residuals

x i
dx W x R ) (
=0 i=1,2,3…..n
These five me thods are :
1..Collocation method.
2. Sub-domain method. 3. Least Squares method.
4. Galerkin method.
5. Method of moments
Where the number of weight funcions is equal to the number of unknown
constants in u. The result is a set of n algebraic equations for the unknown
constants
There are at least five MWR methods according to choices of weight functions
i
a
i
i
w
i
a
i
2.1 Collocation Method
In this method, the weighting functions are taken from the family of
Dirac d functions in the domain. That is, W
i
(x)=δ(x-x
i
)
The dirac delta function has the
The following property.
{ ) (
1
0
= −
i
x x δ
x=x
i
otherwise
the integration of the weighted residual statement results in the forcing the residual to zero
at specific points in the domain. That is integration of with dirac delta function results.Hence
R(x
i
)=0
This method doesn’t use weighting factors explicity, so it is not,strictly speaking,
a member of the Weighted Residuals family. However, it can be considered a
modification of the collocation method. The idea is to force the weighted residual
to zero not just at fixed points in the domain, but over various subsections of the
domain. To accomplish this,the weight functions are set to unity, and the integral
over the entiredomain is broken into a number of subdomains sufficient to
evaluate all unknown parameters. That is
Sub Domain Method


= =

i
x x
i
i
dx x R dx W x R 0 ) ( ( ) (
If the continuous summation of all the squared residuals is minimized,the rationale
behind the name can be seen. In other words, a minimum of
Least Square Method
0 ) ( 2
0 ) ( ( ) (
2
=



=




= =

=
dx
a
R
x R
a
S
dx x R dx x R S
i
x
i
i
x x
i
i
i
i
a
R
W


= 2
In order to achieve a minimum of this scalar function, the derivatives of S with respect to
all the unknown parameters must be zero. That
is,
however, the “2” can be dropped, since it cancels out in the equation.Therefore the
weight functions for the Least Squares Method are justthe dierivatives of the
residual with respect to the unknown constants:
This method may be viewed as a modification of the Least SquaresMethod. Rather than
using the derivative of the residual with respectto the unknown ai, the derivative of the
approximating function is used.That is, if the function is approximated as in 2.1, then the
weight functions are
i
i
a
u
W


=
~
Note that these are then identical to the original basis functions
) (
~
x
a
u
W
i
i
i
φ =


=
In this method, the weight functions are chosen from the family of
polynomials. That is
In the event that the basis functions for the approximation (the ϕi’s)
were chosen as polynomial, then the method of moments may be identical
to the Galerkin method
w
i
=x
i
i=1,2,3 …..n
2.4 Galerkin Method
Method of Moments
As an example, consider the solution of the following mathematical
problem. Find u(x) that satisfies
1
2
2
= + u
dx
u d
u(0)=1
u(1)=0
Note that for this problem the differential operator D(u(x)) and p(x)
a
) ( ) 1 ( ) ( (
2
2
x u
dx
d
x u D + =
For reference, the exact solution can be found and is, in general form,
U(x)=C
1
sinx+C
2
cosx+1
and for the given boundary conditions the constants can be evaluated
u(0) = 1 = C
2
=0 u(1) = 0 = C
1
=-1/sin(1)
1 sin
sin
1 ) (
x
x u − =
And p(x)=1
So the exact solution is
Let’s solve by the Method of Weighted Residuals
i
n
i
i
a x u x u φ φ

+ = ≅
=1
0
~
) ( ) (
etc x x x x
x
).... 1 ( ); 1 (
1
2
2 1
0
− = − =
− =
φ φ
φ
EXAMPLE
The function is approximated as
1 ) (
~
2
~
2
− + = u
dx
u d
x R
) ( 1 ) (
2
~
x x a x x u
i
− + − =
) 2 ( ) (
2
1
+ − + − = x x a x x R
Take n as 1
For the collocation method, the residual is forced to zero at a numberof discrete
points. Since there is only one unknown (a2), only onecollocation point is needed.
We choose (arbitrarily, but from symmetrconsiderations) the collocation point x = 0.5.
Thus, the equationneeded to evaluate the unknown a1 is
Collocation Method
R(0.5)=- 0.5+a
1
(0.25-.5+2)=0
a
1
=+0.5/1.75=0.285714
2.6.2 Subdomain Method
Since we have one unknown constant, we choose a single “subdomain”
which covers the entire range of x. Therefore, the relation to evalutate
the constant a1 is
272727 . 0 11 / 3
2 / 1 ) 2 2 / 1 3 / 1 (
0 )] 2 ( [
0 ) ( . 1
1
1
2
1
0
1
1
0
= =
= + −
= + −

+ −

=
a
a
dx x x a x
dx x R
The approx. solution is
The approx. solution is
) ( 285714 . 0 1 ) (
2
~
x x x x u − + − =
) ( 272727 . 0 1 ) (
2
~
x x x x u − + − =
272277 . 0 ) 101 / 30 ).( 12 / 11 (
0 ) 30 / 101 ( 12 / 11
0 )] 2 ( ).[ 2 (
2 ) (
1
1
2
1
0
1
2
2
1
1
= =
= + −
= + −

+ − + −
+ − = =
a
a
dx x x a x x x
x x
da
dR
x w
277 . 0 ) 3 / 10 ).( 12 / 1 (
0 ) 10 / 3 ( 12 / 1
0 )] 2 ( ).[ (
0 ) ( ) (
) (
1
1
2
1
0
1
2
1
0
1
2
1
~
1
= =
= − −
= + −

+ − −
=

− = =
a
a
dx x x a x x x
x R x w
x x
da
u d
x w
0 ) ( ) (
1
0
1
=

x R x w
The weight function W1 is just the derivative of R(x) with respect to
the unknown a1
LEAST SQUARES METHOD
In the Galerkin Method, the weight function W1 is the derivative of the
approximating function eu(x) with respect to the unknown coefficient
GALERKIN METHOD
) ( 277 . 0 1
2
~
x x x u − + − =
The approx. solution is
) ( 2722 . 0 1
2
~
x x x u − + − =
The approx. solution is
Table 2.1: Comparison of Different Approximations in Example 1.
X exact collocation Subdomain LeastSquares Galerkin
0.00 1.0000 1.0000 1.0000 1.0000 1.0000
0.05 0.94060 0.93643 0.93705 0.93707 0.93681
0.10 0.88136 0.87429 0.87545 0.87550 0.87500
0.1 0.82241 0.81357 0.81523 0.81528 0.81458
0.20 0.76390 0.75429 0.75636 0.75644 0.75556
0.25 0.70599 0.69643 0.69886 0.69895 0.69792
0.30 0.64881 0.64000 0.64273 0.64282 0.64167
0.35 0.59250 0.58500 0.58795 0.58806 0.58681
0.40 0.53722 0.53143 0.53455 0.53465 0.53333
0.45 0.48309 0.47929 0.48250 0.48261 0.48125
0.50 0.43025 0.42857 0.43182 0.43193 0.43056
0.55 0.37884 0.37929 0.38250 0.38261 0.38125
0.60 0.32898 0.33143 0.33455 0.33465 0.33333
0.65 0.28080 0.28500 0.28795 0.28806 0.28681
0.70 0.23441 0.24000 0.24273 0.24282 0.24167
cont




C Co on ns si id de er r t th he e e eq qu ua at ti io on n : :



1; x 0 0
2
2
2
< < = − + x u
dx
u d


B Bo ou un nd da ar ry y c co on nd di it ti io on ns s: :

u =0; x=0
u=0; x=1
Exact solution is given by

2
1 sin
) 1 sin( 2 sin
) (
2
− +
− +
= x
x x
x u













METHOD OF WEIGHTED
RESIDUALS(MWR)
• Collocation method
• Subdomain method
• Least square method
• Petrov – Galerkin method
• Bubnov – Galerkin method
Approximate solution is

functions. Trial ..... , ,
....
~
~
3 2 1
3 3 2 2 1 1
1
φ φ φ
φ φ φ φ
φ φ
+ + + + =
+ =
°
=
° ∑
c c c u
c u
N
i
i i
Where 0
φ
is the solution which
satisfies the boundary conditions alone.
We know the boundary conditions
x =0, u =0;
x =1, u=0
Take
0 =
°
φ


) 1 (
) 1 (
) 1 (
) 1 (
3
3
2
2
1
x x
x x
x x
x x
n
n
− =
− =
− =
− =
φ
φ
φ
φ













Collocation method

) 1 ( ) 1 (
~
2
2 1
− + − + = x x c x x c x u


R x u
dx
u d
= − +
2
2
2
~
~


R= x + C
1
(-2+x – x
2
) + C
2
(2-6x+x
2
-x
3
)

0
4
1
4
1
4
6
2
4
1
4
1
2
4
1
4
1
3 2
2
2
1
=
|
|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
+ − +
|
|
.
|

\
|
|
.
|

\
|
− + − + = C C R


0
4
3
4
3
4
18
2
4
3
4
3
2
4
3
4
3
3 2
2
2
1
=
|
|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
+ − +
|
|
.
|

\
|
|
.
|

\
|
− + − + = C C R























0 0.25 0.75 1
1.8125 C
1
+ 0.547C
2
+ 0.25 = 0 ---------- (1)
1.8125 C
1
– 2.36 C
2
+ 0.75 = 0 ------------------(2)
From (1)&(2)
C
1
= 0.189 x C
2
= 0.172
ũ = 0.189 x (1-x) + 0.172 x
2
(1-x)
R = x + 0.189 (-2 + x – x
2
) + 0.172 (2 – 6x + x
2
– x
3
)
u
COLLOCATION METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.044 0.049
0.5 0.069 0.077
0.75 0.06 0.066
1 0 0
RESIDUE CHART
SUBDOMAIN METHOD




=
5 . 0
0
0 dx R
&

=
1
5 . 0
0 dx R



( ) ( ) | | d x x x x 6 2 C x x 2 C x
5 . 0
0
3 2
2
2
1

− + − + − + − +




5 . 0
0
4 3
2
2
5 . 0
0
3 2
1
5 . 0
2
4 3 2
6
2
3 2
2
2
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
− + − +
|
|
.
|

\
| x x
x x C
x x
x C
x



0.125 – 0.917 C
1
+ 0.276 C
2
= 0 - - - - - (1)













1
5 . 0
4 3
2
2
1
5 . 0
3 2
1
1
5 . 0
2
4 3
3 2
3 2
2
2
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
x x
x x C
x x
x C
x

0.375 – 0.913C
1
– 1.193 C
2
= 0 - - - - - (2)

From (1)&(2)


C
1
= 0.188, C
2
= 0.171













SUBDOMAIN METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
SUBDOMAIN METHOD
RESIDUE






=
1
0
0 WRdx


w
1
= x & w
2
= x
2































Petrov-Galerkin Method


( ) ( ) | | 0 6 2 2 1
3 2
2
2
1
0
= − + − + − + − +

dx x x x C x x C x x



( ) ( ) { } 0 6 2 2
1
0
4 3 2
2
3 2
1
2
= − + − + − + − +

d x x x x x C x x x C x


0.33 – 0.92C
1
-0.95 C
2
= 0 - - - - - - - (1)
































( ) ( ) | |

− + − + − + − +
1
0
3 2
2
2
1
2
d x x x x 6 2 C x x 2 C x x


0.25 – 617 C
1
– 0.8 C
2
= 0 - - - - - - - - - (2)

From (1)&(2)

C
1
= 0.18, C
2
= 0.174





























S SO OL LU UT TI IO ON N: :



u = 0.18 x(1-x) + 0.174 x
2
(1-x)


R = x + 0.18 (-2 + x – x
2
) + 0.174 ( 2-6x + x
2
– x
3
)





























PETROV – GALERKIN METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.042 0.049
0.5 0.066 0.077
0.75 0.058 0.066
1 0 0
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
Least square method




=


1
0
2
1
0 dx R
C





=


1
0
2
2
0 dx R
C



( ) 0 2
1
1
0
2
1
=


=
(
¸
(

¸




d x
C
R
R d x R
C























0 dx
C
R
R
1
0
1
=






( ) ( ) | | ( )dx x x 2 x x x 6 2 C x x 2 C x
2
1
0
3 2 2
2
2
1
− + − − + − + − + − +




- 0.917 + 3.367 C
1
+ 1.687 C
2
= 0 ---------------(1)
















0 dx
C
R
R
1
0
2
=







( ) ( ) | | ( ) { } x d x x x x x x C x x C x

− + − − + − + − + − +
1
0
3 2 3 2
2
2
1
6 2 6 2 2



-0.95 + 1.687 C
1
+ 3.74 C
2
= 0 -------------(2)



168 . 0 , 187 . 0
2 1
= = ∴ C C

















C Co on ns si id de er r t th he e e eq qu ua at ti io on n : :



1; x 0 0
2
2
2
< < = − + x u
dx
u d


B Bo ou un nd da ar ry y c co on nd di it ti io on ns s: :

u =0; x=0
u=0; x=1
Exact solution is given by

2
1 sin
) 1 sin( 2 sin
) (
2
− +
− +
= x
x x
x u













METHOD OF WEIGHTED
RESIDUALS(MWR)
• Collocation method
• Subdomain method
• Least square method
• Petrov – Galerkin method
• Bubnov – Galerkin method
Approximate solution is

functions. Trial ..... , ,
....
~
~
3 2 1
3 3 2 2 1 1
1
φ φ φ
φ φ φ φ
φ φ
+ + + + =
+ =
°
=
° ∑
c c c u
c u
N
i
i i
Where 0
φ
is the solution which
satisfies the boundary conditions alone.
We know the boundary conditions
x =0, u =0;
x =1, u=0
Take
0 =
°
φ


) 1 (
) 1 (
) 1 (
) 1 (
3
3
2
2
1
x x
x x
x x
x x
n
n
− =
− =
− =
− =
φ
φ
φ
φ













Collocation method

) 1 ( ) 1 (
~
2
2 1
− + − + = x x c x x c x u


R x u
dx
u d
= − +
2
2
2
~
~


R= x + C
1
(-2+x – x
2
) + C
2
(2-6x+x
2
-x
3
)

0
4
1
4
1
4
6
2
4
1
4
1
2
4
1
4
1
3 2
2
2
1
=
|
|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
+ − +
|
|
.
|

\
|
|
.
|

\
|
− + − + = C C R


0
4
3
4
3
4
18
2
4
3
4
3
2
4
3
4
3
3 2
2
2
1
=
|
|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
+ − +
|
|
.
|

\
|
|
.
|

\
|
− + − + = C C R























0 0.25 0.75 1
1.8125 C
1
+ 0.547C
2
+ 0.25 = 0 ---------- (1)
1.8125 C
1
– 2.36 C
2
+ 0.75 = 0 ------------------(2)
From (1)&(2)
C
1
= 0.189 x C
2
= 0.172
ũ = 0.189 x (1-x) + 0.172 x
2
(1-x)
R = x + 0.189 (-2 + x – x
2
) + 0.172 (2 – 6x + x
2
– x
3
)
u
COLLOCATION METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.044 0.049
0.5 0.069 0.077
0.75 0.06 0.066
1 0 0
RESIDUE CHART
SUBDOMAIN METHOD




=
5 . 0
0
0 dx R
&

=
1
5 . 0
0 dx R



( ) ( ) | | d x x x x 6 2 C x x 2 C x
5 . 0
0
3 2
2
2
1

− + − + − + − +




5 . 0
0
4 3
2
2
5 . 0
0
3 2
1
5 . 0
2
4 3 2
6
2
3 2
2
2
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
− + − +
|
|
.
|

\
| x x
x x C
x x
x C
x



0.125 – 0.917 C
1
+ 0.276 C
2
= 0 - - - - - (1)













1
5 . 0
4 3
2
2
1
5 . 0
3 2
1
1
5 . 0
2
4 3
3 2
3 2
2
2
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
− + − +
|
|
.
|

\
|
x x
x x C
x x
x C
x

0.375 – 0.913C
1
– 1.193 C
2
= 0 - - - - - (2)

From (1)&(2)


C
1
= 0.188, C
2
= 0.171













SUBDOMAIN METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
SUBDOMAIN METHOD
RESIDUE






=
1
0
0 WRdx


w
1
= x & w
2
= x
2































Petrov-Galerkin Method


( ) ( ) | | 0 6 2 2 1
3 2
2
2
1
0
= − + − + − + − +

dx x x x C x x C x x



( ) ( ) { } 0 6 2 2
1
0
4 3 2
2
3 2
1
2
= − + − + − + − +

d x x x x x C x x x C x


0.33 – 0.92C
1
-0.95 C
2
= 0 - - - - - - - (1)
































( ) ( ) | |

− + − + − + − +
1
0
3 2
2
2
1
2
d x x x x 6 2 C x x 2 C x x


0.25 – 617 C
1
– 0.8 C
2
= 0 - - - - - - - - - (2)

From (1)&(2)

C
1
= 0.18, C
2
= 0.174





























S SO OL LU UT TI IO ON N: :



u = 0.18 x(1-x) + 0.174 x
2
(1-x)


R = x + 0.18 (-2 + x – x
2
) + 0.174 ( 2-6x + x
2
– x
3
)





























PETROV – GALERKIN METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.042 0.049
0.5 0.066 0.077
0.75 0.058 0.066
1 0 0
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
Least square method




=


1
0
2
1
0 dx R
C





=


1
0
2
2
0 dx R
C



( ) 0 2
1
1
0
2
1
=


=
(
¸
(

¸




d x
C
R
R d x R
C























0 dx
C
R
R
1
0
1
=






( ) ( ) | | ( )dx x x 2 x x x 6 2 C x x 2 C x
2
1
0
3 2 2
2
2
1
− + − − + − + − + − +




- 0.917 + 3.367 C
1
+ 1.687 C
2
= 0 ---------------(1)
















0 dx
C
R
R
1
0
2
=







( ) ( ) | | ( ) { } x d x x x x x x C x x C x

− + − − + − + − + − +
1
0
3 2 3 2
2
2
1
6 2 6 2 2



-0.95 + 1.687 C
1
+ 3.74 C
2
= 0 -------------(2)



168 . 0 , 187 . 0
2 1
= = ∴ C C
















S SO OL LU UT TI IO ON N: :





U U = = 0 0. .1 18 87 7 x x( (1 1- -x x) ) + + 0 0. .1 16 69 9 x x
2 2
( (1 1- -x x) )


R R = = x x + + 0 0. .1 18 87 7 ( (- -2 2 + + x x – – x x
2 2
) ) + + 0 0. .1 16 69 9 ( (2 2- -6 6x x + + x x
2 2
– – x x
3 3
) )



























LEAST SQUARE METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.058 0.066
1 0 0
RESIDUE CHART
Galerkin method



R x u
x d
u d
= − +
2
2
2
~
~
~



u
~
= x + C
1
(-2+x – x
2
) + C
2
(2-6x+x
2
-x
3
)


w
1 =
x – x
2
, w
2
= x
2
– x
3

( ) ( ) ( ) | | 0 6 2 2
1
0
3 2
2
2
1
2
= − + − + − + − + −

dx x x x C x x C x x x

0.3 C
1
- 0.15 C
2
+ 0.083 = 0 - - - - - -(1)







( ) ( ) ( ) | | 0 6 2 2
1
0
3 2
2
2
1
3 2
= − + − + − + − + −

d x x x x C x x C x x x

- 0.15C
1
– 0.123 C
2
+ 0.05 =0 - - - - - (2)
from (1) & (2)
C
1
= 0.174, C
2
= 0.194
u
= 0.174 x (1-x) + 0.194 x
2
(1 – x)
R = x + 0.174 (-2+x-x
2
) +0.194 (2 – 6x + x
1
– x
3
)




GALERKIN METHOD
XVALUES U
0 0
0.25 0.042
0.5 0.068
0.75 0.059
1 0
COMPARISON
X VALUES U U
0 0 0
0.25 0.041 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
GALERKIN METHOD
XVALUES RESIDUE
0 0.04
0.25 0.041
0.75 0.025
1 -0.124


V VA AR RI IA AT TI IO ON NA AL L M ME ET TH HO OD D O OF F A AP PP PR RO OX XI IM MA AT TI IO ON N: :

R RA AY YL LE EI IG GH H R RI IT TZ Z M ME ET TH HO OD D

C Co on ns si id de er r t th he e e eq qu ua at ti io on n : :



0
2
2
2
= + − x cu
dx
u d


B Bo ou un nd da ar ry y c co on nd di it ti io on n: :

u=0;x=0
u=0;x=1





















) 1 (
2
1
2
1
0
0
0
2
1
2
1
) (
1
0
2 2
2
2
2
2
2
1
0
2 2
2
2
_
− − − − − −
(
(
¸
(

¸

+ −
|
|
.
|

\
|
=
= + − −
=
|
.
|

\
|
− + −
=
|
.
|

\
|






(
¸
(

¸

+ − =


dx u x Cu
dx
u d
I
x cu
dx
u d
dx
du
dx
d
x cu
u
F
dx
d
X
F
F
dx u x Cu
dx
u d
u I



















Approximate solution is


functions. Trial ..... , ,
....
~
~
3 2 1
3 3 2 2 1 1
1
φ φ φ
φ φ φ φ
φ φ
+ + + + =
+ =
°
=
° ∑
c c c u
c u
N
i
i i

Take

) 1 (
) 1 (
) 1 (
) 1 (
3
2
x x
x x
x x
x x
n
− =
− =
− =
− =
φ
φ
φ
φ





















) 1 ( . . . . . . ) 1 ( ) 1 ( ) 1 ( 0
~
3
3
2
2 1
x x C x x C x x C x x C u
n
N
− + + − + − + − + =


Let N = 2,


) 1 ( ) 1 (
~
2
2 1
x x C x x C u − + − =

From equ (1)



= I

∑ ∑ ∑
¦
)
¦
`
¹
¦
¹
¦
´
¦
+
|
|
.
|

\
|
|
|
.
|

\
|

(
(
¸
(

¸

|
|
.
|

\
|
|
|
.
|

\
|
= = =
1
0
2
1
2
2
2
1
2
2
1
2
1
2
1
dx C x C C C
dx
d
j
j j
j
j j
j
j j
φ φ φ

for

, 0
, 0
2
1
=


=


C
I
C
I










dx C C x C C C
dx
d
C
dx
d
C I
¦
)
¦
`
¹
¦
¹
¦
´
¦
+ + + −
|
.
|

\
|
+ =

) ( ) (
2
1
2
1
2 2 1 1
2 2
2 2 1 1
1
0
2
2
2
1
1
φ φ φ φ
φ φ





=


1
C
I
0 ) (
1
2
1 2 2 1 1
1
0
1 2
2
1
1
= + + −
|
.
|

\
|
+

dx x C C C
dx
d
dx
d
C
dx
d
C φ φ φ φ
φ φ φ







=


2
C
I

0 ) ) (
2
2
2 2 2 1 1
1
0
2 2
2
1
1
= + + −
|
.
|

\
|
+

d x x C C C
d x
d
d x
d
C
d x
d
C φ φ φ φ
φ φ φ
























0 ) (
1
1
0
2
2 1
1
0
2 1
2
1
0
2
1
2
1
1
= − = −
|
.
|

\
|
|
.
|

\
|
+
|
|
.
|

\
|

|
.
|

\
|
∫ ∫ ∫
dx x dx C
dx
d
dx
d
C dx C
dx
d
C φ φ φ
φ φ
φ
φ




0 ) (
2
1
0
2
2
2
1
0
2
2
2
1
0
2 1
2 1
1
= − = −
|
.
|

\
|
+
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|
∫ ∫ ∫
d x x d x C
d x
d
C d x C
d x
d
d x
d
C φ φ
φ
φ φ
φ φ





(
(
(
(
(
(
¸
(

¸

= −
= −
=
(
¸
(

¸

(
(
(
(
(
¸
(

¸


|
.
|

\
|
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|
|
|
.
|

\
|

|
.
|

\
|


∫ ∫
∫ ∫
0
0
) (
) (
2
1
0
2
1
1
0
2
2
1
2
2
1
0
2
1
0
2 1
2 1
2 1
1
0
2 1
1
0
2
1
2
1
dx x
dx x
C
C
dx C
dx
d
dx C
dx
d
dx
d
dx C
dx
d
dx
d
dx C
dx
d
φ
φ
φ
φ
φ φ
φ φ
φ φ
φ φ
φ
φ





















|
|
.
|

\
|

|
.
|

\
|
1
0
2
1
2
1
dx C
dx
d
φ
φ
=
| |

|
|
.
|

\
|
− −
|
.
|

\
|

1
0
2
2
) 1 (
) 1 (
dx x x C
dx
x dx





− − −
1
0
2 2
)] 1 ( [ ) 2 1 ( dx x x C x


=

− + − − +
1
0
2 2 2
)] 2 1 ( [ 4 4 1 dx x x x C x x


=
1
0
4 5 3 2 3
4
2
5 3 2
4
3
4
(
¸
(

¸

+ − − − +
x
C
x
C
x
C
x x
x
=
|
.
|

\
|
− C
30
31
3
1























S SO OL LU UT TI IO ON N: :





U U = = 0 0. .1 18 87 7 x x( (1 1- -x x) ) + + 0 0. .1 16 69 9 x x
2 2
( (1 1- -x x) )


R R = = x x + + 0 0. .1 18 87 7 ( (- -2 2 + + x x – – x x
2 2
) ) + + 0 0. .1 16 69 9 ( (2 2- -6 6x x + + x x
2 2
– – x x
3 3
) )



























LEAST SQUARE METHOD
COMPARISON
X VALUES U U
0 0 0
0.25 0.043 0.049
0.5 0.068 0.077
0.75 0.058 0.066
1 0 0
RESIDUE CHART
Galerkin method



R x u
x d
u d
= − +
2
2
2
~
~
~



u
~
= x + C
1
(-2+x – x
2
) + C
2
(2-6x+x
2
-x
3
)


w
1 =
x – x
2
, w
2
= x
2
– x
3

( ) ( ) ( ) | | 0 6 2 2
1
0
3 2
2
2
1
2
= − + − + − + − + −

dx x x x C x x C x x x

0.3 C
1
- 0.15 C
2
+ 0.083 = 0 - - - - - -(1)







( ) ( ) ( ) | | 0 6 2 2
1
0
3 2
2
2
1
3 2
= − + − + − + − + −

d x x x x C x x C x x x

- 0.15C
1
– 0.123 C
2
+ 0.05 =0 - - - - - (2)
from (1) & (2)
C
1
= 0.174, C
2
= 0.194
u
= 0.174 x (1-x) + 0.194 x
2
(1 – x)
R = x + 0.174 (-2+x-x
2
) +0.194 (2 – 6x + x
1
– x
3
)




GALERKIN METHOD
XVALUES U
0 0
0.25 0.042
0.5 0.068
0.75 0.059
1 0
COMPARISON
X VALUES U U
0 0 0
0.25 0.041 0.049
0.5 0.068 0.077
0.75 0.059 0.066
1 0 0
GALERKIN METHOD
XVALUES RESIDUE
0 0.04
0.25 0.041
0.75 0.025
1 -0.124


V VA AR RI IA AT TI IO ON NA AL L M ME ET TH HO OD D O OF F A AP PP PR RO OX XI IM MA AT TI IO ON N: :

R RA AY YL LE EI IG GH H R RI IT TZ Z M ME ET TH HO OD D

C Co on ns si id de er r t th he e e eq qu ua at ti io on n : :



0
2
2
2
= + − x cu
dx
u d


B Bo ou un nd da ar ry y c co on nd di it ti io on n: :

u=0;x=0
u=0;x=1





















) 1 (
2
1
2
1
0
0
0
2
1
2
1
) (
1
0
2 2
2
2
2
2
2
1
0
2 2
2
2
_
− − − − − −
(
(
¸
(

¸

+ −
|
|
.
|

\
|
=
= + − −
=
|
.
|

\
|
− + −
=
|
.
|

\
|






(
¸
(

¸

+ − =


dx u x Cu
dx
u d
I
x cu
dx
u d
dx
du
dx
d
x cu
u
F
dx
d
X
F
F
dx u x Cu
dx
u d
u I



















Approximate solution is


functions. Trial ..... , ,
....
~
~
3 2 1
3 3 2 2 1 1
1
φ φ φ
φ φ φ φ
φ φ
+ + + + =
+ =
°
=
° ∑
c c c u
c u
N
i
i i

Take

) 1 (
) 1 (
) 1 (
) 1 (
3
2
x x
x x
x x
x x
n
− =
− =
− =
− =
φ
φ
φ
φ





















) 1 ( . . . . . . ) 1 ( ) 1 ( ) 1 ( 0
~
3
3
2
2 1
x x C x x C x x C x x C u
n
N
− + + − + − + − + =


Let N = 2,


) 1 ( ) 1 (
~
2
2 1
x x C x x C u − + − =

From equ (1)



= I

∑ ∑ ∑
¦
)
¦
`
¹
¦
¹
¦
´
¦
+
|
|
.
|

\
|
|
|
.
|

\
|

(
(
¸
(

¸

|
|
.
|

\
|
|
|
.
|

\
|
= = =
1
0
2
1
2
2
2
1
2
2
1
2
1
2
1
dx C x C C C
dx
d
j
j j
j
j j
j
j j
φ φ φ

for

, 0
, 0
2
1
=


=


C
I
C
I










dx C C x C C C
dx
d
C
dx
d
C I
¦
)
¦
`
¹
¦
¹
¦
´
¦
+ + + −
|
.
|

\
|
+ =

) ( ) (
2
1
2
1
2 2 1 1
2 2
2 2 1 1
1
0
2
2
2
1
1
φ φ φ φ
φ φ





=


1
C
I
0 ) (
1
2
1 2 2 1 1
1
0
1 2
2
1
1
= + + −
|
.
|

\
|
+

dx x C C C
dx
d
dx
d
C
dx
d
C φ φ φ φ
φ φ φ







=


2
C
I

0 ) ) (
2
2
2 2 2 1 1
1
0
2 2
2
1
1
= + + −
|
.
|

\
|
+

d x x C C C
d x
d
d x
d
C
d x
d
C φ φ φ φ
φ φ φ
























0 ) (
1
1
0
2
2 1
1
0
2 1
2
1
0
2
1
2
1
1
= − = −
|
.
|

\
|
|
.
|

\
|
+
|
|
.
|

\
|

|
.
|

\
|
∫ ∫ ∫
dx x dx C
dx
d
dx
d
C dx C
dx
d
C φ φ φ
φ φ
φ
φ




0 ) (
2
1
0
2
2
2
1
0
2
2
2
1
0
2 1
2 1
1
= − = −
|
.
|

\
|
+
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|
∫ ∫ ∫
d x x d x C
d x
d
C d x C
d x
d
d x
d
C φ φ
φ
φ φ
φ φ





(
(
(
(
(
(
¸
(

¸

= −
= −
=
(
¸
(

¸

(
(
(
(
(
¸
(

¸


|
.
|

\
|
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|

|
.
|

\
|
|
.
|

\
|
|
|
.
|

\
|

|
.
|

\
|


∫ ∫
∫ ∫
0
0
) (
) (
2
1
0
2
1
1
0
2
2
1
2
2
1
0
2
1
0
2 1
2 1
2 1
1
0
2 1
1
0
2
1
2
1
dx x
dx x
C
C
dx C
dx
d
dx C
dx
d
dx
d
dx C
dx
d
dx
d
dx C
dx
d
φ
φ
φ
φ
φ φ
φ φ
φ φ
φ φ
φ
φ





















|
|
.
|

\
|

|
.
|

\
|
1
0
2
1
2
1
dx C
dx
d
φ
φ
=
| |

|
|
.
|

\
|
− −
|
.
|

\
|

1
0
2
2
) 1 (
) 1 (
dx x x C
dx
x dx





− − −
1
0
2 2
)] 1 ( [ ) 2 1 ( dx x x C x


=

− + − − +
1
0
2 2 2
)] 2 1 ( [ 4 4 1 dx x x x C x x


=
1
0
4 5 3 2 3
4
2
5 3 2
4
3
4
(
¸
(

¸

+ − − − +
x
C
x
C
x
C
x x
x
=
|
.
|

\
|
− C
30
31
3
1






















= |
.
|

\
|
− C
30
31
3
1
|
.
|

\
|

60 6
1 C
C
1

20
1


=
|
.
|

\
|

60 6
1 C
|
.
|

\
|
+ C
35
2
15
2
C
2
30
1





B C = F

C = B
–1
F

B
–1
=
(
(
(
(
¸
(

¸

|
.
|

\
|

|
.
|

\
|

|
.
|

\
|

|
.
|

\
|

C
C
C
C
30
31
3
1
60 6
1
60 6
1
35
2
15
2
*
|
.
|

\
|

|
.
|

\
|
− −
|
.
|

\
|

|
.
|

\
|

6 0 6
1
6 0 6
1
3 0
3 1
3
1
3 5
2
1 5
2
1
C C
C C




=
3600 360 360 360 36
1
525
31
225
31
105
2
45
2
2 2
C C C C C
C C −
|
.
|

\
|
+ +
|
.
|

\
|
+ − −
|
.
|

\
|

|
.
|

\
|
+



















=
(
(
(
(
¸
(

¸

|
.
|

\
|

|
.
|

\
|

|
.
|

\
|

|
.
|

\
|

C
C
C
C
30
31
3
1
60 6
1
60 6
1
35
2
15
2
*
(
¸
(

¸

− −
2
059 . 0 113 . 0 009 . 0
1
C C
*
(
(
(
¸
(

¸



30
1
20
1





=
(
¸
(

¸

− −
2
059 . 0 113 . 0 009 . 0
1
C C
(
¸
(

¸

=
|
.
|

\
|

|
.
|

\
|

+
|
.
|

\
|


1
6 0 6
1
3 0
1
3 5
2
1 5
2
2 0
1
C
C
C








=
(
¸
(

¸

− −
2
059 . 0 113 . 0 009 . 0
1
C C

(
¸
(

¸

=
|
.
|

\
|

|
.
|

\
|

+
|
.
|

\
|


.
30
31
3
1
30
1
60 6
1
20
1
2
C C
C
















C
1
=

(
¸
(

¸

− −

2
059 . 0 113 . 0 009 . 0
1
C C
{ } ) 1 ......( 0012 0023 . 0 + C



C
2
=
(
¸
(

¸

− −

2
059 . 0 113 . 0 009 . 0
1
C C
{ } ) 2 ........( 019 . 0 035 . 0 + − C



From (1)&(2)

PutC = 1,

C
1
= - 0.0813

C
2
= - 0.171









P PI IE EC CE EW WI IS SE E A AP PP PR RO OX XI IM MA AT TI IO ON N: :

P Pr ro ob bl le em m: :


1 1 2 2 3 3



Consider the element,



1
st
element,


1 1 2 2




















2 1
1

P PI IE EC CE EW WI IS SE E A AP PP PR RO OX XI IM MA AT TI IO ON N: :



dx
x x
x x
x x
K
x x dx
dN
x x dx
dN
x x
x x
N
x x
x x
N
dx N N
dx
dN
dx
dN
K
e
e
j
e
i
j
e
i
e
j i
e
2
1 2
2
5 . 0
0
2
1 2
11
1 2
1
1 2
1
2 1
1
2
1 2
2
1
,
1
1
,
1
|
|
.
|

\
|



|
|
.
|

\
|

− =

− =

− =


=


=
|
|
.
|

\
|
− =




( )
| |
83 . 2
83 . 2
) 5 . 0 (
) ) (
25 . 0
1
) (
) )( ( 1 1
83 . 1
3
4
) 2 ( 1
5 . 0
1
5 . 0
2
5 . 0
1
5 . 0
0
2 1
1 2
21
2
1
2
1 2 2
5 . 0
0
2
1 2
1 2
1 2
5 . 0
0
1 2
5 . 0
0
2 1
2 1
12
5 . 0
0
3
2
2
2
2
5 . 0
0
2
2
2
2
2
5 . 0
0
2
2
2
2
2
2
− =
|
.
|

\
|
− =
− =
+ − −

|
.
|

\
|
− =
(
¸
(

¸


− −

|
|
.
|

\
|


|
|
.
|

\
|

− =
|
.
|

\
|
− =
=

\
|
|
|
.
|
− − − =
+ − −
|
.
|

\
|

=
¦
)
¦
`
¹
¦
¹
¦
´
¦
+ −

|
.
|

\
|

=






dx N N
dx
dN
dx
dN
K
dx
x x x x x x x
dx
x x
x x x x
x x x x
dx N N
dx
dN
dx
dN
K
x
x x x x x
dx x xx x
dx
x xx x

∫ R ( x)W dx =0
x i

i=1,2,3…..n

Where the number of weight funcions wiis equal to the number of unknown i constants ai in u. The result is a set of n algebraic equations for the unknown constants ai i There are at least five MWR methods according to choices of weight functions

These five me thods are : 1..Collocation method. 2. Sub-domain method. 4. Galerkin method. 3. Least Squares method. 5. Method of moments

2.1 Collocation Method
In this method, the weighting functions are taken from the family of Dirac d functions in the domain. That is, Wi(x)=δ(x-xi) The dirac delta function has the

The following property.

δ (x − x ) = {
i

1 0

x=xi
otherwise

at specific points in the domain. That is integration of with dirac delta function results.Hence
the integration of the weighted residual statement results in the forcing the residual to zero

R(xi)=0

Sub Domain Method
This method doesn’t use weighting factors explicity, so it is not,strictly speaking, a member of the Weighted Residuals family. However, it can be considered a modification of the collocation method. The idea is to force the weighted residual to zero not just at fixed points in the domain, but over various subsections of the domain. To accomplish this,the weight functions are set to unity, and the integral over the entiredomain is broken into a number of subdomains sufficient to evaluate all unknown parameters. That is

∫ R ( x)W dx = ∑ ( ∫ R ( x)dx = 0
i x i xi

Least Square Method If the continuous summation of all the squared residuals is minimized,the rationale behind the name can be seen. In other words, a minimum of

S = ∫ R ( x ) dx = ∑ ( ∫ R ( x ) dx = 0
2 i

In order to achieve a minimum of this scalar function, the derivatives of S with respect to all the unknown parameters must be zero. That is, ∂S ∂R ∂R = 2∫ R( x) dx = 0 W =2 ∂a x ∂a ∂a
i

x

i

xi

i

i

i

however, the “2” can be dropped, since it cancels out in the equation.Therefore the weight functions for the Least Squares Method are justthe dierivatives of the residual with respect to the unknown constants:

2.4 Galerkin Method This method may be viewed as a modification of the Least SquaresMethod. the weight functions are chosen from the family of polynomials.2. Rather than using the derivative of the residual with respectto the unknown ai.1..3 …. if the function is approximated as in 2.n wi=xi .That is. then the method of moments may be identical to the Galerkin method i=1. then the weight functions are ∂u W = ∂a i i ~ Note that these are then identical to the original basis functions Method of Moments ∂u = φ ( x) W = ∂a i i i ~ In this method. the derivative of the approximating function is used. That is In the event that the basis functions for the approximation (the ϕi’s) were chosen as polynomial.

etc 0 2 1 2 u ( x) ≅ u ( x) = φ + ∑ a φ n 0 i =1 i i . the exact solution can be found and is.EXAMPLE As an example.. in general form. Find u(x) that satisfies d 2u u(0)=1 + u =1 u(1)=0 dx 2 Note that for this problem the differential operator D(u(x)) and p(x) a d2 D (u ( x) = ( 2 + 1)u ( x) And p(x)=1 dx For reference.φ = x ( x − 1). U(x)=C1sinx+C2cosx+1 and for the given boundary conditions the constants can be evaluated u(0) = 1 = C2=0 u(1) = 0 = C1=-1/sin(1) So the exact solution is sin x u ( x) = 1 − sin 1 Let’s solve by the Method of Weighted Residuals ~ The function is approximated as φ =1− x φ = x( x − 1)... consider the solution of the following mathematical problem.

5+2)=0 1 a1=+0. only onecollocation point is needed.6.5)=. Therefore. We choose (arbitrarily. but from symmetrconsiderations) the collocation point x = 0.285714 2.Take n as 1 ~ 2 u ( x) = 1 − x + a ( x − x) 2 i ~ ~ d u + u− 1 R( x) = dx 2 R ( x ) = − x + a ( x − x + 2) 2 1 Collocation Method For the collocation method. the equationneeded to evaluate the unknown a1 is The approx. the relation to evalutate the constant a1 is u ( x) = 1 − x + 0.272727 1 .5/1. the residual is forced to zero at a numberof discrete points. Since there is only one unknown (a2).75=0.2 Subdomain Method Since we have one unknown constant.R ( x ) dx = 0 0 1 ∫ [ − x + a ( x − x + 2)]dx = 0 2 1 0 1 The approx.285714( x − x) 2 ~ ∫ 1. Thus.0.5+a (0.5. solution is a (1 / 3 − 1 / 2 + 2) = 1 / 2 1 u ( x) = 1 − x + 0. solution is R(0.272727( x − x) 2 ~ a = 3 / 11 = 0. we choose a single “subdomain” which covers the entire range of x.25-.

(10 / 3) = 0.[ − x + a ( x − x + 2)]dx = 0 2 2 1 0 1 The approx.272277 1 The approx.277 1 u = 1 − x + 0. the weight function W1 is the derivative of the approximating function eu(x) with respect to the unknown coefficient ~ w ( x) = 1 1 1 du =x −x da 2 1 ∫ w ( x) R( x) = 0 0 ∫ w ( x) R( x) = 0 1 0 1 ∫ ( x − x ).277( x − x) 2 ~ .[− x + a ( x − x + 2)]dx = 0 2 0 − 11 / 12 + (101 / 30)a = 0 1 a = (11 / 12). solution is − 1 / 12 − (3 / 10) a = 0 1 a = (1 / 12).(30 / 101) = 0. solution is u = 1 − x + 0.2722( x − x) 2 ~ GALERKIN METHOD In the Galerkin Method.LEAST SQUARES METHOD The weight function W1 is just the derivative of R(x) with respect to the unknown a1 w ( x) = 1 1 2 dR = x −x+2 da 2 1 1 ∫ ( x − x + 2).

0000 1.75644 0.55 0.58806 0.75556 0.0000 1.28500 0.64000 0.69886 0.69895 0.58500 0.93681 0.38261 0.33143 0.58795 0.33333 0.00 1.0000 1.33455 0.94060 0.1: Comparison of Different Approximations in Example 1.58681 0.70 0.38250 0.43025 0.10 0.59250 0.87550 0.53455 0.0000 0.81523 0.82241 0.69792 0.Table 2.43056 0.53465 0.48250 0.87545 0.93643 0.87500 0.30 0.48261 0.76390 0.24000 0.48309 0.28080 0.64881 0.37929 0.28806 0.05 0.32898 0.42857 0.24167 cont .24282 0.23441 0.45 0.24273 0. X exact collocation Subdomain LeastSquares Galerkin 0.81528 0.75429 0.53722 0.64282 0.40 0.64167 0.75636 0.43193 0.28681 0.35 0.60 0.69643 0.50 0.33465 0.65 0.28795 0.47929 0.53143 0.93707 0.38125 0.87429 0.81357 0.48125 0.53333 0.37884 0.1 0.64273 0.0000 1.81458 0.93705 0.43182 0.20 0.70599 0.88136 0.25 0.

.

Consider the equation : du +u − x =0 dx 2 2 2 0 < x < 1. Boundary conditions: u =0. x=1 Exact solution is given by sin x + 2 sin(1 − x) u ( x) = + x2 − 2 sin 1 . x=0 u=0.

METHOD OF WEIGHTED RESIDUALS(MWR) • • • • • Collocation method Subdomain method Least square method Petrov – Galerkin method Bubnov – Galerkin method .

x =1.... φ3 .. x =0.. u=0 Where φ 0 is the solution which satisfies the boundary conditions alone.Approximate solution is ~ u = φ° + ∑ ciφi i =1 N ~ u = φ° + c1φ1 + c2φ 2 + c3φ3 + . φ1 . u =0. We know the boundary conditions Take φ° = 0 φ1 = x(1 − x) φ 2 = x 2 (1 − x) φ3 = x 3 (1 − x) φ n = x (1 − x) n . φ 2 . Trial functions...

75 1 ~ u = x + c1 x ( x − 1) + c2 x 2 ( x − 1) ~ d u ~ +u − x = R dx 2 2 2 R= x + C1 (-2+x – x2) + C2 (2-6x+x2-x3) 2 2 3   1 1 1 1  6 1 1  R = + C1  − 2 + −    + C2  2 − +   −    = 0   4 4 4 4  4 4 4      2  18  3  2  3 3  3 3  3 3  R = + C1  − 2 + −    + C2  2 − +   −    = 0  4 4 4  4 4  4 4      .25 0.Collocation method 0 0.

(1) 1.189 (-2 + x – x2) + 0.547C2 + 0.25 = 0 ---------.36 C2 + 0.75 = 0 ------------------(2) From (1)&(2) C1 = 0.1.189 x (1-x) + 0.172 ũ = 0.172 x2 (1-x) u R = x + 0.189 x C2 = 0.8125 C1 + 0.172 (2 – 6x + x2 – x3) .8125 C1 – 2.

COLLOCATION METHOD .

75 1 U 0 0.077 0.069 0.066 0 .25 0.044 0.COMPARISON X VALUES 0 0.06 0 U 0 0.049 0.5 0.

RESIDUE CHART .

..276 C2 = 0 .5 ∫ [x + C (− 2 + x − x ) + C (2 − 6x + x 1 2 0 0.5  0  0 0.5 0.(1) .5 ∫ R dx = 0 0 & 2 ∫ R dx = 0 0.5 1 0..125 – 0..5 2 − x3 d x )]  x2    6 2 x3 x 4  x 2 x3     2  + C1  − 2 x + 2 − 3  + C2  2 x − 2 x + 3 − 4       0.SUBDOMAIN METHOD 0.917 C1 + 0.

5     2 3 3 1 4 1 0. C2 = 0.5 3 4  0.913C1 – 1..188.171 .193 C2 = 0 .x  2  2 1    x x  x x  2  + C1  − 2 x + −  + C 2  2 x − 3x + −     2 3  0.From (1)&(2) (2) C1 = 0.5  0..375 – 0..

SUBDOMAIN METHOD .

COMPARISON X VALUES 0 0.077 0.068 0.049 0.066 0 .5 0.75 1 U 0 0.043 0.059 0 U 0 0.25 0.

SUBDOMAIN METHOD RESIDUE .

33 – 0...95 C2 = 0 ....92C1-0.(1) .Petrov-Galerkin Method ∫WRdx = 0 0 1 x x + C1 − 2 + x − x 2 + C2 2 − 6 x + x 2 − x 3 dx = 0 ∫ 0 1 [ w1 = x & w2 = x2 ( ) ( 2 )] ∫ {x + C (− 2 x + x − x )+ C (2x − 6x + x − x )}d x= 0 1 2 2 3 2 3 4 1 0 0..

x 2 x + C1 − 2 + x − x 2 + C 2 2 − 6 x + x 2 − x 3 d x ∫ 0 1 [ ( ) ( )] 0.25 – 617 C1 – 0..8 C2 = 0 . C2 = 0.....18.174 ....(2) From (1)&(2) C1 = 0.

18 (-2 + x – x2) + 0.174 x2 (1-x) R = x + 0.18 x(1-x) + 0.174 ( 2-6x + x2 – x3) .SOLUTION: u = 0.

PETROV – GALERKIN METHOD .

077 0.066 0.75 1 U 0 0.25 0.042 0.5 0.058 0 U 0 0.COMPARISON X VALUES 0 0.049 0.066 0 .

COMPARISON X VALUES 0 0.25 0.059 0 U 0 0.077 0.066 0 .75 1 U 0 0.5 0.043 0.068 0.049 0.

Least square method ∂ R 2 dx = 0 ∂C1 ∫ 0 1 ∂ ∂C 2 R 2 dx = 0 ∫ 0 1 1  ∂ 2 ∂R R d x = ∫ 2R d x = 0  ∂C1  ∂C1  0 ( ) .

0.∂R ∫ R ∂C1 dx = 0 0 1 ∫ [x + C (− 2 + x − x ) + C (2 − 6x 1 2 1 2 0 2 + x 2 − x 3 − 2 + x − x 2 dx )] ( ) .917 + 3.687 C2 = 0 ---------------(1) .367 C1 + 1.

187.687 C1 + 3.168 .∫R 0 1 1 ∂R dx = 0 ∂C 2 2 2 3 2 3 ∫ {[x + C (− 2 + x − x )+ C (2 − 6 x + x − x )] (2 − 6 x + x − x )}d x 1 2 0 -0.95 + 1. C2 = 0.74 C2 = 0 -------------(2) ∴ C1 = 0.

.

Consider the equation : du +u − x =0 dx 2 2 2 0 < x < 1. x=1 Exact solution is given by sin x + 2 sin(1 − x) u ( x) = + x2 − 2 sin 1 . Boundary conditions: u =0. x=0 u=0.

METHOD OF WEIGHTED RESIDUALS(MWR) • • • • • Collocation method Subdomain method Least square method Petrov – Galerkin method Bubnov – Galerkin method .

.. φ1 . φ 2 .... x =1. Trial functions.. u =0. We know the boundary conditions Take φ° = 0 φ1 = x(1 − x) φ 2 = x 2 (1 − x) φ3 = x (1 − x) 3 φ n = x (1 − x) n .. x =0.Approximate solution is ~ u = φ° + ∑ ciφi i =1 N ~ u = φ° + c1φ1 + c2φ 2 + c3φ3 + . u=0 Where φ 0 is the solution which satisfies the boundary conditions alone. φ3 .

25 0.75 1 ~ u = x + c1 x ( x − 1) + c2 x 2 ( x − 1) ~ d u ~ +u − x = R dx 2 2 2 R= x + C1 (-2+x – x2) + C2 (2-6x+x2-x3) 2 2 3   1 1 1 1  6 1 1  R = + C1  − 2 + −    + C2  2 − +   −    = 0   4 4 4 4  4 4 4      2  18  3  2  3 3  3 3  3 3  R = + C1  − 2 + −    + C2  2 − +   −    = 0  4 4 4  4 4  4 4      .Collocation method 0 0.

(1) 1.75 = 0 ------------------(2) From (1)&(2) C1 = 0.25 = 0 ---------.189 (-2 + x – x2) + 0.8125 C1 + 0.172 ũ = 0.1.172 (2 – 6x + x2 – x3) .189 x C2 = 0.547C2 + 0.172 x2 (1-x) u R = x + 0.8125 C1 – 2.36 C2 + 0.189 x (1-x) + 0.

COLLOCATION METHOD .

044 0.066 0 .069 0.75 1 U 0 0.06 0 U 0 0.COMPARISON X VALUES 0 0.049 0.5 0.25 0.077 0.

RESIDUE CHART .

.917 C1 + 0.5 0.5 ∫ [x + C (− 2 + x − x ) + C (2 − 6x + x 1 2 0 0.(1) ...5 2 − x3 d x )]  x2    6 2 x3 x 4  x 2 x3     2  + C1  − 2 x + 2 − 3  + C2  2 x − 2 x + 3 − 4       0.276 C2 = 0 .5 ∫ R dx = 0 0 & 2 ∫ R dx = 0 0..SUBDOMAIN METHOD 0.5  0  0 0.125 – 0.5 1 0.

5  0.5 3 4  0.x  2  2 1    x x  x x  2  + C1  − 2 x + −  + C 2  2 x − 3x + −     2 3  0.913C1 – 1.171 .375 – 0.From (1)&(2) (2) C1 = 0. C2 = 0.188..193 C2 = 0 ...5     2 3 3 1 4 1 0.

SUBDOMAIN METHOD .

043 0.25 0.049 0.5 0.059 0 U 0 0.066 0 .75 1 U 0 0.068 0.077 0.COMPARISON X VALUES 0 0.

SUBDOMAIN METHOD RESIDUE .

Petrov-Galerkin Method

∫WRdx = 0
0

1

x x + C1 − 2 + x − x 2 + C2 2 − 6 x + x 2 − x 3 dx = 0 ∫
0

1

[

w1 = x & w2 = x2

(

) (
2

)]

∫ {x + C (− 2 x + x − x )+ C (2x − 6x + x − x )}d x= 0
1 2 2 3 2 3 4 1 0

0.33 – 0.92C1-0.95 C2 = 0

- - - - - - - (1)

x 2 x + C1 − 2 + x − x 2 + C 2 2 − 6 x + x 2 − x 3 d x ∫
0

1

[

(

) (

)]

0.25 – 617 C1 – 0.8 C2 = 0 - - - - - - - - - (2) From (1)&(2) C1 = 0.18, C2 = 0.174

SOLUTION:

u = 0.18 x(1-x) + 0.174 x2 (1-x) R = x + 0.18 (-2 + x – x2) + 0.174 ( 2-6x + x2 – x3)

PETROV – GALERKIN METHOD .

25 0.042 0.049 0.058 0 U 0 0.75 1 U 0 0.077 0.5 0.066 0 .066 0.COMPARISON X VALUES 0 0.

043 0.COMPARISON X VALUES 0 0.049 0.066 0 .059 0 U 0 0.5 0.068 0.25 0.75 1 U 0 0.077 0.

Least square method ∂ R 2 dx = 0 ∂C1 ∫ 0 1 ∂ ∂C 2 R 2 dx = 0 ∫ 0 1 1  ∂ 2 ∂R R d x = ∫ 2R d x = 0  ∂C1  ∂C1  0 ( ) .

0.687 C2 = 0 ---------------(1) .367 C1 + 1.917 + 3.∂R ∫ R ∂C1 dx = 0 0 1 ∫ [x + C (− 2 + x − x ) + C (2 − 6x 1 2 1 2 0 2 + x 2 − x 3 − 2 + x − x 2 dx )] ( ) .

187.74 C2 = 0 -------------(2) ∴ C1 = 0. C2 = 0.687 C1 + 3.168 .∫R 0 1 1 ∂R dx = 0 ∂C 2 2 2 3 2 3 ∫ {[x + C (− 2 + x − x )+ C (2 − 6 x + x − x )] (2 − 6 x + x − x )}d x 1 2 0 -0.95 + 1.

169 x2 (1-x) R = x + 0.SOLUTION: U = 0.187 x(1-x) + 0.169 (2-6x + x2 – x3) .187 (-2 + x – x2) + 0.

LEAST SQUARE METHOD .

043 0.068 0.5 0.077 0.75 1 U 0 0.COMPARISON X VALUES 0 0.25 0.058 0 U 0 0.066 0 .049 0.

RESIDUE CHART .

3 C1...15 C2 + 0..083 = 0 .. 1 2 1 w2 = x2 – x3 2 2 2 ∫ (x − x )[x + C (− 2 + x − x )+ C (2 − 6 x + x 0 − x 3 dx = 0 )] 0.Galerkin method ~ du ~ +u − x = R ~ dx 2 2 2 ~ u = x + C1 (-2+x – x2) + C2 (2-6x+x2-x3) w1 = x – x2.0.-(1) .

174.194 (2 – 6x + x1 – x3) .(2) from (1) & (2) C1 = 0..174 (-2+x-x2) +0.. C2 = 0..194 x2 (1 – x) R = x + 0..∫ (x − x )[x + C (− 2 + x − x )+ C (2 − 6x + x − x )]d x= 0 1 2 3 2 2 3 1 2 0 .05 =0 .174 x (1-x) + 0.15C1 – 0.194 u = 0.123 C2 + 0.0.

042 0.068 0.25 0.059 0 .5 0.GALERKIN METHOD XVALUES 0 0.75 1 U 0 0.

041 0.5 0.066 0 .059 0 U 0 0.068 0.75 1 U 0 0.049 0.25 0.COMPARISON X VALUES 0 0.077 0.

124 .041 0.025 1 -0.04 0.25 0.GALERKIN METHOD XVALUES RESIDUE 0 0.75 0.

VARIATIONAL METHOD OF APPROXIMATION: RAYLEIGH RITZ METHOD Consi der the equati on : d u − cu + x 2 = 0 dx 2 Boundary condition: u=0.x=1 2 .x=0 u=0.

 1 d 2u 1 2 2  I (u ) = ∫  − C u + x u  dx 2 2 dx 2  0 ∂F d  ∂F  −  =0 ∂F ∂X dx  ∂u  d  du  2 − cu + x −   = 0 dx  dx  d 2u − 2 − cu + x 2 = 0 dx 2 1 1d u 1 2 2    − C u + x u  dx − − − − − −(1) I = ∫  2  dx  2   0   _ 1 .

φ2 ... φ3 .Approximate solution is ~ u = φ° + ∑ ciφi i =1 N ~ u = φ° + c1φ1 + c2φ2 + c3φ3 + . Trial functions... Take φ = x(1 − x) φ = x 2 (1 − x) φ = x (1 − x) 3 φ = x (1 − x) n .. φ1 ...

~ u = C1 x(1 − x) + C2 x 2 (1 − x) From equ (1) 2 2    2  2   1  2   1  d   2    ∑ C jφ j    − C   ∑ C jφ j   + x ∑ C jφ j dx ∫  2 dx  j =1   2   j =1    0     j =1   1 I= for ∂I = 0. .+ CN x n (1 − x) . . ∂C1 ∂I = 0.~ u = 0 + C1 x(1 − x) + C2 x 2 (1 − x) + C3 x3 (1 − x) + . ∂C2 . Let N = 2. . .

2  1 1  dφ1  dφ2  1   2 2 I = ∫  C1 + C2  − C (C1φ1 + C2φ2 ) + x (C1φ1 + C2φ2 )dx dx  2  0 2  dx    ∂I = ∂C1 dφ2  dφ1  dφ1 2 + C2  − C (C1φ1 + C2φ2 )φ1 + x φ1dx = 0  C1 ∫0  dx dx  dx 1 ∂I = ∂C2 dφ2  dφ2  dφ1 C1 + C2  − C (C1φ1 + C2φ2 )φ2 + x 2φ2 )d x = 0 ∫0  d x d x  d x 1 .

1 1    dφ1  2 dφ1  dφ2   2 C1 ∫    − Cφ12 dx +C2 ∫    − (Cφ1φ2 )dx = − ∫ x φ1dx = 0   dx  dx  dx  0  0 0  1   dφ1  dφ2    dφ2  2 C1 ∫     − Cφ1φ2 d x+C2 ∫   − (Cφ2 )d x = − ∫ x 2φ2 d x = 0  dx dx  dx     0  0 0 1 1 2 1   1 2 2 1 1     dφ1    − ∫ x φ1dx = 0   dφ1  dφ2     − Cφ12 dx  ∫ ∫  dx  dx  − (Cφ1φ2 )dx C1   0    dx        0 0   C  =  1 1  2     dφ dφ    dφ2   1  2  2 1  ∫     − x 2φ dx = 0  dx dx  − Cφ1φ2 dx ∫  dx  − (Cφ2 )dx    0       0     ∫ 2   0 .

   dx(1 − x)  2    dφ1  2 2    − Cφ1 dx ∫    − C [x(1 − x)] dx ∫0   dx    =   dx  0    1 2 1 (1 − 2 x) 2 − C[ x(1 − x)] 2 dx ∫ 0 1 = 1 + 4 x 2 − 4 x − C[ x 2 (1 + x 2 − 2 x)]dx ∫ 0 1 =  x x x x x   x + 4 3 − 4 2 − C 3 − C 5 + 2C 4   0 3 2 3 5 4 1  1 31  C  − =3 30  .

SOLUTION:

U = 0.187 x(1-x) + 0.169 x2 (1-x) R = x + 0.187 (-2 + x – x2) + 0.169 (2-6x + x2 – x3)

LEAST SQUARE METHOD

COMPARISON
X VALUES 0 0.25 0.5 0.75 1 U 0 0.043 0.068 0.058 0 U 0 0.049 0.077 0.066 0

RESIDUE CHART .

.3 C1. 1 2 1 w2 = x2 – x3 2 2 2 ∫ (x − x )[x + C (− 2 + x − x )+ C (2 − 6 x + x 0 − x 3 dx = 0 )] 0.15 C2 + 0.-(1) .Galerkin method ~ du ~ +u − x = R ~ dx 2 2 2 ~ u = x + C1 (-2+x – x2) + C2 (2-6x+x2-x3) w1 = x – x2.083 = 0 ...0..

194 x2 (1 – x) R = x + 0.∫ (x − x )[x + C (− 2 + x − x )+ C (2 − 6x + x − x )]d x= 0 1 2 3 2 2 3 1 2 0 ..174 (-2+x-x2) +0.(2) from (1) & (2) C1 = 0.0..15C1 – 0.194 (2 – 6x + x1 – x3) .123 C2 + 0.05 =0 .194 u = 0. C2 = 0.174 x (1-x) + 0...174.

5 0.GALERKIN METHOD XVALUES 0 0.059 0 .042 0.75 1 U 0 0.25 0.068 0.

041 0.75 1 U 0 0.25 0.COMPARISON X VALUES 0 0.5 0.049 0.077 0.059 0 U 0 0.068 0.066 0 .

04 0.75 0.124 .GALERKIN METHOD XVALUES RESIDUE 0 0.041 0.025 1 -0.25 0.

x=0 u=0.VARIATIONAL METHOD OF APPROXIMATION: RAYLEIGH RITZ METHOD Consi der the equati on : d u − cu + x 2 = 0 dx 2 Boundary condition: u=0.x=1 2 .

 1 d 2u 1 2 2  I (u ) = ∫  − C u + x u  dx 2 2 dx 2  0 ∂F d  ∂F  −  =0 ∂F ∂X dx  ∂u  d  du  2 − cu + x −   = 0 dx  dx  d 2u − 2 − cu + x 2 = 0 dx 2 1 1d u 1 2 2    − C u + x u  dx − − − − − −(1) I = ∫  2  dx  2   0   _ 1 .

.... Take φ = x(1 − x) φ = x 2 (1 − x) φ = x (1 − x) 3 φ = x (1 − x) n . φ1 ... φ2 . Trial functions.. φ3 .Approximate solution is ~ u = φ° + ∑ ciφi i =1 N ~ u = φ° + c1φ1 + c2φ2 + c3φ3 + .

.~ u = 0 + C1 x(1 − x) + C2 x 2 (1 − x) + C3 x3 (1 − x) + . ∂C1 ∂I = 0. ~ u = C1 x(1 − x) + C2 x 2 (1 − x) From equ (1) 2 2    2  2   1  2   1  d   2    ∑ C jφ j    − C   ∑ C jφ j   + x ∑ C jφ j dx ∫  2 dx  j =1   2   j =1    0     j =1   1 I= for ∂I = 0. . Let N = 2. . ∂C2 . .+ CN x n (1 − x) .

2  1 1  dφ1  dφ2  1   2 2 I = ∫  C1 + C2  − C (C1φ1 + C2φ2 ) + x (C1φ1 + C2φ2 )dx dx  2  0 2  dx    ∂I = ∂C1 dφ2  dφ1  dφ1 2 + C2  − C (C1φ1 + C2φ2 )φ1 + x φ1dx = 0  C1 ∫0  dx dx  dx 1 ∂I = ∂C2 dφ2  dφ2  dφ1 C1 + C2  − C (C1φ1 + C2φ2 )φ2 + x 2φ2 )d x = 0 ∫0  d x d x  d x 1 .

1 1    dφ1  2 dφ1  dφ2   2 C1 ∫    − Cφ12 dx +C2 ∫    − (Cφ1φ2 )dx = − ∫ x φ1dx = 0   dx  dx  dx  0  0 0  1   dφ1  dφ2    dφ2  2 C1 ∫     − Cφ1φ2 d x+C2 ∫   − (Cφ2 )d x = − ∫ x 2φ2 d x = 0  dx dx  dx     0  0 0 1 1 2 1   1 2 2 1 1     dφ1    − ∫ x φ1dx = 0   dφ1  dφ2     − Cφ12 dx  ∫ ∫  dx  dx  − (Cφ1φ2 )dx C1   0    dx        0 0   C  =  1 1  2     dφ dφ    dφ2   1  2  2 1  ∫     − x 2φ dx = 0  dx dx  − Cφ1φ2 dx ∫  dx  − (Cφ2 )dx    0       0     ∫ 2   0 .

   dx(1 − x)  2    dφ1  2 2    − Cφ1 dx ∫    − C [x(1 − x)] dx ∫0   dx    =   dx  0    1 2 1 (1 − 2 x) 2 − C[ x(1 − x)] 2 dx ∫ 0 1 = 1 + 4 x 2 − 4 x − C[ x 2 (1 + x 2 − 2 x)]dx ∫ 0 1 =  x x x x x   x + 4 3 − 4 2 − C 3 − C 5 + 2C 4   0 3 2 3 5 4 1  1 31  C  − =3 30  .

=  1 31   − C  3 30  1 C   −   6 60  1 C   −   6 60  2 2   + C  15 35  C1 = C2 − 1 20 − 1 30 B C = F C = B –1F  2 2   1 C    15 − 35 C   6 − 60   1        1 31   *  2 2  1 3 1   1 C  1 C    1 − C   − C    − C  − C  −  −  −    6 60   3 30    1 5 3 5  3 3 0   6 6 0 6 6 0  B –1 = 2   31  31C 2 2   =  45 + 105C  −  225C  − 525   C  C2 1 C   C + − + − +  36 360  360 360 3600 .

009 − 0.  =  0.009− 0.059C 2     − 1  2 2   − 1  1 C    2 0 1 5− 3 5C  +  3 0 6 − 6 0 = C1         1   − 1  1 C   − 1  1 31    −  +   − C  = C2 . 2 2   1 5 − 3 5C    1 C =   −    6 6 0   1 C    −     6 6 0   1  − 1 31   *    − C    0.059C 2   20  6 60   30  3 30      .113 − 0.009− 0.113C − 0.059C 2  *  − C   3 30   1 2 0 1 3 0      = 1    0.113C − 0.

113C − 0..0813 C2 = ..−1   .0.019}...0023 C + 0012 }   −1   C2 =  0.009− 0..( 2) ..059C 2  {0.( 1) C1 =  0.009 − 0...035C + 0.0... C1 = .171 {− 0...113C − 0.059C 2    From (1)&(2) PutC = 1.

PIECEWISE APPROXIMATION: Problem: 1 1 2 2 3 Consider the element. 1 1 2 . 1st element.

PIECEWISE APPROXIMATION:  dN e i dN e j e e e K i. =− =− dx x2 − x1 dx x2 − x1 K11 = ∫ 0.5 0  1   x2 − x  −     x − x  − x − x  dx 2 1  1   2  2 2 . j = ∫   dx dx − N i N j dx   e x2 − x N1 = x2 − x1 x1 − x N2 = x1 − x2 1 1 dN1 dN1 .

5 0   dN 2 dN1 − N1 N 2 dx    dx dx = −2.5  1  ( x2 x − x2 x1 ) − x 2 + x1 x ) dx = ∫ − − 2 0 (0.83 .5)   0.83 K12 = 0.25  = −2.5)  0.= ∫ 0.5 ]  x  2  = 4 x − x2 x − x 2 x2 −  3 0   = 1.5  dN1 dN 2  − N1 N 2 dx  ∫0  dx dx  0.5     1 1 ( x2 − x )( x − x1 )  −  −  − = ∫   dx 0 x2 − x1   x2 − x1  ( x2 − x1 ) 2      0.5   1 ∫ [ − (x 0.83 K 21 = ∫ 0.5 0 2 2 − 2 xx2 + x 2 ) dx 3 0.5    2  −1  =  0.5 0 2  − 1  2 x2 − 2 xx2 + x 2     −  dx 2 (0.