Professional Documents
Culture Documents
MA8491 Numerical Methods 01 - by LearnEngineering - in
MA8491 Numerical Methods 01 - by LearnEngineering - in
in
1MA8491 Numerical Methods .
.in
Y axis [ = f(x) ]
–X
x = x1 x = x2 x = x3 x = 0 ing x = x4 x = x5
X axis
eer
gin
–Y
En
Here the curve f(x) with f(x = x2) = f(x = x3) = f(x = x4) = 0
x2, x3 and x4 are solutions of f(x).
and f(x) > 0 for x2 < x < x3 and x4 < x < x5
arn
g ' x2 1
ww
x , f x1 f x2 f x1 is nearer to zero.
X0 1
x2 , f x1 f x2 f x2 is nearer to zero.
X1 g X 0
X 2 g X1
⋮
X n g X n 1 Stop method if the consecutive values of
X n & X n 1 are equal upto required place of decimal.
X n 1 g X n i.e., X =X
n n 1
Iteration method is a indirect (or successive approximation) method.
Iteration method is a self correction method.
.in
f x 3 3 3 100 64 0 ' ' ve
3 2
ing
f x 5 5 5 100 50 0 ' ' ve
eer
i.e, f x has a positive root.
gin
x3 x 2 100 0
En
i.e., x 2 x 1 100
10
i.e., x g x , say
arn
x 1
1
10
g x 10 x 1 2
Le
x 1
d
Therefore, g x g x
dx
w.
1 1 3
d 1 1 5
10 x 1 2 10 x 1 2 5 x 1 2
ww
dx 2 3
x 1 2
5 5
g x 3
3
x 1 2 x 1 2
5 5 5 1 1
g x 4 0.57735 1
At x = 4, 4 1 3/ 2
5 3/ 2
5 5 5 2.23606
5 5
g x 5 0.34020 1
At x = 5, 5 1 3/ 2
6 3 / 2
g x 1 in (4,5).
So the fixed point iteration method can be applied.
Let x0 4 ∵ f x 4 f x 5
Use xn 1 g xn
Now, put n = 0 in xn 1 g xn , we get
10 10 10
x1 g x0 4.47214
x0 1 4 1 5 (round off at 5th decimal)
10
x2 g x1 4.27486
4.47214 1
.in
10
x3 g x2 4.35406
4.27486 1
ing
10
x4 g x3 4.32174
4.35406 1
eer
10
x5 g x4 4.33484
4.32174 1
10
x6 g x5
gin
4.32952
4.33484 1
10
x7 g x6 4.33168
En
4.32952 1
10
x8 g x7 4.33080
arn
4.33168 1
10
x9 g x8 4.33116
4.33080 1
Le
10
x10 g x9 4.33101
4.33116 1
w.
10
x11 g x10 4.33107
4.33101 1
ww
10
x12 g x11 4.33105 these values are same
4.33107 1
at fifth decimal, i.e., x12 x .
13
10
x13 g x12 4.33105 so stop the method
4.33105 1
3 2
The root of the given equation x x 100 0 is 4.33105
3 2
CW.2. Solve the equation x 2 x 10 x 20 by fixed point iteration
method. {Solution : x13 x14 1.36880 }
3
HW.3. Solve the equationx x 1 0 by fixed point iteration method.
{Solution : g x 1 x ; x23 x24 0.682 }
1/3
.in
f x has a root between 0 and 1.
ing
This equation f x 3 x cos x 2 0 can be written as
3 x cos x 2 0
eer
i.e.,3 x 2 cos x
2 cos x
g x , say
gin
i.e., x
3
2 cos x
g x
En
3
d
Therefore, g x g x
dx
arn
sin x sin x
g x
3 3
w.
sin 0
g x 0 0 1
ww
At x = 0, 3
sin 1
g x 1 0.2804 1
At x = 1, 3
g x 1 in (0,1).
So the fixed point iteration method can be applied.
Let x0 0 we hvae to take x0 1,∵ f x 1 f x 0
Use xn 1 g xn
Now, put n = 0 in xn 1 g xn , we get
x1 g x0 1
3 3 3
2 cos x1 2 cos 1
x2 g x1 0.84677
3 3
2 cos x2 2 cos 0.84677
x3 g x2 0.88747
3 3
2 cos x3 2 cos 0.84747
x4 g x3 0.87713
3 3
2 cos x4 2 cos 0.87713
x5 g x4 0.87979 x5 x6
3 3 rd
at 3 decimal,
.in
2 cos x5 2 cos 0.87979
x6 g x5 0.87910 so stop the method
3 3
ing
The root of the given equation 3 x cos x 2 0 is 0.879
Soln. : x 1.89549 }
x
Eg.7. Solve the equation e 3x 0 by iteration method upto 3 decimal.
En
Let f x e 3 x 0
x
Sol:
arn
f x 0 e0 3 0 1 0 ' ' ve
f x 1 e1 3 1 0.2817 0 ' ' ve
Le
3x e x
ex
i.e., x g x , say
3
d d ex ex
Therefore, g x g x
dx dx 3 3
ex ex
g x
3 3
.in
3 3 e x6 e0.59983
x7 0.60727
e x1 e0.33333 3 3
x2 0.46520
ing
3 3 e x7 e0.60727
x8 0.61180
e x2 e0.46520 3 3
x3 0.53078
e x8 e0.61180
eer
3 3
x9 0.61458
e x3 e0.53078 3 3
x4 0.56675
e x9 e0.61458
gin
3 3
x10 0.61629
e x4 e0.56675 3 3
x5 0.58751
3 3 e x10 e0.61629
x11 0.61735
En
e x5 e0.58751 3 3
x6 0.59983
3 3
arn
e x11 e0.61735
x12 g x11 0.61800 x12 x13
3 3 rd
at 3 decimal,
Le
x12 0.61800
e e
x13 g x12 0.61840 so stop the method
3 3
w.
x
The root of the given equation e 3x 0 is 0.618
Eg.8. Solve the equation 2 x log x 7 by iteration method upto 5 decimal.
ww
.in
1 1
g x
2x 2x
ing
1 1
g x 3 0.166 1
At x = 3, 2 3 6
eer
1 1
g x 4 0.125 1
At x = 4, 2 4 8
gin
g x 1 in (3,4).
So the fixed point iteration method can be applied.
Let x0 4
En
Use xn 1 g xn
Now, put n = 0 in xn 1 g xn , we get
arn
7 log x0 7 log 4
x1 g x0 3.80103
Le
2 2
7 log x1 7 log 3.80103
x2 g x1 3.78995
w.
2 2
7 log x2 7 log 3.78995
x3 g x2 3.78932
ww
2 2
7 log x3 7 log 3.78932 x4 x5
x4 g x3 3.78928
2 2 th
at 5 decimal,
7 log x4 7 log 3.78928
x5 g x4 3.78928 so stop the method
2 2
The root of the given equation 2 x log x 7 is 3.78928
HW.9. Solve the equation 3 x log10 x 6 by fixed point iteration method.
{ Solution. : x 2.1080 }
.in
3. Find an iterative formula to find N , where N is positive number.
ing
Sol: Let x N
2 2
x N x N 0
f ' x 2x
eer
Let f x x N
2
By Newton’s formula
f xn x 2 N 2 x 2n x 2n N x 2n N
gin
xn 1 xn xn n
f ' xn 2 xn 2 xn 2 xn
En
p
x N 0
Let f x x N f ' x px
p p 1
Le
By Newton’s formula
xp N px p x p N p 1 x np N
w.
n n n
xn 1 xn
px p 1 px p 1
px p 1
ww
1
N
xn 1
xn 1 xn xn N xn2 xn 2 Nxn
1 xn
2
xn
3
6. Locate the negative root of x 2 x 5 0 , approximately.
Let f x x 2 x 5 0
3
Sol:
f 1 1 2 5 6 ve
f 2 8 4 5 1 ve
f 3 27 6 5 16 ve
Root lies between –2 and –3.
.in
and root is closer to –2 since f 2 f 3
7. Evaluate 12 applying Newton formula.
Sol: Let x 12
2 2
x 12 x 12 0 ing
eer
f ' x 2x
Let f x x 12
2
f 3 9 12 3 ve
gin
f 4 16 12 4 ve
Root lies between 3 and 4.
and root is closer to 3 since f 3 f 4
En
Take x0 3
arn
f xn
xn 1 xn
Newton’s formula is f ' xn
Le
f x0 f 3 32 12
x1 x0 3 3 3.5
f ' x0 f ' 3 2 3
w.
f x1 f 3.5 3.52 12
x2 x1 3.5 3.5 3.4642
f ' x1 f ' 3.5 2 3.5
ww
The root is 3.4642
Part B:
Eg.10. Using Newton–Raphson method, find a ‘+’ve root correct to 3
3
decimal places for the equation x x 2 0 .
Sol: Newton–Raphson method formula is
f xn
xn 1 xn , where n 0,1, 2,...
f ' xn
f x 3 x 2 1
f x 0 03 0 2 2 0 ' 've
f x 1 1 1 2 2 0
3
' 've
f x 2 23 2 2 4 0 ' ' ve
A root lies between 1 and 2.
Take x0 1
f xn
xn 1 xn ,
Now, put n = 0 in f ' xn we get
.in
f x0 x0 x0 2
3 13 1 2
x1 x0 x0 1 2
ing
f ' x0 3 x 2 1 3 12 1
0
f x1 3
x1 1
x x1 2 2
3 2 2 2
1.63636
eer
x2 x1
f ' x1 3 x 2 1 3 2 2 1
1
f x2 x2 x2 2
3
1.6363631.636362
gin
x3 x2 x2 1.63636 1.53039
f ' x2 3 x 2 1 3 1.63636 2 1
2
f x3 x3 x32
3
1.5303931.530392
En
f x4 x4 x4 2
3
1.5214431.52144 2
x5 x4 x4 1.52144 1.52138
f ' x4 3 x 2 1 3 1.52144 2 1
4
Le
f x5 x5 x5 2
3 3
1.52138 1.52138 2
x6 x5 x5 1.52138 1.52138
f ' x5 3 x 2 1 3 1.52138 2 1
w.
5
A root of given equation is 1.521
ww
x3 5 x 3 0 by Newton–Raphson method.
CW.11. Solve the equation
{Solution. : x3 x4 0.65662 }
4
x x 9 0 by Newton–Raphson method.
HW.12. Solve the equation
{Solution. : x6 x7 1.813 upto 3rd decimal}
Eg.13. Using Newton–Raphson method, find a ‘+’ve root correct to 5
decimal places for the equation x tan x 1.28
Sol: Newton–Raphson method formula is
f xn
xn 1 xn , where n 0,1, 2,...
f ' xn
.in
f xn
xn 1 xn ,
Now, put n = 0 in f ' xn we get
ing
f x0 x0 tan x0 1.28 0.5 tan 0.51.28
x1 x0 x0 0.5 1.34218
f ' x0 2
x0 sec x0 tan x0 0.5 sec2 0.5tan 0.5
eer
f x1 1.34218 tan 1.342181.28
x2 x1 1.34218 1.19469
f ' x1 1.34218 sec2 1.34218tan 1.34218
f x2 1.19469 tan 1.19469 1.28
gin
x3 x2 1.19469 1.04143
f ' x2 1.19469 sec2 1.19469 tan 1.19469
f x3 1.04143 tan 1.041431.28
x4 x3 1.04143 0.95512
f ' x3
En
0.95512
f x5 0.93871 tan 0.938711.28
x6 x5 0.93871 0.93826
f ' x5 0.93871 sec2 0.93871tan 0.93871
f x6
Le
{Solution. : x4 x5 2.79839 }
2 x
xe
HW.15. Solve the equation 0.5sin x by Newton–Raphson method.
{Solution. : x2 x3 3.12962 upto 5th decimal}
Eg.16. Using Newton–Raphson method, find a root correct to 5 decimal
x
places for the equation e 4 x 0
f xn
xn 1 xn
Sol: Newton–Raphson method formula is f ' xn
Let f x e 4 x f x e 4
x x
.in
f ' x0 e 0 4 e0 4
f x1 e x1 4 x e0.33333 4 0.33333
x2 x1 x1 x 1 0.33333 0.35725
ing
f ' x1 e 1 4 e0.33333 4
f x2 e x2 4 x2 e0.35725 4 0.35725
x3 x2 x2 x 0.35725 0.35740
f ' x2 e0.35725 4
eer
e 2 4
f x3 e x3 4 x e0.35740 4 0.35740
x4 x3 x3 x 3 0.35740 0.35740
f ' x3 e 3 4 e0.35740 4
gin
x
CW.17. Solve the equation cos x xe , by x0 0.5 by Newton–Raphson
method. {Solution. : x2 x3 0.51776 }
arn
1
Eg.19. Find the Newton–Raphson formula to find the value of N where
1
w.
1
x
Sol: Let N
1 1
N N 0
x x
1 1
f x N f ' x 2
Let x x
By Newton’s formula ,
1
N
xn 1
xn 1 xn xn N xn2 xn 2 Nxn
1 xn
2
xn
1
This is the Newton’s–Raphson formula to find the value of N .
1
To find :
26
Put N = 26 and n = 0 in xn 1 xn 2 Nxn , we get
x1 x0 2 26 x0 (1)
.in
1 1 1
Take 0.04 as x0 ∵ is nearer to
25 25 26
ing
1 x1 x0 2 26 x0 0.04 2 26 0.04 0.0384
x2 x1 2 26 x1 0.0384 2 26 0.0384 0.03846
eer
x3 x2 2 26 x2 0.03846 2 26 0.03846 0.03846
A root of given equation is 0.03846 or 0.0385
gin
places.
1
p
HW.21. Find the Newton–Raphson formula to find the value of N where
arn
1
and hence find the value of23 , correct to five decimal places.
ww
.in
Step3: By back substitution we get the values for unknowns.
Topic 5 : Solution of linear system by Gaussian Jordan method
Gauss Jordan method:
ing
Step1: Write the augmented matrix for the given system of
simultaneous equations
a11 a12 a13 b1
eer
a21 a22 a23 b2
a
31 a32 b33 b3
gin
0 Here 0 c22 0 is a or
0 c d 3
33
0 0 c33 unit matrix
arn
Sol:
9. Gauss elimination method Gauss Jordan method
Coefficient matrix is transmitted Coefficient matrix is transmitted
ww
Part B:
Eg.22.Solve the system of equations by (i) Gauss elimination method (ii)
Gauss Jordan method
3 x1 2 x2 3 x3 6
x1 x2 x3 1
2 x1 5 x2 4 x3 5
Sol: The given system of equations can be written as
x1 x2 x3 1
3 x1 2 x2 3 x3 6
2 x1 5 x2 4 x3 5
Given system of the form AX = B
(i) Gauss elimination method:
.in
The augmented matrix form is
1 1 1 1
ing
A | B 3 2 3 6
2 5 4 5
eer
1 1 1 1
R R2 3R1
∼ 3 3 2 3 3 3 6 3 2
R R3 2 R1
gin
2 2 5 2 4 2 5 2 3
1 1 1 1
∼ 0 1 0 3
En
0 3 2 3
arn
1 1 1 1
∼ 0 1 0 3 R3 R3 3R2
0 3 3 2 0 3 9
Le
1 1 1 1
∼ 0 1 0 3
w.
0 0 2 12
ww
.in
∼ 0 1 0 3 R2 R2 1
ing
0 3 2 3
1 0 1 1 1 0 1 3
R R1 R2
∼ 0 3 1
eer
1 0
R R3 3R2
0 3 3(1) 2 3(0) 3 3(3) 3
1 0 1 4
gin
∼ 0 1 0 3
0 0 2 12
En
1 0 1 4
R
∼ 0 1 0 3 R3 3
arn
2
0 0 1 6
1 0 0 2
Le
∼ 0 1 0 3 R1 R1 R3
0 0 1 6
w.
x1 2, x2 3, x3 6 x1 , x2 , x3 2,3,6
ww
CW23. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method
28 x 4 y z 32 x, y, z 0.99359,1.50697,1.84855
x 3 y 10 z 24
2 x 17 y 4 z 35 {Sol: }
HW24. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method
pqrs2 p, q, r , s 1, 0, 1, 2
p q 3r 2 s 6
2 p 3q r 2 s 7
p 2q r s 2 { Sol: }
.in
(Nov./Dec., 2007(EEE)) Ans: x = 2, y = 2, z = 2
ing
Topic 6 : Gauss-Seidel method(Iterative method):
Step1: Let the system of equations be
a11 x a12 y a13 z b1
eer
a21 x a22 y a23 z b2
a31 x a32 y a33 z b3 with diagonally dominant
Step2: The above system should write into the form
gin
1
x b1 a12 y a13 z ...(1)
a11
1
b2 a21 x a23 z ...(2)
En
y
a22
1
z b3 a31 x a32 y ...(3)
arn
a33
0 0
Step3: Start with the initial values y 0, z 0 for y, z and get
Le
x
1
1
b1 a12 y a13 z
0 0
w.
(2) becomes
y
1 1
a22
1
b2 a21 x a23 z
0
1 1
Step5: Substitute x , y for x, y in the third equation.
(3) becomes
z
1 1
a33
1
b3 a31 x a32 y
1
y r 1
1
a22
b2 a21 x a23 z
r 1 r
z r 1
1
a33
b3 a31 x a32 y
r 1
r 1
.in
Part A:
10. Write the first iteration values of x, y, z when the equations
27 x y z 8, x 1 y 2 z 72, x y z 110 are solved by
ing
Gauss–Seidel method.
Sol:
eer
1 85
x 85 6 y z
27 27 = 3.14815 [putting y = z = 0]
1 1
y 72 6 x 2 z 72 6 3.14815 2 0 3.54074
gin
15 15
[putting x= 3.14815 , z = 0]
En
1 1
z 110 x y 110 3.14815 3.54074 20.66222
5 5
[putting x = 3.14815 , y = 3.54074 ]
arn
Part B:
Eg.25. Solve by Gauss-Seidel iterative method
Le
x y 54 z 110
27 x 6 y z 85
6 x 15 y 2 z 72
w.
6 x 15 y 2 z 72 (2)
x y 54 z 110 (3)
1
(1) x 85 6 y z (4)
27
1
(2) y 72 6 x 2 z (5)
15
1
(3) z 110 x y (6)
54
Iteration 1:
Put y z 0 in (4)
1
(4) x 85 6 0 0 3.14815
27
1
(5) y 72 6 3.14815 2 0 3.54074
15
1
(6) z 110 3.14815 3.54074 1.91317
54
Iteration 2: [Substitute the latest values of x, y, z in (4), (5), (6)]
1
x 85 6 3.54074 1.91317 2.43218
27
1
y 72 6 2.43218 2 1.91317 3.57204
.in
15
1
z 110 2.43218 3.57204 1.92585
54
ing
1
Iteration 3: x 85 6 3.57204 1.92585 2.42569
27
1
eer
y 72 6 2.42569 2 1.92585 3.57294
15
1
z 110 2.42569 3.57294 1.92595
gin
54
1
Iteration 4: x 85 6 3.57294 1.92595 2.42549
27
En
1
y 72 6 2.42549 2 1.92595 3.57301
15
1
z 110 2.42549 3.57301 1.92595
arn
54
1
Iteration 5: x 85 6 3.57301 1.92595 2.42548
27
Le
1
y 72 6 2.42548 2 1.92595 3.57301
15
w.
1
z 110 2.42548 3.57301 1.92595
54
ww
Solution is x, y, z 2.42548, 3.57301, 1.92595
Note : Iterations of the above given problem are given as follows:
Iteration x y z
1 3.14815 3.54074 1.91317
2 2.43218 3.57204 1.92585
3 2.42569 3.57294 1.92595
4 2.42549 3.57301 1.92595
5 2.42548 3.57301 1.92595
CW.26. Solve by Gauss-Seidel iterative method
.in
(May./June, 2007(EEE))
AU11.By using Gauss-Seidel iteration method, solve the following
ing
system of equations upto four decimals.
10x − 2y − z − w = 3; −2x + 10y − z − w = 15;
−x − y + 10z − 2w = 27; − x − y − 2z + 10w = −9.
eer
(Nov./Dec, 2009(IT))Ans: x = 3.017, y = 1.986, z = 0.91
Given Matrix An n ,
Row
An n | I n n ~ I n n | A1n n
En
Form Operations
Part A:
arn
1 3
11. Find the inverse of a matrix 2 7 by Gauss–Jordan method.
1 3:1 0
Le
0 1: 2 1
∼ 1 0: 7 3 R1 R1 3R2
0 1: 2 1
ww
A1 7 3
2 1
Part B:
Eg.28.Using Gauss–Jordan method, find the inverse of the matrix
1 0 1
3 4 5
0 6 7
1 0 1
A 3 4 5
Sol: Let 0 6 7
1 0 1 1 0 0
Consider A | I 3 4 5 0 1 0 Apply R2 R2 3R1
0 6 7 0 0 1
1 0 1 1 0 0
∼ 3 3 1 4 3 0 5 3 1 0 3 1 1 3 0 0 3 0
0 6 7 0 0 1
1 0 1 1 0 0
.in
R
∼ 0 4 8 3 1 0 R2 2
4
0 6 7 0 0 1
1 0 1 1 0 0
∼ 0 1 2 3 / 4 1 / 4 0 R3 R3 6 R2 ing
eer
0 6 7 0 0 1
1 0 1 1 0 0
gin
∼ 0 1 2 3 / 4 1/ 4 0
0 6 6 1 7 6 2 0 6 3 / 4 0 6 1 / 4 1 6 0
En
1 0 1 1 0 0
R
∼ 0 1 2 3 / 4 1 / 4 0 R3 3
5
arn
0 0 5 9 / 2 3 / 2 1
1 0 1 1 0 0
R1 R1 R3
∼ 0 1 2 3 / 4 1 / 4 0
Le
R R2 2 R3
0 0 1 9 / 10 3 / 10 1 / 5 2
w.
0 0 1 9 / 10 3 / 10 1 / 5
1 0 0 1 / 10 3 / 10 1 / 5
∼ 0 1 0 21 / 20 7 / 20 2 / 5 I | A1
0 0 1 9 / 10 3 / 10 1 / 5
1 3 1
1
A1 21/ 2 7 / 2 4
10
9 3 2
.in
4 1 0
AU12.Find the inverse of the matrix 2 1 3 by using Gauss–Jordan
ing
1/ 5 1/ 3 1/ 15
A1 4 / 5 1/ 3 4 / 15
method. (M/J,'07(EEE)) Ans: 2 / 5 1/ 3 7 / 15
eer
AU13.Find the inverse of the matrix by Gauss-Jordan method:
4 1 2 4 / 3 2 7/3
gin
A 2 3 1 A1 5 / 3 2 8 / 3
1 2 2 (M/,'07) Ans: 7 / 3 3 10 / 3
En
1
X1 0
Let 0 be an arbitrary initial eigen vector of the matrix A.
Le
value3 / value2
value3 value2
⋮
AX n n X n 1 If n =n 1 and X n 1 X n 2 are same
AX n 1 n 1 X n 2 upto required decimals, then stop iteration.
.in
BYn n Yn 1 If n =n 1 and Yn 1 Yn 2 are same
BYn 1 n 1 Yn 2 upto required decimals, then stop iteration.
ing
Smallest eigen value of B
The smallest eigen value of A = Dominant eigen value of A
eer
To find third eigen value of A:
1 2 3 Sum of the main diagonal elements
gin
Part A:
12. What type of eigen value can by obtained by using power method.
Sol: We can obtain dominant eigen value of the given matrix
En
A 4 1
14. Find the dominant eigen value of 1 3 by power method
1
Le
upto two decimals and choose 1 as the initial eigen vector.
X1 1
w.
5X 2
1 3 1 4 0.8
AX 2 4 1 1 4.8 4.8 1 4.8 X 3
1 3 0.8 3.4 0.71
AX 3 4 1 1 4.71 4.71 1 4.71X 4
1 3 0.71 3.13 0.67
AX 4 4 1 1 4.67 4.67 1 4.67 X 5
1 3 0.67 3.01 0.65
.in
1 2 by power method.
1
X1
ing
Sol: Let 0 be an arbitrary initial eigen vector.
4 5 1 4 1 5 0 4 1
eer
AX1 4 4 X 2 , say
1 2 0 1 1 2 0 1 0.25
4 5 1 41 5 0.25 2.75 2.75 1 2.75 X
gin
AX 2
1 2 0.25 1 1 2 0.25 0.5 0.18182 3
4 5 1 3.0909 1
En
AX 3 3.0909 3.0909 X 4
1 2 0.18182 0.63636 0.20588
4 5 1 2.9706 1
arn
AX 4 2.9706 2.9706 X 5
1 2 0.20588 0.58824 0.06666
4 5 1 3.6667 1
Le
AX 6 2.81815 2.81815 X 7
1 2 0.23637 0.52726 0.18709
4 5 1 3.06455 1
ww
AX 7 3.06455 3.06455 X 8
1 2 0.18709 0.62582 0.19579
4 5 1 3.02105 1
AX 8 3.022105 3.022105 X 9
1 2 0.19579 0.60842 0.20133
Dominant Eigen value = = –3 and the corresponding
1 1
Eigen vector = X = 0.19529 0.2
CW.32. Find by power method, the largest eigen value and the
1 3 1
3 2 4
corresponding eigen vector of the matrix 1 4 10 .
0.02404
0.42582
Sol: Dom. Eigen value = = 11.72 and Eigen vector = X = 1
1 6 1
1 2 0
Eg.33. Find all the eigen values of the matrix 0 0 3 by power method.
Sol: Dominant Eigen value = = 4
Smallest Eigen value = X = –1
.in
Other Eigen value = 3
AU14. Obtain by power method the numerically largest eigen value of the
15 4 3
ing
10 12 6
matrix 20 4 21 (N/D., 2007) Ans: = −19.977 −20
eer
1 2 3
0 4 2
AU15. Find the all eigen values of the matrix by power method 0 0 7
gin
1 2 0
of the matrix 0 0 3 (May./June, 07)Ans: = −1, 3, 4
arn
AU17. Find, by power method, the largest eigen value and the eigen vector
25 1 2
1 3 0
of the matrix 2 0 4 (May./June, 2007(EEE))
Le
AU18. Solve by power method, to find the dominant Eigen value for the
1 1 3
1 5 1
ww
.in
1 2aij
tan 1 , if aii a jj
ing
2 aii a jj
, if a 0
4 ij
eer
, if aii a jj
4 , if aij 0
Use
gin
Here 4 4
T
and form transformation as B1 S1 A S1
En
If B1
a diagonal matrix, then S1 is its corresponding vector.
not a diagonal matrix, then form seond rotation matrix S2 .
arn
T
and form transformation as B2 S 2 A S2
If B2
not a diagonal matrix, then form seond rotation matrix S3 .
…
w.
S1 cos sin
The rotation matrix sin cos
a11 a22
Since , we have 4
cos 4 sin 4 1/ 2 1/ 2
S1
1/ 2 1/ 2
sin cos
4 4
Then the transformation gives
B1 S1 A S1 1/ 2 1/ 2 1 2 1/ 2 1/ 2 3 0
T
1/ 2 1/ 2
2 1
1 / 2 1/ 2 0 1
.in
This is a diagonal matrix. So, the eigen values are 3, –1 and the
corresponding eigen vectors are the columns of S1 i.e.,
ing
1/ 2 1/ 2
1/ 2 , 1/ 2
.
eer
1 5 2
5 4 7
gin
Sol: Let A = 2 7 4
The numerically largest off–diagonal element a23 a32 7
arn
1 0 0
S1 0 cos sin
The rotation matrix 0 sin cos
Le
w.
Part B:
Eg.34.Find all the eigen values and eigen vectors of the matrix
ww
1 2 2
A 2 3 2
2 2 1
by Jacobi method.
Sol: Given matrix is symmetric matrix.
Numerically largest element in off diagonal element is 2 in a13 &
in a31 so multiply with sin & sin and other elements
a11 & a33 are both multiplied by cos remaining diagonal a22
with ‘1’ and a12 , a21 , a23 , a32 with ‘0’.
.in
3 2 0
2 3 0
ing
0 0 1
cos sin 0
Here S2 sin cos 0
0 1
eer
0
1 2a12 1 1 2 2 1 1
Now tan 1 tan
1
tan
2 a a
11 22 2 3 3 2 2 2 4
gin
1/ 2 1/ 2 0
S2 1/ 2 1/ 2 0
0 1
En
0
1/ 2 1/ 2 0 3 2 0 1/ 2 1/ 2 0
arn
X1 X2 X3
1/ 2 0 1/ 2 1/ 2 1/ 2 0 1/ 2 1/ 2 1/ 2
S1S2 0 1 0 1/ 2 1/ 2 0 1/ 2 1/ 2 0
1/ 2 0 1/ 2 0 0 1 1/ 2 1/ 2 1/ 2
1/ 2 1/ 2 1/ 2
Eigen vectors are X1 1 / 2 , X 2 1/ 2 , X 3 0
1/ 2 1/ 2 1/ 2
for corresponding eigen values 5,1, 1.
CW.35. Find all the eigen values and eigen vectors of the matrix
1/ 2 1 2
A 1 3/ 2 1
2 1 1/ 2
by Jacobi method.
Sol: Eigen values = 5 / 2, 1/ 2, 1/ 2 and
1 / 2 1 / 2 1 / 2
1 / 2 , 1 / 2 , 0
1 / 2 1 / 2 1 / 2
Eigen vectors =
HW.36. Find all the eigen values and eigen vectors of the matrix
2 1 1
A 1 2 1
.in
1 1 2 by Jacobi method.
Sol: Eigen
Corresponding eigen vectors
ing
Values
1,4,1 1/ 6 1 1/ 3 1 1 1/ 2 1
2 / 6 or 2 , 1/ 3 or 1 ∼ 1 , 0 or 0
eer
1/ 6 1 1/ 3 1 1 1/ 2 1
gin
En
arn
Le
w.
ww
.in
Ans: 0.607102
5. Solve the system of equation by (i) Gauss elimination method (ii)
Gauss Jordan method
ing
3 x1 2 x2 3 x3 6
x1 x2 x3 1
2 x1 5 x2 4 x3 5
eer
Sol: x1 , x2 , x3 2,3,6
6. Solve the given system of equations by (i) Gauss elimination
gin
4 1 0
9. Find the inverse of the matrix 2 1 3 by using Gauss–Jordan
w.
12. Find the all eigen values of the matrix by power method
1 2 3
0 4 2
0 0 7 Ans: = −4, 1, 7
13. Find the dominant Eigen value and the corresponding Eigen vector
1 6 1
1 2 0
of the matrix 0 0 3 Ans: = −1, 3, 4
14. Find all the eigen values and eigen vectors of the matrix
1 2 2
A 2 3 2
.in
2 2 1
by Jacobi method.
Sol: Eigen values = 5, 1, –1 and
ing
1 / 2 1 / 2 1 / 2
1 / 2 , 1 / 2 , 0
1 / 2 1 / 2 1 / 2
Eigen vectors =
eer
15. Find all the eigen values and eigen vectors of the matrix
1/ 2 1 2
gin
A 1 3/ 2 1
2 1 1/ 2
by Jacobi method.
En
1 / 2 1 / 2 1 / 2
Eigen vectors =
16. Find all the eigen values and eigen vectors of the matrix
Le
2 1 1
A 1 2 1
1 1 2 by Jacobi method.
w.
.in
y1 …
( x1 x0 )( x1 x2 )… ( x1 xn )
( x x0 )( x x1 )… ( x xn 1 )
ing
yn
( x2 x0 )( x2 x1 )… ( x xn 1 )
Inverse Lagrange’s interpolation formula(y given, finding x in
eer
terms of y)
( y y1 )( y y2 )… ( y yn )
x x( y ) f ( y ) x0
( y0 y1 )( y0 y2 )… ( y0 yn )
gin
( y y0 )( y y2 )… ( y yn )
x1 …
( y1 y0 )( y1 y2 )… ( y1 yn )
En
( y y0 )( y y1 )… ( y yn 1 )
xn
( y2 y0 )( y2 y1 )… ( y yn 1 )
arn
Note:
Lagrange’s interpolation formula can be used for
equal and unequal intervals.
Le
Part A:
1. What is the assumptions we make when Lagrange’s formula is
used?
w.
.in
( x0 , y0 ),( x1 , y1 ) and ( x2 , y2 ) are given.
( x x1 )( x x2 ) ( x x0 )( x x2 ) ( x x0 )( x x1 )
ing
y y0 y1 y2
Sol: ( x0 x1 )( x0 x2 ) ( x1 x0 )( x1 x2 ) ( x2 x0 )( x2 x1 )
6. Find the second degree polynomial fitting the following data:
eer
x 1 2 4
Sol: y 4 5 13 Here x0 =
1, x1 = 2, x2 =4
gin
y0 = 4, y2 = 5, y3 = 13
By Lagrange’s formula for three points is
( x x1 )( x x2 ) ( x x0 )( x x2 ) ( x x0 )( x x1 )
y y0 y1 y2
En
( x0 x1 )( x0 x2 ) ( x1 x0 )( x1 x2 ) ( x2 x0 )( x2 x1 )
( x 2)( x 4) ( x 1)( x 4) ( x 1)( x 2)
y (4) (5) (13)
arn
3 2 6
1
8 x 2 48 x 64 15 x 2 75 x 60 13 x 2 39 x 26
6
ww
1 2
6 x 12 x 30
6
y f ( x) x 2 2 x 5
Part B:
Eg.1. Using Lagrange interpolation formula, find f(4) given that
f (0) 2, f (1) 3, f (2) 12, f (15) 3578.
Sol:
Given x x0 0 x1 1 x2 2 x3 15
y0 2
y = f(x) y1 3 y2 12 y3 3587
Lagrange interpolation formula is
( x x1 )( x x2 )( x x3 ) ( x x0 )( x x2 )( x x3 )
y y0 y1
( x0 x1 )( x0 x2 )( x0 x3 ) ( x1 x0 )( x1 x2 )( x1 x3 )
( x x0 )( x x1 )( x x3 ) ( x x0 )( x x1 )( x x2 )
y2 y3
( x2 x0 )( x2 x1 )( x2 x3 ) ( x3 x0 )( x3 x1 )( x3 x2 )
(4 1)(4 2)(4 15) (4 0)(4 2)(4 15)
f 4 2 3
(0 1)(0 2)(0 15) (1 0)(1 2)(1 15)
(4 0)(4 1)(4 15) (4 0)(4 1)(4 2)
12 3587
(2 0)(2 1)(2 15) (15 0)(15 1)(15 2)
(3)(2)( 11) (4)(2)( 11)
2 3
( 1)( 2)( 15) (1)(1)( 14)
(4)(3)( 11) (4)(3)( 2)
12 3587
(2 )(1)( 13) (15)(14)(13)
.in
77.99 78
CW.2. Find polynomial f(x) by using Lagrange formula from the given
ing
data and find f(8).
x 3 7 9 10
f(x) 168 120 72 63
eer
Sol: Lagrange polynomial f(x) = x3 – 21 x2 + 119 x – 27.
y(x = 8) or y(x = 8) or f(x = 8) = 93
HW.3. Use Lagrange’s formula to fit a polynomial to the data
gin
x –1 0 2 3
y = f(x) – 8 3 1 12
and hence find y(1).
En
x0 5 x1 3 x2 3 x3 5
y0 y5 y1 y3 y2 y3 y3 y5
w.
( x x1 )( x x2 )( x x3 ) ( x x0 )( x x2 )( x x3 )
y yx f x y0 y1
( x0 x1 )( x0 x2 )( x0 x3 ) ( x1 x0 )( x1 x2 )( x1 x3 )
( x x0 )( x x1 )( x x3 ) ( x x0 )( x x1 )( x x2 )
y2 y3
( x2 x0 )( x2 x1 )( x2 x3 ) ( x3 x0 )( x3 x1 )( x3 x2 )
( x 3)( x 3)( x 5) ( x 5)( x 3)( x 5)
y5 y3
(5 3)(5 3)(5 5) (3 5)(3 3)(3 5)
( x 5)( x 3)( x 5) ( x 5)( x 3)( x 3)
y3 y5
(3 5)(3 3)(3 5) (5 5)(5 3)(5 3)
Put x 1, we get
(1 3)(1 3)(1 5) (1 5)(1 3)(1 5)
y1 y5 y3
(5 3)(5 3)(5 5) (3 5)(3 3)(3 5)
(1 5)(1 3)(1 5) (1 5)(1 3)(1 3)
y3 y5
(3 5)(3 3)(3 5) (5 5)(5 3)(5 3)
0.2 y5 0.5 y3 y3 0.3 y5
0.2 y5 0.2 y3 0.3 y3 y3 0.3 y5
y1 y3 0.3( y5 y3 ) 0.2( y3 y5 )
CW.5. Find the age corresponding to the annuity value 13.6 from the
given table
Age (x) 30 35 40 45 50
Annuity value (y) 15.9 14.9 14.1 13.3 12.5
.in
Sol: x13.6 or (y = 13.6) = 43
HW.6. Find x for which y = 7, given
ing
x 1 3 4
y 4 12 19
Sol: x(y = 7) = 1.8572
eer
Anna University Questions:
AU1. Use Lagrange formula to calculate f(3) from the following table.
x 0 1 2 4 5 6
gin
f(x) 1 14 15 5 6 19
(Anna Univ. Nov./Dec., 2007(EEE)) Ans: f(3) = 10
AU2. Find the Lagrange’s polynomial of degree 3 to fit the data :
En
y(0) = −12, y(1) = 0, y(3) = 6 and y(4) = 12. Hence find y(2).
(M/J, 2007) Ans: f(x) = x3 − 7x2 + 18x − 12; y(2) = 4
arn
AU3. From the given table, the values of y are consecutive terms of a
series of which 23.6 is the 6th term. Find the first and tenth terms of
the series.
Le
x 3 4 5 6 4 5 6
y 4.8 8.4 14.5 23.6 36.2 52.8 73.9
w.
1
(N/D, 2007) Ans: y(x) = 12 [x3 + 3x2 − 14.8x + 48];
ww
.in
x2 x0 x2 x1
ing
f ( x2 ) f ( x1 )
x3 x2
f ( x1 , x2 , x3 ) 2 f ( x1 ) [ x1 , x2 , x3 ]
x3 x1
eer
x3 x2
x3 x2 x2 x1
f ( x0 , x1 , x2 , x3 ) 3 f ( x0 ) [ x0 , x1 , x2 , x3 ]
x3 x0 x3 x2 x1
En
x4 x1 x4 x3 x2
Properties of divided differences:
Le
2 f ( x) 2 f ( y ) 2 f ( z )
yz xz xy
ww
.in
1 1
f ( x) , f (a)
Sol: If x a
ing
1 1
1 f (b) f (a ) b a 1
f (a, b)
b a ba ba ab
eer
1 1 1 1
f (b, c) , f (c, d )
Similarly, c b bc d c cd
gin
1 1 1 1
21 c b b b bc ab a c 1
f (a, b, c)
bc a ca ca abc(c a ) abc
En
1 1
f (b, c, d ) 2
Similarly, cd b bcd
arn
1 1 1 1
2 2
1
f (a, b, c, d ) 3 cd b bc a bcd abc
bcd a d a d a
Le
ad 1
abc(d a ) abcd
w.
Part B:
Eg.7. Construct the divided difference table for the following data and find
ww
9752
5 102 15
74
296102 14.215
97 0.133
75 10 4
.in
16897 .617.133
7 296 14.2 .069
10 5 11 4
ing
800296 10.514.2 .158.069
168 .617 .011
10 7 11 5 12 5
210168 1.7.617
eer
10 800 10.5 .158
11 7 12 5
1010800 210.5
210 1.7
gin
11 10 12 7
214210
11 1010 2
12 10
En
12241010
214
12 11
arn
12 1224
f x 50 x 4 52 x 4 x 5 15 x 4 x 5 x 7 0.133
x 4 x 5 x 7 x 10 0.069
Le
x 4 x 5 x 7 x 10 x 11 0.011
f x 2 50 2 4 52 2 4 2 5 15 2 4 2 5 2 7 0.133
2 4 2 5 2 7 2 10 0.069
w.
2 4 2 5 2 7 2 10 x 11 0.011
49.19
ww
CW.8. If f(0) = 0, f(1) = 0, f(2) = –12, f(4) = 0, f(5) = 600, f(7) = 7308,
find a polynomial that satisfies this data using Newton’s devided difference
formula. Hence find f(6), f(–1).
3 2
Sol: f(x) = x( x 1)[ x 2 x 13x 20]
f(6) = 2580 , f(–1) = 60
HW.9. Find the third divided difference with arguments 2,4,9,10 of the
function f(x) = x3 – 2x.
Sol: Form divided difference table.
AU6. If f(0) = f(1) = 0, f(2) = −12, f(4) = 0, f(5) = 600 and f(7) = 7308, find
a polynomial that satisfies this data using Newton’s divided
difference interpolation formula. Hence, find f(6)
(Anna Univ. May./June, 2007) Ans: f(6) = 2580
AU7. Given the values
x 5 7 11 13 17
f(x) 150 392 1452 2366 5202
Evaluate f(9) using Newton’s divided difference formula.
(N/D, 2007) Ans: f(x) = x3 − x2 + 24x − 70; f(9) = 794
.in
AU8. Using Newton’s divided difference interpolation, find the
polynomial of the given data
ing
x –1 0 1 3
f(x) 2 1 0 –1
1
eer
(Anna Univ. Nov./Dec., 2007) Ans: f(x) = 24 [x3 − 25x + 24]
gin
En
arn
Le
w.
ww
.in
M 0 M n 0 [or y '' y '' 0] M , M ,..., M n 1
0 n , and find 1 2
ing
in 1st interval,2nd interval,…, (n–1)th interval value.
Part A:
9. What is a cubic spline?
eer
Sol: A cubic spline which has continuous slope and curvature
is called a cubic spline.
10. What is a natural cubic spline?
gin
Sol: A cubic spline fitted to the given data such that the end
cubics approach linearity at their extremities is called a
natural cubic spline.
En
Part B:
Eg.10. Find the cubic spline approximation for the function f(x) given by
the data:
x 0 1 2 3
y = f(x) 1 2 33 244
with M 0 0 M 3. Hence estimate the value f(1.5),f(2.5).
{AU2010}
Sol: We know that cubic spline interpolation formula for
xi 1 x xi , i 1, 2,3. is
Si x y x y
1
xi x 3 M i1 x xi1 3 M i
.in
6h
1 h2
xi x yi 1 M i 1
ing
h 6
1 h2
x xi 1 yi Mi (1)
h 6
eer
6
where Mi 1 +4Mi Mi 1 = 2 yi 1 2 yi yi 1 (2)
h
gin
h number of data 4
i number of intervals 3 i.e., i 1, 2,3.
h length of inteval 1
En
Given M 0 M 2 0, so find M1 , M 2 .
Suppose M i or yi" values are not given, then assume M 0 M 3 0
arn
and find M1 , M 2 .
To find M1 , M 2 :
Le
6
When i 1, (2) M 0 4 M1 M 2 y0 2 y1 y2
12
0 4 M1 M 2 6 1 2 2 33
w.
4 M1 M 2 180 (3)
6
When i 2, (2) M1 4 M 2 M 3 2 y1 2 y2 y3
ww
1
M1 4 M 2 0 6 2 2 2 244
4 M1 M 2 180 (4)
Solving 3 & 4 , 3 4 M1 M 2 180
4 4 4 M1 16 M 2 4320
15M 2 4140
M 2 276
3 4 M1 180 276 M1 24
.in
4 x3 1 x 6 x
4 x3 5 x 1
ing
When i 2,
Cubic spline in xi 1 x xi
i.e., x1 x x2
eer
i.e., 1 x 2
i.e., Cubic spline in 1 x 2 is
1
y2 x S 2 x x2 x 3 M1 x x1 3 M 2
gin
61
1 1 1 1
x2 x y1 M1 x x1 y2 M 2
1 6 1 6
En
1
2 x 24 x 1 276
3 3
6
1 1
2 x 2 24 x 1 33 276
arn
6 6
3 3
4 2 x 46 x 1 6 2 x 13 x 1
50 x3 162 x 2 162 x 53
Le
When i 3,
Cubic spline in xi 1 x xi
w.
i.e., x2 x x3
i.e., 2 x 3
i.e., Cubic spline in 2 x 3 is
ww
1
y3 x S3 x x3 x 3 M 2 x x2 3 M 3
6 1
1 1 1 1
x3 x y2 M 2 x x2 y3 M 3
1 6 1 6
1 3
3 x 276 0
6
1
3 x 33 276 x 2 244 0
6
46 27 x3 9 x 2 27 x 13 3 x 244 x 488
46 x3 414 x 2 985 x 715
Cubic spline is
S1 ( x) y1 ( x) 4 x3 5 x 1, 0 x 1
S ( x) S2 ( x) y2 ( x) 50 x3 162 x 2 167 x 53, 1 x 2
S3 ( x) y3 ( x) 46 x3 414 x 2 985 x 715, 2 x 3
When x 1.5,
3 2
y2 ( x 1.5) S2 ( x 1.5) 50 1.5 162 1.5 167 1.5 53
1.75,
When x 2.5,
3 2
y3 ( x 2.5) S3 ( x 2.5) 46 2.5 414 2.5 985 2.5 715
121.25
CW.11. From the following table .
.in
x 1 2 3
y = f(x) –8 –1 18
ing
' '
Find cubic spline and compute y(1.5), y (1), y (2.5) and y (3).
S ( x) y1 ( x) 3( x 1)3 4 x 12, 1 x 2
S ( x) 1
eer
3
Sol: S2 ( x) y2 ( x) 3(3 x) 22 x 48, 2 x 3
&
gin
45
y ( x 1.5) S1 ( x 1.5) , y ' ( x 1) S1' ( x 1) 4
8
y ( x 2.5) S2 ( x 2.5) 7.375, y ' ( x 3) S2' ( x 3) 22.
En
HW.12. Fit a natural cubic spline for the following data: {AU2008}
x 0 1 2 3
arn
y = f(x) 1 4 0 –2
Sol: Assume M 0 0 M 3.
Le
S1 ( x) y1 ( x) 2 x3 5 x 1, [0,1]
S ( x) S2 ( x) y2 ( x) 3 x3 15 x 2 20 x 4, [1,2]
w.
S3 ( x) y3 ( x) x3 9 x 2 28 x 28, [2,3]
Anna University Questions:
ww
AU10.Given the following table, find f(2.5) using cubic spline functions :
x 1 2 3 4
(Anna Univ. f(x) 0.5 0.3333 0.25 0.2 May./June,
2007) Ans: S2(2.5) = 0.2829
AU11.Fit the st.line for the data. (Anna Univ. May/June, 2007)
x 0 1 2 3
f(x) 1 2 9 28
4 3 4
y1 ( x) 5 x 5 x 1, 0 x 1
1
f ( x) y2 ( x) [10 x3 18 x 2 19 x 1, 1 x 2
5
.in
102 2 333 159
y3 ( x) 2 x3 x x , 2 x3
5 5 5
ing
Topic 4 : Newton’s forward and backward difference formulas
*[Uniform (or) equal intervals only] *
eer
Newton’s forward interpolation difference formula:
[if y(required x near to x0 ) = ? and use ]
gin
y ( x) f ( x) f ( x0 uh)
u u (u 1) 2 u (u 1)(u 2) 3
= y0 y0 y0 y0 ...
1! 2! 3!
En
x x0
u ,
where h h = length of interval
arn
v ,
where h h = length of interval
ww
Part A:
15. What advantage has Lagrange’s formula over Newton?
Sol: The forward and backward interpolation formulae of
Newton can be used only when the values of the independent
variable x are equally spaced can also be used when the
differences of the dependent variable y become smaller
ultimately. But Lagrange’s interpolation formula can be used
whether the values of x, the independent variable are equally
spaced or not and whether the difference of y become smaller
or not.
.in
ing
eer
gin
En
arn
Le
w.
ww
Sol: Pn x Pn x0 uh E u Pn x0 E u y0
1 y0
u
u u (u 1) 2 u (u 1)(u 2) 3
= y0 y0 y0 y0 ...
1! 2! 3!
x x0
u
where h
17. Derive Newton’s backward difference formula by using
operator method.
Sol: Pn x Pn x0 vh E v Pn xn E v yn
v 1
1 yn where E 1
.in
v(v 1) 2 v(v 1)(v 2) 3
1 v ... yn
ing
2! 3!
v v(v 1) 2 v(v 1)(v 2) 3
yn y n yn yn ...
1! 2! 3!
eer
x xn
v ,
where h
gin
y = f(x) 1 2 1 10
Evaluate f(4). {AU 2000, 2009}
Sol: WKT, Newton forward formula to find the polynomial in x.
There are only 4 data given.Hence the polynomial will be degree 3.
Newton’s forward formula is
y ( x) f ( x) f ( x0 uh)
u u (u 1) 2 u (u 1)(u 2) 3
= y0 y0 y0 y0 ...
1! 2! 3!
x x0
u ,
where h h = length of interval
.in
f x 1 1 2 12
1! 2! 3!
2 x3 7 x 2 6 x 1
ing
When x 2,
f (4) 41
CW.14. The population of a city in a census takes once in 10 years is
eer
given below. Estimate the population in the year 1955.
Year 1951 1961 1971 1981
gin
Population in lakhs 35 42 58 84
Sol: y ( x 1955) f ( x 1955) 36.784
HW.15. From the table given below find sin 52 by using Newton’s
En
x y f ( x) y 2 y 3 y 4 y
Below 40 250
120
Below 60 370 –20
100 –10
Below 80 470 –30 20
70 10
Below 100 540 –20
50
Below 120 590
x x0 x 40 70 40
u x 70, u 1.5
20
.in
Here h 20 , When
1.5 1.5(1.5 1) 1.5(1.5 1)(1.5 2)
y ( x 70) 250 120 20 10
1! 2! 3!
ing
1.5(1.5 1)(1.5 2)(1.5 3)
20
4!
423.59 424
eer
Number of students whose weight is 70 424
Number of students whose weight is between 60 70 424 370 54.
CW17. Use Newton’s backward difference formula to construct as
gin
f ( ).
f(– 0.25) = 0.33493750, f(0) = 1.10100. Find 3
3 2
y ( x) x 4.001x 4.002 x 1.101 f ( ) 1
arn
Sol: , 3 = 0.174518518
HW.21. From the following data, find at x 43 and x = 84.
Le
x 40 50 60 70 80 90
184 204 226 250 276 304
Also express in terms of x.
w.
.in
Sol: = 22.0020
3. Using Newton’s divided difference formula find f(x) and f(6) from the
ing
following data : (M/J, 2007(EEE))
x 1 2 7 8
eer
f(x) 1 5 5 4
1
Ans:f(x) = 42 [3x3 − 58x2 + 321x − 224]; f(6) = 6.2381
gin
(0, 0), ( ,1) & ( , 0)
5. Given the points 2 satisfying the function
y sin x(0 x )
Le
y( )
, determine the value of 6 using the cubic
spline approximation. [ Assume M 0 0 M 2. ]
w.
2 2 3 3
S ( x) x x , 0, y S 0.4815
2 2 2 & 6 6
ww
Sol:
6. Fit the cubic spline for the following data:
x 0 1 2 3
y = f(x) 1 2 9 28
Sol: Assume M 0 0 M 3.
4 3 x
S1 ( x) y1 ( x) 5 x 5 1, [0,1]
1
S ( x) S2 ( x) y2 ( x) (10 x3 18 x 2 19 x 1, [1,2]
5
1
S3 ( x) y3 ( x) (14 x3 126 x 2 269 x 191, [2,3]
5
9. The hourly declination of the moon on a day is given below. Find the
.in
h m s h
declination at 3 35 15 and 5 .
ing
Hour 0 1 2 3 4
Declination 82953.7 81819.4 8643.5 7556.1 74327.2
Ans:
y 3h35m15s 74815, y 5h 1.00876
eer
gin
En
arn
Le
w.
ww
.in
ing
eer
gin
En
arn
Le
w.
ww
.in
ing
eer
gin
En
arn
Le
w.
ww
.in
formula to compute derivatives Quadrature formula]
(Equal interval)
ing
2. Newton’s backward difference 7. Simpson’s one third rule
formula to compute derivatives [n = 2 in Quadrature formula]
(Equal interval)
eer
3. Lagrange’s Interpolation 8. Simpson’s three eighth rule
formula [n = 3 in Quadrature formula]
(Equal or unequal intervals)
gin
quadrature formula
12. Double integrals by
Trapezoidal rule
Le
NUMERICAL DIFFERENTIATION:
ww
.in
4!
x x0
u
ing
where h
First derivative :
dy dy du dy 1 1 dy
eer
dx du dx du h h du
dy 1 2u 1 2 3u 2 6u 2 3
gin
i.e., y0 y0 y0
dx h 2 6
4u 3 18u 2 22u 6 4
En
y0 ...
24
arn
dy 1 1 1 1
dx at y0 2 y0 3 y0 4 y0 ......
x x0 h 2 3 4
u 0
Le
Second derivative :
d 2 y d dy d dy du d 1 dy
w.
dx 2 dx dx dx du dx dx h du
1 d 1 dy 1 d 2 y
ww
h du h du h 2 du 2
1 12u 2 36u 22 4
2 2 y0 u 1 3 y0 y0 ......
h 24
d2y 1 2 22
2 2
y0 3 y0 4 y0 .....
dx atx x0 h 24
u 0
Third derivative :
d3y 1 3 24u 36 4
3
3
y0 y0 .....
dx h 24
d3y 1 3 36
3 3
y0 4 y0 .....
dx at x x0 h 24
u 0
.in
v
y x f xn vh yn yn yn yn
1! 2! 3!
v v 1 v 2 v 3 4
ing
yn ...
4!
v v2 v 2 v3 3v 2 2v 3
eer
yn yn yn yn
1! 2! 3!
v 6v 11v 6v 4
4 3 2
gin
yn .....
4!
First derivative :
En
dy dy dv dy 1 1 dy
a
dx dv dx dv h h dv
arn
1 2v 1 2 3v 2 6v 2 3
yn yn yn
h 2 3!
Le
4!
dy 1 1 2 6
yn 2 yn 3 yn 4 yn ...
ww
dx at x x0 h 2 3! 4!
u 0
Second derivative :
d2y 1 2 6v 6 3 12v 2 36v 22 4
y y y ...
dx 2 h 2
n
3!
n 4! n
d2y 1 2 6 22
2 2
yn 3 yn 4 yn ...
dx atx x0 h 3! 4!
u 0
Third derivative :
d3y 1 6 3 24v 36 4
3
3 3!
yn yn .....
dx h 4!
d y
3
1 6 3 36
3 3 3!
yn 4 yn .....
dx atx x0 h 4!
u 0
.in
u u u 1 2 u u 1 u 2 3
y y0 y0 y0 y0 ...
ing
1! 2! 3!
First derivative :
dy 1 2u 1 2 3u 2 6u 2 3
y0 y0 y0 ... 1
eer
dx h 2! 3!
substitute h, y0 , 3 y0 , 4 y0 , ... gives the equation
gin
dy u 2
dx an equation in
En
dx
Put RHS of (1) =0, find u u1 , u2 , ...
d2y
Le
2
Find dx from (2),
d2y
w.
2
dx at u
Suppose 1 ve
ww
d2y
Suppose 2 + ve u2 is minimum point with
dx
at u2
y u2 = minimum value of y
.in
Time Velocity y x 2 y x 3 y x 4 y x
t=x v =y(x)
ing
0 x0 0 y 0
3 y 0
eer
5 3 8 2 y 0
36 3 y 0
gin
11
4 y 0
En
10 14 44 24 or
4
yn
arn
55
60 3 yn
Le
15 69 104 2 yn
159 yn
w.
20 228 yn
ww
.in
5 2 3 4
y 0 1
ing
2
Initial acceleration (acceleration when t = 0) is 1 m/sec .
(b) Final acceleration exists at t = 20 = x4 [Nearer to ending of table], so
eer
use Newton’s backward difference interpolation formula for first derivative.
WKT, Newton’s backward difference interpolation formula is
v v 1 2 v v 1 v 2 3
gin
v
y x f xn vh yn yn yn yn
1! 2! 3!
v v 1 v 2 v 3 4
En
yn ...
4!
1 1 2 6
y xn yn 2 yn 3 yn 4 yn ...
arn
h 2 3! 4!
1 1 2 6
159 104 60 24
Le
5 2 6 24
1
237 47.2 m / sec 2
w.
5
Eg (2) : Consider the following table of data :
ww
x xn 0.95 1
u 0.25
(2) h 0.2
f 0.95 1.367948
.in
x x0 x x1 x x2 f x0 , x1 , x2 , x3 ...
ing
x f(x) f x 2 f x 3 f x 4 f x
4 48
eer
52
5 100 15
97 1
gin
7 294 21 0
202 1
10 900 27
En
310
11 1210
arn
f x x3 x 2
f x 3x 2 2 x , f 8 176
f x 6 x 2 f 9 52
Le
,
To find maximum and minimum
w.
Put f x 0 3x 2 2 x 0 x 0, x2
3
Now, f x 0 6 0 2 2 0
ww
.in
NUMERICAL INTEGRATION
x0 nh
x0 f x dx or
arn
h
first term last term 2 remaining terms
2
Le
h y y 4 y y y ... 2 y y y ...
3 0 n 1 3 5 2 4 6
ww
x0 nh
x0 f x dx or
h first term last term
3 4 odd suffices 2 even suffices
Topic 8: Simpson’s three eighth rule (Simpson’s 3/8 rule) (n=3 in q.f.)
y0 yn
3h
2 y3 y6 ...
8
1 3 y y 2 y 4 y5 y7 ...
x0 nh
x0 f x dx or
first term last term
3h 2 suffices with a multiple of 3
8
3 remaining terms
b
I = f x dx
.in
Topic 9: Romberg’s method for a given interval a
ba
ing
when h , by trapezoidal rule, we get I1
2
ba
when h , by trapezoidal rule, we get I 2
eer
4
ba
when h , by trapezoidal rule, we get I 3
gin
8
I I
Romberg's formula for I1 & I 2 I RM1,2 I 2 2 1
3
En
I3 I 2
Romberg's formula for I 2 & I 3 I RM 2,3 I 3
3
arn
b
Given I f x dx
a
ww
1 5 3 3 8
(i) 1 f x dx 9 f f f 0
.in
5 5 9
1 1 1
0 f x dx 2 1 f x dx for even function f x
ing
(ii)
1 5 3 3 8
f f f 0
eer
2 9 5 5 9
(iii) a 1 & b 1 , then
gin
ba ba
x z mz c dx m dz
2 2
5 3
En
b 1 3 8
I f x dx f z m dz m f f f 0
1
9 5 5 9
a
arn
Given
hk sum of values of f at the nodes k↕
I 2
4 on the boundary except the corners
ww
.in
hk sum of the values of f at odd positions
I 4
9 on the odd rows of the matrix except boundary rows
ing
sum of the values of f at even positions
8
on the odd rows of the matrix except boundary rows
eer
8 sum of the values of f at odd positions
on the even rows of the matrix except boundary rows
gin
2 dx
EG 7 : Compute the value of 1 x using
Le
Solution :
Here h 0.25,
ww
1
y f x
x
The tabulated values of f x are
y
x0 x1 x2 x3 x4
x 1 1.25 1.50 1.75 2
1 1 1 1 1
f(x) 1 0.8 0.66667 0.57143 0.5
1 1.25 1.5 1.75 2
y0 y1 y2 y3 y4
.in
2 1 0.25
dx 1 0.5 4 0.8 0.57143 2 0.66667
3
ing
1 x
0.693255
(c) WKT, Simpson’s 3/8 rule is
eer
b 3h
a f x dx 8 y0 y4 3 y1 y2 2 y3
2 1 3 0.25
gin
By actual integration,
21
1 x dx loge x 1 ln 2 ln1 0.69315
2
arn
dx
10
Le
Solution : 1 x
(a) I = 2.51368 (b) I = 2.42200 (c) I = 2.41838
Actual integration, AI = 2.39790
1
HW 9 : Evaluate 0
x e x dx
taking 4 equal intervals by
(a) Trapezoidal rule (b) Simpson’s 1/3 rule
(c) Simpson’s 3/8 rule
Solution : (a) 1.02307 (b) 1.00017 (c) 0.87468, AI = 1
HW 10 : Calculate 0
3
sin x dx
taking 7 ordinates (6 intervals) using
a) Trapezoidal rule (b) Simpson’s 1/3 rule
(c) Simpson’s 3/8 rule
Solution : (a) 1.33467 (b) 1.32612 (c)1.30516,AI=1.3333
2 dx
2
Eg 11 : Evaluate 0 x 4 using Romberg’s method. Hence obtain an
approximate value for π.
Solution :
To find I1
20 1
When h 1, y f x 2
.in
2 x 4
2 dx
Let I = 0 x 2 4
The tabulated values of y are
x 0 1 ing 2
eer
1 1
f x 2 2
0.25 0.2 0.125
x 4 0 4
gin
y0 y1 y2
Using Trapezoidal rule,
2 dx h
En
I1 2 y0 y2 2 y1
0 x 4 2
1
arn
To find I 2
20 1
h 0.5
w.
4 2
The tabulated values of y are
ww
x 0 0.5 1 1.5 2
1
f x 2 0.25 0.23529 0.2 0.160 0.125
x 4
y0 y1 y2 y3 y4
Using Trapezoidal rule,
2 dx h
I2 2 y0 y4 2 y1 y2 y3
0 x 4 2
0.25 0.25 0.125 2 0.23529 0.2 0.160
0.39136
.in
Using Trapezoidal rule,
dx
2 h
I3 y0 y
ing
x2 4 2
0
0.25 0.125
0.125
2 0.24615 0.23529 0.21918 0.2 0.17918 0.16 0.14159
eer
0.39237
Romberg's formula for I1 & I 2 is
gin
I2 I1 0.39136 0.39136
I RM1,2 I 2 0.39136
3 3
En
= 0.39265
Romberg's formula for I 2 & I3 is
I3 I 2 0.39237 0.39237
arn
I RM 2,3 I3 0.39237
3 3
= 0.39271
Le
By actual integration,
ww
x2
2 dx 1 1
0 x 2 4 2 tan x 2 x 0 2 tan 1 tan 0
1 1 1
1
= 0 2
24 8
From 1 & 2 , 0.3927
8
= 8 0.3927 3.1416
1 1
Extras 13 : A curve passes through the points (1, 2), (1.5, 2.4), (2, 2.7),
(2.5, 2.8), (3, 3), (3.5, 2.6) & (4, 2.1). Obtain Area bounded by
.in
the curve, x axis between x = 1 and x = 4. Also find the volume
of solids of revolution by revolving this area about x – axis.
ing
Solution:
b 4
WKT, Area = a y dx 1 y dx
eer
4 h
Simpson's 1 rule, Area = 1 y dx y0 y6 4 y1 y3 y5 2 y2 y4
3 3
= 7.783
gin
b 4
Volume = y 2 dx y 2 dx
En
a 1
2
To find y :
x 1 1.5 2 2.5 3 3.5 4
arn
4 2 h
Volume = y dx y0 y6 4 y1 y3 y5 2 y2 y4
1 3
w.
1 1 1
1 f x dx f
3 3
2 dx
Eg 14 : Evaluate
1 x
by using Guassian two point formula.
b a z b a
Solution : Here a 1, b 2 1, so use x ,
2
x z 3 / 2 dx dz / 2
1 1
1
z 3 z z 3 z 1
3 3
0.693
.in
2
0 log 1 x dx
CW 15 : Using Guassian two point formula evaluate
Solution :
ing
1
I = log 1 1 z dz
1 4 4
1 1
eer
f f
4
3 3
0.858
gin
2 dx
HW 16 : Evaluate 1 1 x
3
by using Guassian two point formula.
En
Solution : I = 0.2544
5
9 f 3 5 f
8
3 5 f 0
9
Le
2
1
1 x3 dx
w.
1
4 4
dz , f z
1 8 z 33 8+ z+3
3
5
f 3 5 f 3 5 f 0
9
8
9
5 8
0.27505 0.11429
9 9
0.25439 ∵ 5 0.5555, 8 0.8888
9 9
I = 0.02544
11
.in
dt
CW 18 : Find t 0 by using Guassian three point formula.
Solution : I = 1.6027
ing
1 dx
Eg 19 : Evaluate
0 1 x2
by two and three point Guassian quadrature
formula & hence find the value of .
eer
Solution :
b a z b a z 1 dz
x x dx
gin
2 2 2
1 dx 1 1 1
Now, I
0 1 x2 1 2 2
z 1
En
1
2
1 1
arn
1
f z dz , f z 2
1 2 z 1
1
2
Le
I= 1 f z dz f
f
3
0.7868
3
1
ww
2
HW 20 : Find 0
sin x dx
by two & three point Guassian quadrature
formula.
Solution :
x z 1 4
I = 0.9985 by two point formula
I = 1.0000 by three point formula
.in
Eg 21 : Evaluate the integral
1 2 xy using Trapezoidal rule and
Simpson’s rule. Verify your results by actual integration.
ing
1
Solution : f x, y , x varies from 1, 1.4
xy
eer
y varies from 2, 2.4
Divide the range of x and y into 4 equal parts
gin
2.4 2 1.4 1
h 0.1, k 0.1
4 4
f x, y at the nodal points are given in the table :
En
The values of
x
2 2.1 2.2 2.3 2.4
y
arn
0.5 0.4167 0.2976 0.3571
0.1 0.1 0.4762 0.4545 0.4348 0.3788 0.3472 0.3205
2
4 0.3106 0.3247 0.3401 0.3846 0.4167 0.4545
4 0.4329 0.4132 0.3953 0.3623 0.3344
0.3497 0.3663 0.3698 0.3788
0.0614
By Extended Simpson’s rule :
hk
I Sum of the values of f at the four corners
.in
9
+2 Sum of the values of f at the odd positions on the boundary except the corners
+4 Sum of the values of f at the even positions on the boundary except the corners
ing
Sum of the values of f at the odd positions
+4
on the odd rows of the matrix except boundary rows
Sum of the values of f at the even positions
+8 on the odd rows of the matrix except boundary rows
eer
Sum of the values of f at the odd positions
8
on the even rows of the matrix except boundary rows
gin
16 Sum of the values of f at the even positions
on the even rows of the matrix except boundary rows
0.5 0.4167 0.2976 0.3571
En
2 0.4545 0.3472 0.3247 0.4167
arn
4 0.3788
9
8 0.3968 0.3623
w.
8 0.3497 0.4132
16 0.3663 0.3344 0.4329 0.3953
ww
0.01
55.2116 0.0613
9
By actual integration :
1.4 2.4 1 1.4 2.4 1 1 1.4 2.4 1
1 2 xy dx dy 1 2 x dx y dy 1 log x 2 y dy
log 2.4 log 2 log y 1
1.4
0.0613
.in
PART – A
ing
1. State the Romberg’s integration formula with h1 and h2 . Further, obtain
h
h1 h and h2 .
eer
the formula when 2
I1h22 I 2 h12
Solution : I , where I1 the value of the integral with h1
h22 h12
gin
If h1 h & h2 h 2 we get
4 I 2 I1 1
I I 2 I 2 I1
arn
3 3
1
dx
1 x2 .
Le
1
1 1
f x dx f 3 f
3
ww
1
1
Here f x
1 x2
1 1 1 3
f 1
3 1 4 4
3 3
1 1 1 3
f 1
3 1 4 4
3 3
1
1 3 3 3
2
dx 1.5
1 1 x
4 4 2
But actual integration
1
1 1
1 x 2 dx tan
1
x tan 1 1 tan 1 1
1
1
.in
1.5708
Here the error due to two – point formula is 0.0708.
3.
ing
Write down the formulae for finding the first derivative using Newton’s
forward difference at x x0 Newton’s backward difference at x xn .
eer
Solution :
v v v 1 2 v v 1 v 2 3
y x yn yn yn yn
gin
1! 2! 3!
v v 1 v 2 v 3 4 x xn
yn , where v
En
4! h
Here x xn v 0
y x yn
arn
y x h y x
y x yn lim
h 0 h
Le
y x yn
w.
2
x2
e dx
4. Evaluate 0 by two point Guassian quadrature formula.
ww
x2
Solution : Here f (x) = e [Given range is not in exact form]
ba ba
Let x z Here a 0, b 2
2 2
20 20
z
2 2
x z 1 x 0 z 1
dx dz x 2 z 1
.in
1
1
1
f e 3 e 2.488 0.0831
3
ing
2
x2
1 e dx 0.8364 0.0831
0
eer
0.9195
n n 2 n 3
2 n n 2
a nh 2
f x dx nh 1 3 ... f a
arn
a 2 12 24
This is known as the general Gauss-Lagendre integration formula.
Putting n = 1 and omitting second and hyper differences in the above,
Le
we get
ah
h h
f x dx 2 f a f a h 2 y1 y2
w.
a
ww
1
6. When do you apply Simpson’s 3 rule, and what is the order of the
1
error in Simpson’s 3 rule.
Solution : Let n = interval
1
Rule : Simpsons’ 3 rule → The number of ordinates is odd (or) the
intervals number is even.
2
The error in the trapezoidal formula is of the order h .
7. State Simpson’s one third rule.
Solution : Let DC be the curve y = f (x) and DA, CB be the terminal
ordinates. Let OA = a and OB = b. Divide AB into even number(say
2n) of equal parts, equal to h. Let x1 , x2 ,...x2 n 1 be the abscissae of the
points, A, A1 , B and y1 , y2 ,... y2 n 1 be the corresponding ordinates.
Then A 2n-1
.in
b
h
y dx is approximately 3 A + 4B + 2C 1
a
ing
where A = y1 y2 n 1 sum of the first and last ordinates.
B = y2 y1 ... y2 n sum of the even ordinates and
eer
C = y3 y5 ... y2 n 1 sum of the remaining ordinates 1 is
known as Simpson's rule or Simpson's one-third rule.
gin
f x dx.
En
1
Solution : Two points Guassian quadrature formula is
1
arn
1 1
f x dx f f
3 3
1
This formula is exact for polynomials upto degree 3.
Le
Numerical Differentiation
1. Find f '(10) from the following data: (May 2011)
ww
x 3 5 11 27 34
f(x) –13 23 899 17315 35606
2. Find the first and second derivatives of y w.r.t x at x = 10 from the
data given below:
x 3 5 7 9 11
y 31 43 57 41 27
dy
3. Find dx at x = 1 from the following table:
x 1 2 3 4
y 1 8 27 64
.in
1 x2 dx
7. Evaluate 0 using Romberg’s method.
ing
2
1
1 x3 dx
8. Evaluate 1 using Gaussian three point formula.
eer
1 1 1
0 0 x y 1dx dy
9. Evaluate by using Trapezoidal rule taking
gin
Evaluate 2 4
xy dx dy
12. using Simpson’s rule given h = k = 0.1.
13. The velocity v of a particle at a distance S from a point on its path is
w.
v(m/sec) 47 58 64 65 61 52 38
Estimate the time taken to travel 60 meters by using Simpson’s three –
eighth rule.
14. By dividing the range into ten equal parts, evaluate by0 sin x dx
Trapezoidal and Simpson’s rule. Verify your answer with actual
integration.
10 dx
15.
Calculate 2 1 x by dividing the interval into eight equal parts and
11
log e .
hence find an approximate value of 3
UNIT IV
INITIAL VALUE PROBLEMS FOR ORDINARY
DIFFERENTIAL EQUATIONS
Single step methods: Taylor series method – Euler method for first order
equation – Fourth order Runge – Kutta method for
solving first and second order equations.
Multi step methods: Milne’s and Adam’s predictor and corrector methods.
.in
d2y f f dy
dx 2 x y dx
ing
ie., y f x f y y
llly find y , y ,...
eer
Taylor’s series expansion of y(x) above x x0 is given by
x x0 x x0 2 x x0 3
y x y x0 y x0 y x0 y x0 ...
gin
1! 2! 3!
x x0 x x0 2 x x0 3
y0 y0 y0 y0 ...
En
1! 2! 3!
or
arn
h h2 h3
y x1 y1 y0 y0 y0 y0 ..., where x1 x0 h, h x x0
1! 2! 3!
h2 h3
Le
h
y x2 y2 y1 y1 y1 y1 ..., where x2 x1 h, h x x0
1! 2! 3!
w.
dx
2
Solution : Given y x y 1, x0 0, y0 1, h 0.1
Taylor’s series formula is
h h2 h3
y1 y0 y y y0 ... 1
1! 2! 3!
y x2 y 1 y0 x0 2 y0 1 1
y 2 xy x 2 y y0 2 x0 y0 x02 y0 0
y 2 xy y x 2 y y 2 x
.in
ie., y 0.1 1 0.1 ...
3 4
ing
0.900305
HW 3 : Using Taylor’s series method, with the first five terms in the
expansion; find y (0.1) correct to 3 decimal places, given that
En
dy
e x y 2 , y 0 1.
dx
arn
differential equations
dy dz
f1 x, y, z , f 2 x, y, z with initial
w.
Given
dx dx
conditions y x0 y0 , z x0 z0
ww
.in
0.1 0.12 0.13 0.14
1 y 0.1 1 1 1 0 1
ing
1! 2! 3! 4!
= 1.1050 correct to 4 decimal places
x2 x3
y x y0 xy0 y0 y0 ... 1
2! 3!
w.
y y xy y0 y0 x0 y0 1 0 0 1
ww
y y xy y 2 y xy y0 0
y 2 y xy y 3 y xy
iv
y0iv 3
x2 x4
1 y x 1 0 1 0 3 ...
2! 4!
x2 x4
1 ...
2 8
0.12 0.14
y 0.1 1 ...
2 8
1.0050125 ≃ 1.0050 correct to 4 decimal places
0.2 2 0.2 4
y 0.2 1 ...
2 8
1.0202
.in
Euler algorithm is
ing
y1 y0 hf x0 , y0
y 2 y1 hf x1 , y1
y3 y2 hf x2 , y2
eer
⋮
y n yn 1 hf xn 1 , yn 1
gin
dy
x y, y 0 1 with h 0.2.
dx
arn
y x y
We have to find y 0.2 y1
w.
.in
Solution : y1 0.2, y2 0.484281
ing
HW 8 : Using Euler’s method, find the solution of the initial value problem
dy
log x y , y 0 2
eer
dx at x = 0.2 by assuming h = 0.2.
Solution : y (0.2) = 2.0602
gin
h h
n 0, y1 y0 hf x0 , y0 f x0 , y0
2 2
arn
h h
n 1, y2 y1 hf x1 , y1 f x, y
2 2
Le
h h
y3 y2 hf x2 , y2 f x2 , y2
2 2
w.
0.1 0.1
Therefore y1 0 0.1 f 0 , 0 1
2 2
0.1 f 0.05,0.05 0.1 1 y
xy0.05
0.05
1 0.05
y1 0.095
h h
Now y2 y1 hf x1 , y1 f x1 , y1
2 2
Here f x1 , y1 1 y1 0.905
0.1 0.1
.in
i.e., y2 0.905 0.1 f 0.1 , 0.095 f 0.1, 0.095
2 2
y2 0.18098
h h
Now y3 y2 hf x2 , y2 f x2 , y2
2 2
ing
eer
Here f x2 , y2 1 y2 1 0.18098 0.81902
0.1 0.1
gin
dy
HW 11 : Given y x 2 0, y 0 1, y 0.1 0.9052,
dx
ww
Topic 3.1 : Fourth order Runge – Kutta method for solving I order
Differential Equations[Single step method]
dy
Given y f x, y
dx
& y x0 c0 ,
Now y x1 ? c1 , y x2 ? c2 , y x3 ? c3 ,...
General
h( Interval length)
xn known xn 1 known
.in
yn known yn 1 yn yn 1 to find
ing
To find f xn 1 y xn 1 yn 1 :
Fourth order Runge – Kutta Algorithm :
yn 1 y xn h y xn yn 1 yn yn 1
eer
1
where yn 1 k1 2k2 2k3 k4
6
gin
where k1 hf xn , yn
h k
k2 hf xn , yn 1
En
2 2
h k
arn
k3 hf xn , yn 2
2 2
k4 hf xn h, yn k3
Le
To find f x1 y x1 y1 :
k1 hf x0 , y0
w.
h k
k2 hf x0 , y0 1
ww
2 2
h k
k3 hf x0 , y0 2
2 2
k4 hf x0 h, y0 k3
1
y1 k1 2k2 2k3 k4
6
y1 y x0 h y x0 y1 y0 y1
dy
x y 2 , y 0 1,
Eg 12 : Given dx find y (0.1) & y (0.2) by Runge –
Kutta method for IV order.
Solution : Given y f x, y x y , h 0.1
2
& x0 0, y x0 0 1.
To find y (0.1) :
k1 hf x0 , y0 0.1 f 0.1 0.1 0 12 0.1
h k
k2 hf x0 , y0 1 0.1 f 0 0.05, 1 0.05
.in
2 2
0.1 0.05 1.05 0.11525
2
ing
h k 0.11525
k3 hf x0 , y0 2 0.1 f 0.05,1
2 2 2
eer
0.1 0.05 1.057625 0.116857
2
gin
1 1
y k1 2k2 2k3 k4 0.1 2 0.1 2 0.11525 0.116857
6 6
arn
0.11649
y 0.1 y1 y0 y 1 0.11649 1.11649 y1 1.11649
Le
0.1347
ww
h k 0.1347
k2 hf x1 , y1 1 0.1 f 0.1 0.05,1.11649
2 2 2
0.1 f 0.15,1.18385 0.1552
h k 0.1552
k3 hf x1 , y1 2 0.1 f 0.1 0.05,1.11649
2 2 2
0.1 f 0.15,1.1941 0.1576
k4 hf x1 h, y1 k3 0.1 f 0.1 0.1,1.11649 0.1576
0.1 f 0.2,1.2741 0.1823
1
y k1 2k2 2k3 k4 0.1571
6
y2 y1 y 1.11649 0.1571 1.27359
i.e.,
x 0 0.1 0.2
y 1 1.11649 1.27359
.in
Solution : y1 0.140 Here y2 y 1.4 0.27 , h 0.2
Topic 3.2 : Fourth Order Runge – Kutta method for solving II order
differential equation
En
y 2 y 2 y e 2 x sin x, y x 0 0.4
y x 0 0.6
w.
y 2 y 2 y e 2 x sin x 1
ww
Here h 0.2
Setting y z , y z
1 z 2 z 2 y e 2 x sin x
dy
Let f1 x, y, z z,
dx
d2y dz
& f 2 x, y , z 2
2 z 2 x e 2 x sin x
dx dx
.in
2 2
0.6 0.136 0.2 f 2 0.1, 0.46, 0.532
2
ing
2 0.532 2 0.46
0.1064 0.2 2 0.1
e sin 0.1
eer
0.2 1.064 0.92 0.1294
0.00292
ℓ ℓ
gin
h k h k
k3 hf1 x0 , y0 2 , z0 2 ℓ 3 hf 2 x0 , y0 2 , z0 2
2 2 2 2 2 2
0.2 0.2 0.1064
0 2 , 0 2 , 0.4 2 ,
En
0.2 f 2
0.1064 0.00292
0.2 f1 0.4 , 0.6
2
arn
2
0.6 0.00292 0.2 f 2 0.1, 0.4532, 0.60146
2 2 0.60146 2 0.4532
Le
0.0105
k4 hf1 x0 h, y0 k3 , z0 ℓ 3 ℓ 4 hf 2 x0 h, y0 k3 , z0 ℓ 3
ww
1 1
y k1 2k1 2k2 2k3 z ℓ 1 2ℓ 2 2ℓ 3 ℓ 4
6 6
0.1159 0.03194
y1 y 0.2 y0 y z1 z 0.2 z0 z
0.5159 0.2806
.in
y(0.2) by using R. K. method of fourth order.
ing
Solution : y (0.2) = 0.9801
h k ℓ h k ℓ
k2 hf1 x0 , y0 1 , z0 1 ℓ 2 hf 2 x0 , y0 1 , z0 1
2 2 2 2 2 2
Le
h k ℓ h k ℓ
k3 hf1 x0 , y0 2 , z0 2 ℓ 3 hf 2 x0 , y0 2 , z0 2
2 2 2 2 2 2
w.
k4 hf1 x0 h, y0 k3 , z0 ℓ 3 ℓ 4 hf 2 x0 h, y0 k3 , z0 ℓ 3
1 1
ww
y k1 2k2 2k3 k4 z ℓ 1 2ℓ 2 2ℓ 3 ℓ 4
6 6
y1 y0 y z1 z0 z
dy dz
xz 1, xy
Eg 18 : Solving the system of differential equation dx dx
for x = 0.3 using fourth order R. K. method, the initial values are
x = 0, y = 0, z = 1.
Solution : Given x0 0, y0 0, z0 1, h 0.3.
f1 x, y, z xz 1 f 2 x, y, z xy
k1 hf1 x0 , y0 , z0 0.3 x0 z0 1 ℓ 1 hf 2 x0 , y0 , z0 0.3 0 0
0.3 0 1 0.3 0
h k ℓ h k ℓ
k2 hf1 x0 , y0 1 , z0 1 ℓ 2 hf 2 x0 , y0 1 , z0 1
2 2 2 2 2 2
0.345 0.007
h k ℓ h k ℓ
k3 hf1 x0 , y0 2 , z0 2 ℓ 3 hf 2 x0 , y0 2 , z0 2
2 2 2 2 2 2
.in
0.3448 0.0078
k4 hf1 x0 h, y0 k3 , z0 ℓ 3 ℓ 4 hf 2 x0 h, y0 k3 , z0 ℓ 3
ing
0.3893 0.031032
1 1
y k1 2k2 2k3 k4 0.34482 z ℓ 1 2ℓ 2 2ℓ 3 ℓ 4 0.01011
eer
6 6
y1 y0 y 0 0.34482 z1 z0 z 1 0.01011
gin
2 y z, y 3 z , y 0 0, z 0 0.5
dx dx
for y (0.1) and z (0.1) using R. K. method of fourth method.
arn
dx dx
when x = 0 at intervals of h = 0.1 from x = 0.0 to x = 0.2.
ww
dy 1
x y , y 0 2, y 0.5 2.636,
Eg 21 : Given dx 2
y 1 3.595, y 1.5 4.968 by Milne’s method to find y (2).
Solution : Given
x0 0 x1 0.5 x2 1 x3 1.5 x4 2
y0 2 y1 2.636 y2 3.595 y3 4.968 y4 ?
Here h = 0.5
1
y x y f x, y
Given 2
.in
By Milne's predictor formula,
4h
2yn 2 yn 1 2 yn
ing
yn 1, p = yn 3 +
3
4h
n 3, y31, p = y0 + 2y1 y2 2 y3 1
eer
3
1 1
Now, y1 = x1 y1 = 0.5+2.636 =1.568
2 2
gin
1 1
y2 = x2 y2 = 1+3.595 =2.2975
2 2
En
1 1
y3 = x3 y3 = 1.5+4.968 =3.234
2 2
4 0.5
arn
3
h
n 3, y4, c y2 y2 4 y3 y4 2
ww
3
1 1
Now y4 x4 y4 2 6.871 4.4355
2 2
0.5
2 y4, c 3.595 2.2975 4 3.234 4.4355
3
0.5
3.595 19.669 6.8732
3
Corrected value of y at 2 is y 2 = 6.8732.
dy 3
x y, y 0 2, y 0.2 2.073,
CW 22 : Given dx the values of
y 0.4 2.452, y 0.6 3.023 are got by R.K. Method. Find
y 0.8 by Milne’s method.
y 0.4 0.0795, y 0.6 0.1762 by Milne’s method to find y (0.8) and y (1).
Solution : y (0.8) = 0.3046, y (1) = 0.4515.
.in
Topic 5 : Adam’s predictor and corrector methods
(efficient multistep method) [Adam’s-Bashforth method]
ing
Adam’s predictor formula :
h
yn 1, p yn 55 yn 59 yn 1 37 yn 2 9 yn 3
24
eer
Adam’s corrector formula :
h
yn 1, c yn 9 yn 1 19 yn 5 yn 1 yn 2
24
gin
24
h
n 3, y4, p y3 55 y3 59 y2 37 y1 9 y0 1
ww
24
Here y0 x0 2 1 y0 12 1 1 2
y1 x12 1 y1 1.1 1 1.233 2.70193
2
0.1
1 y4, p 1.979 55 5.0345 59 3.60912 37 2.70193 9 2
4
2.5870451
0.1
2 y4, c 1.979 9 7.030716 19 5.0345 5 3.60912 2.70193
24
2.5772844.
.in
2
CW 25 : Using Adam’s Bashforth method, find y (4.4) given 5 xy y 2,
y (4) =1, y (4.1) =1.0049, y (4.2) =1.0097 & y (4.3) =1.0143.
ing
2 y2
y , y4, p 1.0186 & y4, c 1.0187.
Solution : Here 2x
CW 26 : Evaluate y (0.9), using Adam Bashforth’s predictor-corrector
eer
1
dy
xy 3 ,
method, given that dx y (1)=1, y (1.1)=1.10681, y (1.2)=1.22787
gin
and y (1.3)=1.36412.
Solution : Here h = – 0.1, y4, p 0.906518 & y4, c 0.906520.
En
arn
Le
w.
ww
PART – A
dy
x y,
1. Use Euler’s method to find y (0.2) and y (0.4) given dx
y (0) = 1 with h = 0.2.
Solution : f x, y x y, x0 0, y0 1, x1 0.2, x2 0.4
By Euler algorithm,
y1 y0 hf x0 , y0 1 0.2 x0 y0 1 0.2 0 1
i.e., y1 y 0.2 1.2
y2 y1 hf x1 , y1 1.2 0.2 x1 y1 1.2 0.2 0.2 1.2
.in
1.2 0.28
i.e., y2 y 0.4 1.48
ing
y3 y2 hf x2 , y2 1.48 0.2 x2 y2 1.48 0.2 0.4 1.48
1.48 0.376
eer
i.e., y3 y 0.6 1.856
2. Write the Adam-Bashforth predictor and corrector formulae.
gin
24
h
yk 1, c yk 9 yk 1 19 yk 5 yk 1 yk 2
24
arn
dy
x y,
Le
f x, y x y, x0 0, y0 1, x1 0.1, h 0.1
By Euler algorithm,
ww
y1 y0 hf x0 , y0
1 0.1 x0 +y0
1 0.1 0 1
1 0.1
1.01
i.e., y 0.1 1.01
4. What are multistep methods? How are they better than single step
methods?
Solution : 1. Milne’s predictor – correction method.
2. Adams-Bashforth predictor – correction method.
In the single step methods, it is not possible to get any information
about truncation error.
In the multi step methods, it is possible to get easily a good estimate of
the truncation error.
5. Using Taylor series method, find y (1.1) given that y x y, y 1 0.
Solution : Given y x y, x0 1, y0 0, h 0.1
y x y y0 x0 y0 1 0 1
.in
y 1 y y0 1 y0 1 1 2
y y y0 y0 2
y iv y
h h2 h3
y0iv y0 2
h 4 iv ing
eer
y1 y0 y0 y0 y0 y0 ...
1! 2! 3! 4!
0.1 0.1 0.1
2 3 4
0.1
y 1.1 0 1 2 2 2 ...
gin
1! 2! 3! 4!
0.1 0.1
3 4
En
0.1 0.1
2
3 1.2
0.1 0.01 0.0003 0.0000083
arn
0.1103083
0.1103 correct to four decimals
Le
By Euler algorithm,
y1 y0 hf x0 , y0
0 0.2 f 0, 0
0.2 0 e0 0.2
i.e., y 0.2 0.2
.in
ing
eer
gin
En
arn
Le
w.
ww
.in
at x = 0.2
ing
4.
using R.K.method of fourth order.
eer
5. Using R. K method of order 4,find y for x =0.1, 0.2, 0.3 given that
dy
xy y 2 , y (0) 1
dx also find the solution at x = 0.4 using Milne’s
gin
method.
2
Using Milne’s method to find y(4.4) given that 5 xy y 2,
En
6.
y (4) 1, y (4.1) 1.0049, y (4.2) 1.0097, y (4.3) 1.0143 .
arn
2
7. Given y xy y , y (0) 1 ,find y(0.1) by Taylor’s method, y(0.2) by
Euler’s method, y(0.3) by Runge – Kutta method and y(0.4) by Milne’s
Le
method.
w.
dy
y x 2 1, y (0) 0.5
8. Consider dx
ww
.in
differential equation
Consider the problem
y '' x f x g ' x g x y x r x
ing
with the boundary conditions y x0 a and y xn b.
eer
Foe solving the equation, replace y '' and y ' by the formulae
y 2 yi yi 1
y '' i 1
gin
h2
y yi 1
y ' i 1
En
2h
d2y
yx
arn
dx 2
d 2 y x
ww
i.e., y x x 1
dx 2
Using the central difference approximation, we have
y 2 yi yi 1
y '' i 1 2
h2
Substitute (2) in (1), we get
yi 1 2 yi yi 1
yi xi
h2
yi 1 2 yi yi 1
yi xi
h2
yi 1 2 yi yi 1 h 2 yi h 2 xi
1 1 1
yi 1 2 yi yi 1 yi xi ∵ h
16 16 4
16 yi 1 33 yi 16 yi 1 xi 3
.in
2
3
16 y2 33 y3 16 y4
4
Given y 0 0 i.e., y x0 0 0 i.e., y0 0
ing
y 1 0 i.e., y x4 1 0 i.e., y4 0
5
eer
1 1 1 3
Since h , we have x1 x0 h , x2 x1 h , x3 x2 h
4 4 2 4
gin
1
16 y1 33 y2 16 y3 7
2
arn
3
16 y2 33 y3 0 8
4
Le
.in
subject to the boundary conditions y 0 0, y 1 2.
ing
1 2 3
y1 y 0.5443, y2 y 1.0701, y3 y 1.5604
Solution : 4 4 4
eer
Classification of PDE of second order:
2u 2u 2u u u
A x, y 2 B x, y C x, y 2 f x, y , , 0
gin
x x y y x y
If B 2 4 AC 0 Elliptic form
En
B 2 4 AC 0 Parabola form
B 2 4 AC 0 Hyperbola form
arn
B 2 4 AC 4 0
Given equation is Hyperbic form
w.
B 2 4 AC 4 xy 0 when x 0, y 0
Given equation is Elliptic form
Eg: (3): Classify u xx 2u xy u yy 0.
Solution: Here A 1, B 2, C 1.
B 2 4 AC 0
Given equation is Parabolic form
2
2
Eg: (4): Classify x f xx 1 y f yy 0, 1 y 1, x .
Solution: Here A x , B 0, C 1 y .
2 2
B 2 4 AC 4 x 2 1 y 2 4 x 2 y 2 1 .
x
x 2 is always ‘+’ in
2
In 1 y 1, y 1 is ‘–’.
B 2 4 AC ve x 0
Given equation is Elliptic form
If x 0, B 4 AC 0 Given equation is Parabolic form
2
.in
Eg: (5):
Hyperbolic
ing
Parabolic Type Elliptic Type
Type
2u 2u 2u 2u
2 2 0
eer
u u t 2
x 2
x 2
y 2
2 2
t x (One (Laplace equation in
(One dimensional Heat equation) dimensional Two dimensional
gin
u 2u
2 2
One dimensional heat equation is t x
ww
1
2
Put a
u 1 2u
t a x 2
u 2u
i.e., a
t x 2
.in
where 2 ah 2
Equation (2) is called Bender–Schmidt’s recurrence equation.
Eg (5) : Solve x
2u
2
u
2
t ing
0 given u 0, t 0, u 4, t 0,
eer
u x, 0 x 4 x . Assume h = 1. Find the values of u upto t = 5.
2u u 2u u
gin
By Bender–Schmidt’s relation, 2 2
Step size in time(t) = k = 1 = t
Step size in x = h = 1 = x
arn
ui , j 1
ui , j 1 ui 1, j ui 1, j
The values of are calculated by 2 as follows:
Le
x direction
h
0 1 2 3 4
t
w.
u 1, 0 u 2, 0 u 3, 0
u (0, t ) u 4, t
ww
0
1 4 1
2 42 3 4 3
0 0
3 4 3
t 04 33 40
1 0 2 3 2 0
dir. 2 2 2
2 0 1.5 2 1.5 0
3 0 1 1.5 1 0
4 0 0.75 1 7.5 0
5 0 0.5 0.75 0.5 0
.in
Given f 0, 0 0, f 1, 0 12 25 12 24, f 2, 0 22 25 22 84,
f 3, 0 32 25 32 144, f 4, 0 42 25 42 144, f 5, 0 0
The values of
ui , j
are calculated by
1
2 ing
ui , j 1 ui 1, j ui 1, j
as follows:
eer
x direction
i
0 1 2 3 4 5
t=jk
gin
0 0 24 84 144 144 0
t 0.5 0 42 84 114 72 0
1 0 42 78 78 57 0
En
d 1.5 0 39 60 67.5 39 0
i 2 0 30 53.25 49.5 33.75 0
arn
r
e 2.5 0 26.625 39.75 43.5 24.75 0
c 3 0 19.875 35.0625 32.25 21.75 0
t 3.5 0 17.5312 26.0625 28.4062 16.125 0
Le
i
o 4 0 13.0312 22.9687 21.0938 14.2031 0
n 4.5 0 11.4843 17.0625 18.5859 10.5469 0
w.
.
1
Here [Otherwise, the values of h & k are given]
Eg(9): 2
Solve ut u xx ,0 x 1, t 0, u x, 0 100 x x ,
2
u 0, t u 1, t 0, 1 1
h ,k
4 16 .
1 1
Given ut u xx , a 1, h , k .
Solution: 4 16
k 1/16 1
2 1 1
Let ah 1 1/16 2
We need to use formula ui , j 1 ui 1, j ui 1, j 1 2 ui , j 1
.in
When 1, 1 ui , j 1 ui 1, j ui 1, j ui , j
ing
The values of ui , j are calculated as follows:
x direction
eer
x
0 0.25 0.5 0.75 1
t
0 0 18.75 25 18.75 0
gin
1
t 0 6.25 12.5 6.25 0
16
dir.
2
En
0 6.25 0 6.25 0
16
3
arn
16
w.
Crank–Nicolson’s formula is
1
ui , j 1 ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j
4
u
Eg (10) : Solve t u xx x 5, t 0, given that u x, 0 20, u 0, t 0,
,0
u 5, t =100. Compute u for the time–step with h = 1 by
Crank–Nicolson’s method.
Solution : Given ut u xx , a 1, h 1,
.in
1 0 u1 u2 u3 u4 0
1
ing
ui , j 1 ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j
Use Crank–Nicolson’s formula 4 ,
we get
eer
1
u1 0 0 20 u2 4u1 20 u2 4u1 u2 20 1
4
1
u2 u1 20 20 u3 4u2 40 u1 u3 u1 4u2 u3 40 2
gin
4
1
u3 u2 20 20 u4 4u3 40 u2 u4 u2 4u3 u4 40 3
En
4
1
u4 u3 20 100 100 4u4 220 u3 u3 4u4 220 4
arn
4
Solving (1) and (2), we get
15u2 4u3 180 5
Le
.in
t
0 0 0 0 0 0
ing
1 1
t 0 u1 u2 u3
16 16
dir.
2 2
eer
0 u4 u5 u5
16 16
1
ui , j 1 ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j
gin
1
u2 u1 0 0 u3 4u2 u1 u3 2
4
arn
1 1 1
u3 u2 0 0 4u3 u2 3
4 16 16
Le
u u 1 1
2 u2 1 2 u 2 = =0.0045
4 4 64 224
w.
1
1 u1 =0.0011
896
ww
3 u3 0.0168
1 1
u4 0 0 u2 u5 u4 0.0045 u5 4
4 4
1 1
u5 u4 u1 u3 u6 u5 u4 0.0011 0.0168 u6 5
4 4
1 1 2 1 3
u6 u5 u2 u6 u5 0.0045 6
4 16 16 4 16
u4 0.005899, u5 0.01913, u6 0.05277
The values of u are 0.0011,0.0045,0.0168,0.005899, 0.01913, 0.05277 .
.in
h
valid for k
a
After filling given boundary conditions
ing
(i.e., after filling first column, first row, last column by given conditions)
sum of just previous extreme columns previous 2nd value in same column
En
Solution :
Given differential equation ytt y xx is of one dim. wave equation form.
Le
2u 2u
i.e., One dimensional wave equation is a2
t 2 x 2
w.
h
valid for k
a
ww
2 2
Here coefficient of y xx in ytt a y xx is 1 a 1 a 1
Given k t difference 0.1 k
h h
WKT, k 0.1 h 0.1
a 1
.in
0+5.12 – 5.08 0.0 5.1 10. 10. 10. 5.1 0.0 0.0
0.3 0 0
= 0.04 8 2 15 16 15 2 8 4
0.4 0
0+0.08 – 0.06
= 0.02
0.0
4
0.0
6
5.0
8 ing
10.
09
5.0
8
0.0
6
0.0
4
0.0
2
0
eer
0+0.04 – 0.04 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.5 0 0
gin
=0 0 0 0 0 0 0 0 0
y y
( (
En
0 1
, ,
arn
t t
) )
= =
Le
0 0
← ←
w.
.in
ing
ui , j
ui 1, j ui 1, j
eer
ui , j 1
gin
ui , j
w.
ui 1, j 1 ui 1, j 1
ww
To find u1, u2 , u3 , u4 :
.in
formula is 4
Stop procedure until two consecutive iteration values are same.
ing
n
n 1
i.e., stop if ui ui , i with error < 0.1
For 4 4 matrix form:
eer
B1 B16 B15 B14 B13
u1 u2 u3
gin
B2 B12
u4 u5 u6
B3 B11
u7 u8 u9
En
B4 B10
arn
B5 B9
B6 B7 B8
To find ui , i 1, 2,...,9 :
Le
extreme boundary values only
u1 B1 B3 u5 B15 4 by DFPF
u3 B15 u5 B11 B13 4 by DFPF
u7 B3 B5 B7 u5 4 by DFPF
u9 u5 B7 B9 B11 4 by DFPF
.in
n
n 1
i.e., stop if ui ui , i with error < 0.1
2
Eg (16) : Solve u 0, the boundary conditions
ing
are given below (give
only 3 iterations)
10 20
0 30
eer
u3 u4
20 40
u1 u2
40 50
gin
60 60 60 60
Solution :
En
Assume u4 0
Find Rough Values [Initial values (or) Starting values] :
arn
u1 20 0 60 60 4 35 by DFPF
u2 35 0 50 60 4 36.25 by SFPF
by SFPF
Le
u3 10 20 35 0 4 16.25
u4 16.25 20 40 36.25 4 28.125 by SFPF
w.
formula is 4
I iteration :
u 1 40 60 16.25 36.25 4 38.125
1
by SFPF
1
u
2
60 50 38.125 28.125 4 44.0625 by SFPF
1
u
3
20 10 38.125 28.125 4 24.0625 by SFPF
1
u4 20 40 24.0625 44.0625 4 32.0313 by SFPF
II iteration :
2
u
1
60 40 24.0625 44.0625 4 42.0313 by SFPF
2
u
2
60 50 42.0313 32.0313 4 46.0157 by SFPF
2
u
3
20 10 42.0313 32.0313 4 26.0157 by SFPF
2
u4 20 40 26.0157 46.0157 4 33.0079 by SFPF
III iteration
3
u
1
60 40 46.0157 26.0157 4 43.0079 by SFPF
3
u 60 50 43.0079 33.0079 4 46.5040 by SFPF
.in
2
3
u
3
20 10 43.0079 33.0079 4 26.5040 by SFPF
ing
3
u4 20 40 46.5040 26.5040 4 33.252 by SFPF
CW (17) : Obtain a finite difference scheme to solve the Laplace equation
eer
2
solve u 0 at the pivotal points in the square mesh. Use
Liebmann’s iterative procedure.
1000 1000
gin
1000 1000
u1 u2
2000 500
u3 u4
En
2000 0
1000 500 0 0
arn
2
HW (18) : By iteration method, solve the Laplace equation u 0 over
the square region, satisfying the boundary conditions
u 0, y 0, 0 y 3, u 3, y 9 y, 0 y 3,
w.
u x, 0 3 x, 0 x 3, u x, 3 4 x, 0 x 3.
ww
0 17.0
Solution :
Find Rough Values [Initial values (or) Starting values] :
u5 0 17.0 21.0 12.1 4 12.5 by SFPF, ext. bound. vals. only
.in
u1 0 0 12.5 17.0 4 7.4 by DFPF
u3 12.5 18.6 17.0 1.0 4 17.3 by DFPF
ing
u7 12.5 0 0 12.1 4 6.2 by DFPF
u9 12.5 9.0 12.1 21.0 4 13.7 by DFPF
eer
u2 17.0 12.5 7.5 17.3 4 13.6 by SFPF
u4 7.4 6.2 0 12.5 4 6.5 by SFPF
gin
I iteration :
1
u 1 7.8 by SFPF u41 6.6 by SFPF u 7 6.6 by SFPF
Le
1
1
u
2
13.7 by SFPF u 51 11.9 by SFPF u81 11 by SFPF
w.
1
u
1
17.9 by SFPF u 61 16.1 by SFPF u9 14.3 by SFPF
3
ww
II iteration :
2 2
u
1
7.9 by SFPF u4 2 6.6 by SFPF u 7 6.6 by SFPF
2
u
2
13.7 by SFPF u 52 11.9 by SFPF u8 2 11.2 by SFPF
2
u
2
3
17.9 by SFPF u 62 16.3 by SFPF u9 14.3 by SFPF
III iteration : Same as II iteration values. So stop the procedure.
Therefore, the solution of the given Laplace equation is
u1 7.9, u2 13.7, u3 17.9, u4 6.6, u5 11.9,
u6 16.3, u7 6.6, u8 11.2, u9 14.3
CW (20) : Solve
2 2
u u 1
2
2 0, x 1, y 1 with h and u x, 1 x 2 ,
x y 2
u 1, y y 2 .
Solution : u1 0.9, u2 0.13, u3 0.19, u4 0.13, u5 0.13,
u6 0.13, u7 0.19, u8 0.13, u9 0.19
2u 2u
2
0, 0 x, y 1 with u 0, y 10 u 1, y and
HW (21) : Solve x y 2
.in
u x, 0 20 u x,1 . Take h 0.25 and apply Liebmann’s
ing
method to 3 decimal places.
Solution : u1 14.999, u2 16.249, u3 14.999, u4 13.749, u5 14.999,
u6 13.749, u7 14.999, u8 16.249, u9 14.999
eer
HW (22) : Solve the Laplace equation at the interior poins of the square
region given below.
1000 1000 1000
gin
500 500
u1 u2 u3
0 0
u4 u5 u6
En
0 0
u7 u8 u9
arn
0 0
0 0
0 0 0
Le
Solution :
Standard five – point formula(SFPF) for Poisson equation :
ui 1, j ui 1, j ui , j 1 ui , j 1 4ui , j h 2 f ih, jh
.in
10 ih jh 10
2 2
ing
2
10 i j 102 ∵ h 1
At A i 1, j 2 :
eer
u0,2 u2,2 u1,1 u1,3 4u1,2 10 12 22 10 150
gin
At B i 2, j 2 :
u1 0 u4 0 4u2 180
u2 180 u1 u4 / 4
Le
u4 150 u2 u3 / 4
Here u1 u4 , u2 , u3 .
Use any method to find u1 , u2 , u3 , u4 .
Now we are going to use Gauss – Seidel method:
Initially find u1 by putting u2 u3 0
Iterations becomes
.in
2
CW (24) : Solve the Poisson equation u 81xy, 0 x 1, 0 y 1,
given that
ing
1
u 0, y 0, u x, 0 0, u 1, y 100, u x,1 100 & h .
3
eer
Solution : u1 u 4 51.0, u 2 76.5, u 3 25.8
2 2 2 u0
HW (25) : Solve u 8 x y in the square mesh given
gin
on the four
boundaries dividing the square into 16 sub squares of length 1
unit.
En
Solution : u1 u3 u7 u9 3, u2 u4 u6 u8 2
PART – A
arn
1. Write down the explicit finite difference method for solving one
dimensional wave equation.
Solution : The formula to solve numerically the wave equation
Le
a 2u xx utt 0 is
w.
ui , j 1 2 1 2 a 2 ui , j 2 a 2 ui 1, j ui 1, j ui , j 1
2. Write down the standard five point formula to find the numerical
ww
.in
5.
Solution : Given u xx 2u xy 4u yy 0, x, y 0.
ing
Here A 1, B 2, C 4
B 2 4 AC 12 0
The given equation is elliptic.
eer
6. In one dimensional wave equation, write down the equation of explicit
scheme.
gin
Solution : The general form of the difference equation to solve the equation
utt a 2u xx is
ui , j 1 2 1 2 a 2 ui , j 2 a 2 ui 1, j ui 1, j ui , j 1 1
En
Here A 1, B 0, C x
B 2 4 AC 4 x
ww
.in
1. Compute for 4 time steps : ut u xx :
ing
0 x 1, t 0 u ( x, 0) 100sin x, u (0, t ) u (1, t ) choose h 1/ 4
u 2u
Solve the initial boundary value problem : ,
t x 2
eer
2.
x
u ( x, 0) cos , 1 x 1, t 0 , u (1, t ) u (1, t ) 0 for t 0
2
gin
u 2u
arn
6
u u 0 x 1, t 0 ;
2 2
w.
Solve 2 2 :
5. t x
ww
6. Solve the Laplace equation over the square mesh of side 4 units,
satisfying the boundary conditions:
u(0, y) = 0, 0 ≤ y ≤ 4 ; u(4, y) = 12 + y , 0 ≤ y ≤ 4 ;
u(x, 0) = 3x, 0 ≤ x ≤ 4 ; u(x, 4) = x2 , 0 ≤ x ≤ 4.
7. Obtain the values at the interior points for the harmonic function
satisfying the following boundary conditions (4 iterations) after
deriving a suitable numerical scheme.
10 20 30
0 u4 u5 u6 50
0 u7 u8 u9 60
0 70
50 60 70
0 80
.in
8.
over a square with sides x = 0, y = 0, x = 3, y = 3, with the boundary
conditions u = 0 on all the boundary sides taking the mesh size h = 1.
ing
eer
gin
En
arn
Le
w.
ww