You are on page 1of 5

Class Test 2 in EC60045

Nov. 8, 2011

Marks : 20

Q.1 (a) Consider the following differential equation


d2 f
= 1 + x2
0 x 1
dx 2
subject to f(0) = f(1) = 0. Divide the range of x into 3 equal segments of length x .

(a) Obtain the MoM solution for f(x) employing Galerkins approach and suitable basis
functions. Using this solution determine the expression for residual R g (x) and the
1

average error defined as g = Rg ( x)dx .


0

(b) Obtain the MoM solution for f(x) employing point matching and same basis functions
as in (a) above. Using this solution determine the expression for residual R p (x) and the
1

average error defined as p = R p ( x)dx


0

(c) Solve the differential equation by integrating it and determine the exact solution.
Compare with the solutions obtained using point matching and Galerkins methods.
(d) Comment on the errors g and p .
6,6,6,2
Solution

Since the operator is second-order differential type, the sub-domain basis should be
triangular or higher-order. We shall use triangular basis functions. Since these basis
occupy two consecutive sub-domains, only two basis functions (N = 2) can be
accomodated in 3 segments. This is shown in Fig. 1.

x1

x2

The residual for the differential equation is defined as


R ( x) =

d2 f
+1+ x2
dx 2

The unknown function f ( x) is determined by expanding it in a set of basis functions as

1/5

f = n fn

(9.95)

n =1

where the constants n are unknown, and needs to be determined. The n are found
such that the residual R( x) is forced to zero in an average sense, that is, the weighted
integral of the residual is set to zero,
(9.96)
w( x) R( x)dx = 0
where w( x) is called the weight function. In order to determine the constants n
uniquely, we should have N simultaneous equations. For this, we choose N weight
functions wm ( x) , m = 1,2,3,N, and form the weighted integrals as

wm ( x) R( x)dx = 0

m = 1,2,3,N

(9.97)

wm ( x) is also called test function in MoM language. The solution of the resulting set of
equations determines n and therefore f ( x) . Using triangular basis we write
f n = T ( x xn )
n = 1,2
where xn is the mid-point of the nth basis function. The use of these basis functions in
(9.94) gives the following residual
N
d2

R ( x) = 1 + x 2 + n 2 T ( x xn )
n =1
dx

1 2
n [ ( x xn 1 ) 2 ( x xn ) + ( x xn +1 ) ]
x n =1
The weighted residual (9.97) now becomes,
1
1
1 2
n wm ( x) [ ( x xn 1 ) 2 ( x xn ) + ( x xn +1 ) ]dx = wm ( x)(1 + x 2 )dx

x n =1 0
0
= 1 + x2 +

(9.99)

m = 1,2
(9.100)

(a) For the Galerkins MoM solution we choose wm ( x) = T ( x xm ) . The simultaneous


eqns are obtained by forcing R = 0, i.e.
2/3
2/3
1 2
n T ( x x1 ) [ ( x xn 1 ) 2 ( x xn ) + ( x xn +1 ) ]dx = T ( x x1 )(1 + x 2 )dx
x n =1
0
0
1

1 2
n T ( x x2 ) [ ( x xn1 ) 2 ( x xn ) + ( x xn+1 )]dx = T ( x x2 )(1 + x 2 )dx
x n =1 1/3
1/ 3

or
x2
2
1
1 2 = T ( x x1 )(1 + x 2 )dx
x
x
0
x

3
1
2
1 + 2 = T ( x x2 )(1 + x 2 )dx
x
x
x1

where x1 = 1/ 3, x2 = 2 / 3, x3 = 1, x = 1/ 3 .

The triangular basis function is defined as

2/5

x xm 1
x x
m m 1
x x
T ( x xm ) = m +1
xm +1 xm
0

for xm-1 x xm
for xm x xm +1
elsewhere

so that

for 0 x x1

x x
T ( x x1 ) = 2
for x1 x x2
x
elsewhere
0

x x1
for x1 x x2

1 x
for x2 x x3
T ( x x2 ) =
x
elsewhere
0

Integration gives
2/3

1 x12 x14 x22 x24


x2 x13 1 61
T ( x x1 )(1 + x )dx =
2 + + + x1 x2
=
3 x 486
x 2 4 2 12
2

2
T ( x x2 )(1 + x )dx =

1/ 3

x23 0.1626
1 x22 x24 x12 x14 x32 x34
x
x
x
2
+
+
+
+
+

+
+
(
)

=
1
3 2
3
x 2 4 2 12 2 12
x

or
2
1
61 1
1 2 =
486 x
x
x

1
2
0.1626
1 + 2 =
x
x
x

or

1 = 0.1378, 2 = 0.1502
or
N

f g ( x) = n f n ( x) = 0.1378T ( x x1 ) + 0.1502T ( x x2 )
n =1

3/5

The error R g (x) is obtained as


Rg ( x) = 1 + x 2 +

1 2
n [ ( x xn 1 ) 2 ( x xn ) + ( x xn +1 ) ]
x n =1

1
1 ( ( x x0 ) 2 ( x x1 ) + ( x x2 ) ) + 2 ( ( x x1 ) 2 ( x x2 ) + ( x x3 ) )
x
1
0.1378 ( ( x x0 ) 2 ( x x1 ) + ( x x2 ) ) + 0.1502 ( ( x x1 ) 2 ( x x2 ) + ( x x3 ) )
= 1 + x2 +
x

= 1 + x2 +

The average error g is found as


1

g = Rg ( x)dx
0
1

= ( x + x 3 / 3) = 4 / 3 , the delta function contribution becomes zero on addition.


0

(b) For the MoM point matching solution at x = xm we choose wm ( x) = ( x xm ) . The


simultaneous eqns are obtained as
x1 +
x1 +
1 2
n lim ( x x1 ) [ ( x xn 1 ) 2 ( x xn ) + ( x xn +1 ) ]dx = lim ( x x1 )(1 + x 2 )dx
0
x n =1 0 x1
x1
x +

x +

2
2
1 2
lim
(
)
(
)
2
(
)
(
)
lim

x
+

x
dx
=
( x x2 )(1 + x 2 )dx

n
n 1
n
n +1 ]
2 [

0
0

x n =1
x2
x2

or
2
1
1 ( x x1 ) 2 ( x x1 ) = 1 + x12
x
x
1
2
1 ( x x2 ) + 2 ( x x2 ) = 1 + x22
x
x

where x1 = 1/ 3, x2 = 2 / 3, x3 = 1, x = 1/ 3

The solution is not possible.


(c) Integrating the differential equation twice gives
f ( x) =

x2 x4
+ + c1 x + c2
2 12

Applying the boundary conditions f(0) = f(1) = 0 yields c2 = 0, c1 = 7 /12 . Therefore,


exact solution of the differential eqn becomes
f e ( x) =

x2 x4 7
+ x
2 12 12

The solution is plotted next.

4/5

0.18
0.16
0.14
0.12

f(x)

0.1
0.08
0.06
0.04
0.02
0

0.1

0.2

0.3

0.4

0.5
x

0.6

0.7

0.8

Comparing with
f g ( x) = 0.1378T ( x x1 ) + 0.1502T ( x x2 )
gives
x

fe(x)

fg(x)

1/3 0.13786 0.1378


1/2 0.16146 0.144
2/3 0.1502

0.1502
1

The average error defined as g = ( f g ( x) f e ( x) )dx may be computed.


0

(d) The average residual g = 4 / 3 .

5/5

0.9

You might also like