You are on page 1of 70

www.Vidyarthiplus.

com
www.Vidyarthiplus.in

At the point x x0 ,
1 2 3 11 4
f ' ' x0 y0 y0 y0 ...
h2 12
Here x0=1.5, h=0.5
1
f ' ' 1.5 2
3.0 0.75
0.5
f ' ' 1.5 9.0
At the point x x0 ,
1 3 3 4
f ' ' ' x0 y0 y0 1
h3 2 f ' ' ' 1.5 0.75 6.0
3
0.5
f ' ' ' 1.5 6.0
------------------------------------------------------------------------------------------------------------2.
Compute f’(0) and f’’(4) from the data
x 0 1 2 3 4
y 1 2.718 7.381 20.086 54.598
Solution:
2 3 4
x y=f(x) y y y y

0x0 1y0

1.718 y0

2
1 2.945 y0
2.718
3
4.663 5.097 y0

4
2 8.042 8.668 y0
7.381
3 4
12.705 13.765 yn yn

2
3 21.807 yn
20.086

34.512 yn

4
54.598
xn yn

Here we have to find f’(0) .ie.x=0 which is the starting of the given table. So we use the
forward interpolation formula.

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1 1 2 1 3 1 4
f ' x0 y0 y0 y0 y0 ...
h 2 3 4
1 1 1 1
f' 0 1.718 2.945 5.097 8.668 0.2225
1 2 3 4
Here we have to find f”(4) .ie.x=4 which is the end of the given table. So we use the
backward interpolation formula.
1 2 3 11 4
f ' ' xn 2
yn yn yn ...
h 12
1 11
f '' 4 2
21 .807 13 .765 8.668 43 .5177
1 12
------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

dy d2y
2. Find and 2 at x = 51 from the following data.
dx dx
x 50 60 70 80 90
y 19.96 36.65 58.81 77.21 94.61
Solution:
Here h=10. To find the derivatives of y at x=51 we use Forward difference formula
taking the origin at x0=50.
x x0 51 50
We have r 0.1
h 10
at x=51, r=0.1
dy dy 1 2r 1 2 3r 2 6r 2 3 2r 3 9r 2 11r 3 4
= y0 y0 y0 y0 ...
dx x 51 dx r 0 .1 h 2 6 12

The difference table is given by

x y=f(x) y 2
y 3
y 4
y

50x 19.96y
0 0

16.69 y0

60 36.65 5.47
2
y0

22.1 -9.23
6 3
y0

70 58.81 -3.76 11.09


4
y0

18.4 2.76
0

80 77.21 -1.00

17.4
0

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

90 94.61

dy dy
=1 0.2 1 3(0.1) 2 6(0.1) 2 2(0.1)3 9(0.1) 2 11(0.1) 3
dx dx 16.69 (5.47) 9.23 11.99
x 51 r 0 .1 10 2 6 12
=1 16.69 2.188 2.1998 1.9863 1.0316
10
d2y d2y 1 2 3 6r 2 18r 11 4
y0 r 1 y0 y0 ...
dx 2 x 51
dx 2 r 0.1
h2 12
d2y d2y 1 6(0.1)2 18(0.1) 11
5.47 0.1 1 ( 9.23) (11.99)
dx 2 x 51
dx 2 r 0.1
100 12
1
=
5.47 8.307 9.2523 0.2303
100
------------------------------------------------------------------------------------------------------------
3. Find the maximum and minimum value of y tabulated below.
x -2 -1 0 1 2 3 4
y 2 - 0 - 2 15.75 56
0.25 0.25
Solution:
dy 1 2r 1 2 3r 2 6r 2 3 2r 3 9r 2 11r 3 4
y0 y0 y0 y0 ...
dx h 2 6 12
x y=f(x) y 2
y 3
y 4
y 5
y
-2 2
-2.25
-1 -0.25 2.5
0.25 -3
0 0 -0.5 6
-0.25 3 0
1 -0.25 2.5 6
2.25 9 0
2 2 11.5 6
13.75 15
3 15.75 26.5
40.25
4 56
Choosing x0=0, r = x 1 0 x
dy 1 2x 1 3x 2 6 x 2 2 x3 9 x 2 11x 3
0.25 (2.5) (9) (6)
dx 1 2 6 12

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
0.25 2.5 x 1.25 4.5 x 2 9 x 3 x3 4.5x 2 5.5 x 1.5
1
dy
x3 x
dx
dy
Now 0 x3 x 0
dx
x = 0, x = 1, x = -1.
2
d y
3x 2 1
dx 2
d2y d2y d2y
at x=0 ve at x=1 ve at x=-1 ve
dx 2 dx 2 dx 2
y is maximum at x=0, minimum at x=1 and -1
x( x 1) 2
y ( x) y0 x y0 y0 ...
2!
Maximum value =y(0) =0, Minimum value =y(1)=-0.25.
------------------------------------------------------------------------------------------------------------
4. Consider the following table of data
x 0.2 0.4 0.6 0.8 1.0
f(x) 0.9798652 0.9177710 0.8080348 0.6386093 0.3843735
Find f’(0.25),f’(0.6) and f’(0.95).
Solution:
Here h=0.2
 0.25 is nearer to the starting of the given table. So we use Newton’s forward
interpolation formula to evaluate f’(0.25)
 0.95 is nearer to the ending of the given table. So we use Newton’s backward
interpolation formula to evaluate f’(0.95)
 0.6 is middle point of the given table. So we use Central Difference formula to
evaluate f’(0.6)
The difference table
x y=f(x) y 2
y 3
y 4
y
0.2x0 0.9798652y0
-0.0620942
y0
0.4 0.9177710 0.047642 2
y0
-0.1097362 -0.0120473 3
y0
0.6 0.8080348 -0.0596893 4
y0
-
0.01310985
4
yn
-0.1694255 -

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

3
0.02515715 yn
0.8 0.6386093 -
2
0.08484645 yn
-
0.25427195 yn
1.0 0.3843735
xn yn

To find f’(0.25)
Newton’s forward interpolation formula for derivative
2r 1 2 3r 2 6r 2 3 2r 3 9r 2 11r 3 4
hf ' x0 rh y0 y0 y0 y0 ...
2 6 12

2(0.25) 1
- 0.0620942 ( 0.047642)
2
1 3(0.25) 2 6(0.25) 2
f ' 0.25 0.0120473
0.2 6
2(0.25) 3 9(0.25) 2 11(0.25) 3
( 0.01310985)
12

=-0.2536(correct to four decimal places)


To find f’(0.95)
x y=f(x) y 2
y 3
y 4
y
0.2x0 0.9798652(y-2)

-0.0620942 y 2
0.4 0.9177710 (y-1) 2
0.047642 y 2
3
-0.1097362 y1 -0.0120473 y 2
0.6 0.8080348 (y0) 2 4
-0.0596893 y1 y 2
-0.01310985

3
-0.1694255 y0 -0.02515715 y1
0.8 0.6386093(y1) 2
-0.08484645 y0
-0.25427195 y1
1.0 0.3843735(y2)

Newton’s backward interpolation formula for derivative

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1 2r 1 2r 2 6r 2 2r 3 6r 2 11r 3
f ' xn rh yn 2
yn 3
yn 4
yn ...
h 2 6 12
x xn 0.95 1
r 0.25
h 0.2
2( 0.25) 1
- 0.25427195 ( 0.08484645)
2
1 3( 0.25) 2 6( 0.25) 2
f ' 0.95 0.02515715
0.2 6
2( 0.25)3 9( 0.25) 2 11( 0.25) 3
( 0.01310985)
12
f’(0.95) =-1.71604
To find f’(0.6)
Central Difference formula (Stirling’s Formula)
1 y0 y 1 2 3r 2 1 3 3 2r 3 r 4 5r 4 15r 2 4 5 5
f ' x0 rh r y 1 y 1 y 2 y 2 y 2 y 3 ...
h 2 12 12 5!
0.1694255 0.1097362
(0.2)( 0.00596893)
1 2
f ' 0.6
0.2 3(0.2) 2 1 2(0.2) 3 0.2
0.02515715 0.0120473 ( 0.01310985)...
12 12
f’(0.6)=-0.74295(correct to 5 decimal places)
------------------------------------------------------------------------------------------------------------
5. Given the following data, find y’(6), y’(5) and the maximum value of y
x 0 2 3 4 7 9
y 4 26 58 112 466 922
Solution:
Since the intervals are , we will use Newton’s divided difference formula.
Divided Difference Table
x y=f(x) f (x) 2
f ( x) 3
f ( x) 4
f ( x)
0 4
11=f(x0,x1)
2 26 7= f(x0,x1,x2)
32 1= f(x0,x1,x2,x3)
3 58 11 0= f(x0,x1,x2,x3, x4)
54 1
4 112 16 0
118 1
7 466 22
228
9 922

By Newton’s Divided Difference formula,


y =f(x)=f(x0)+(x-x0)f(x0, x1)+ (x-x0) (x-x1)f(x0, x1,x2)+……….
=4+(x-0)11+(x-0)(x-2)7+(x-0)(x-2)(x-3)1
3 2
=x +2x +3x+4

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Therefore, f’(x) = 3x2+4x+3


f'(6)=135
f’(5)=98.
------------------------------------------------------------------------------------------------------------------
Numerical Integration

 Single integral
 Trapezoidal
 Simpson’s one-third rule
 Simpson’s three-eighth rule
 Romberg method
 Two and Three point Gaussian Quadrature Formulas

 Double integral
 Trapezoidal rule
 Simpson’s Rule

Single Integral

Trapezoidal Rule
xn
h
f ( x)dx sum of the first and last ordinates 2 sum of the remaining ordinates
x0
2
xn
h
ie, f ( x)dx y0 yn 2 y1 y2 ... yn 1
x0
2

Simpson’s one third rule


xn
h sum of the first and last ordinates 2 sum of the remaining odd ordinates
f ( x)dx
x0
3 4 sum of the remaining even ordinates
xn
h
ie, f ( x)dx y0 yn 2 y1 y3 ... yn 1 4 y2 y4 ... yn 2
x0
2

Simpson’s three eight rule


xn
sum of the first and last ordinates
3h
f ( x)dx 3 sum of the remaining ordinates which are not divisibleby 3
x0
8
2 sum of the remaining ordinates which are divisibleby 3
xn
h
f ( x)dx y0 yn 3 y1 y2 y4 y5 ... yn 1 2 y3 y6 ... yn 3
x0
2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Rule Degree of y(x) No.of intervals Error Order

Trapezoidal Rule One Any (b a )h 2 M h2


E
12

Simpson’s one third rule Two Even (b a )h 4 M h4


E
180

Simpson’s three eight three Multiple of 3 3h 5 h5


rule E
8

Two and Three point Gaussian Quadrature Formulas


Gaussian Two point formula
1
1 1
 If the Limit of the integral is -1 to 1 then we apply f ( x)dx f f . This
1 3 3
formula is exact for polynomials upto degree 3.
b
b a b a b a
 If f ( x)dx then x= t and dx = using these conditions convert
a
2 2 2
b 1 1
1 1
f ( x)dx into f (t )dt and then we apply the formula f (t )dt f f
a 1 1 3 3

Gaussian Three point formula


 If the Limit of the integral is -1 to 1 then we apply
1
5 3 3 8
f ( x)dx f f f (0) . This formula is exact for polynomials upto
1
9 5 5 9
degree 5.
b
b a b a b a
 Otherwise f ( x)dx then x= t and dx = using these conditions
a
2 2 2
b 1
convert f ( x)dx into f (t )dt and then we apply the formula
a 1

1
5 3 3 8
f (t )dt f f f (0)
1
9 5 5 9

Problems based on single integrals


2
1. Using Trapezoidal rule evaluate sin x dx
0

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Solution
x 0 15 30 45 60 75 90

y 0 0.5087 0.7071 0.8408 0.9306 0.9828 1

Trapezoidal rule
xn
h
f ( x)dx y0 yn 2 y1 y2 ... yn 1
x0
2

2
sin x dx 12 (0 1) 2(0.5087 0.7071 0.8408 0.9306 0.9828 )
0
2
= 1.17024
------------------------------------------------------------------------------------------------------------

2. By dividing the range into ten equal parts, evaluate sin xdx by Trapezoidal rule and
0

Simpson’s Rule. Verify your answer with integration


Solution:
Range = π-0=π. Hence h=
10
we tabulate below the values of y at different x’s
x 0 2 3 4 5 6 7 8 9
10 10 10 10 10 10 10 10 10

sinx 0 .309 .5878 .809 .9511 1 .9511 .809 .5878 .309 0

Trapezoidal rule
xn
h
f ( x)dx y0 yn 2 y1 y2 ... yn 1
x0
2

2
sin xdx 10 (0 0) 2(0.3090 0.5878 0.8090 0.9306 0.9511 1 0.9511 0.9306 0.8090 0.3090 )
0
2

= 1.9843 nearly
Simpson’s one third Rule:
we use Simpson’s one third rule only when the no.of intervals is even
here the no of intervals =10(even)
xn
h
f ( x)dx y0 yn 2 y1 y3 ... yn 1 4 y2 y4 ... yn 2
x0
2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

2
sin xdx 10 (0 0) 2(0.9511 0.5878 0.9306 0.9511 0.9306 ) 4(0.3090 0.8090 1 0.8090 0.3090 )
0
2

= 2.00091 nearly
We use Simpson’s three eight rule only when the no.of intervals divisible by 3
Here the no of intervals =10 which is not divisible by 3.
So we cannot use this method.
By actual integration,

sin xdx cos x 0 2


0

Hence, Simpson’s one third rule is more accurate than the Trapezoidal rule.
-------------------------------------------------------------------------------------------------------------------
-
1 1
3. Evaluate (i) (3x 2
5 x )dx and (ii) (3x 2
4
5 x 4 )dx by Gaussian two and three point
1 0

formulas
Solution:
1
(i) (3x 2 5 x 4 )dx
1
Gaussian two point formula
Given interval is -1 and 1.
Hence we can apply
1
1 1
f ( x)dx f f
1 3 3
1 2 4 2 4
2 4 1 1 1 1
(3x 5x )dx 3 5 3 5 =3.112
1 3 3 3 3
Gaussian two point formula
Given interval is -1 and 1.
Hence we can apply
1
5 3 3 8
f ( x)dx f f f (0)
1
9 5 5 9
2 4 2 4
1
2 4 5 3 3 3 3 8
(3x 5 x )dx 3 5 3 5 (0)
1
9 5 5 5 5 9

5 3 9 3 9
= 3 5 3 5
9 5 25 5 25
1
(3x 2 5 x 4 )dx = 4
1

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
(ii) (3x 2 5 x 4 )dx
0
Gaussian two point formula
Here the interval is 0 to 1. So we use the formula
b a b a b a
x= t and dx = dt
2 2 2
t 1 dt
i.e, x and dx=
2 2
1 2 4
t 1 t 1
3 5 dt 1.556
1
2 2
Gaussian two point formula
Here the interval is 0 to 1. So we use the formula
b a b a b a t 1 dt
x= t and dx = dt i.e, x and dx=
2 2 2 2 2
1 2 4 1 2 4
t 1 t 1 dt 1 t 1 t 1
3 5 3 5 dt
1
2 2 2 2 1
2 2
2 4
t 1 t 1
f (t ) 3 5
2 2
1
5 3 3 8
f (t )dt f f f (0)
1
9 5 5 9
2 4
3 0.7745 1 0.7745 1
f 3 5 0.038138
5 2 2
2 4
3 0.7745 1 0.7745 1
f 3 5 4.28
5 2 2
2 4
0 1 0 1
f (0) 3 5 1.0625
2 2
1 2 4
t 1 t 1 5 8
3 5 dt 0.038138 4.28 (1.0625 )
1
2 2 9 9

= 4(approximately)
1 2 4
1 t 1 t 1 4
3 5 dt 2
2 1
2 2 2

------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Double Integral
Trapezoidal Rule
d b
Evaluate f ( x, y )dxdy where a, b, c, d are constants.
c a
D K L C

J M N H

I O P G

A E F B

hk
I= [sum of values in]+2(sum of values in +4[sum of remaining values]
4
Simpson’s Rule
sum of the values of f at four corners
2(sum of the values of f at the odd positions on the
boundaryexcept thecorners)
4(sum of the values of f at the even positions on the boundary)
hk {4(sum of the values of f at the odd positions)
I
9 8(sum of the values of f at the even positions)
on the odd row f of the matrix except boundary rows}
{8(sum of the values of f at the odd positions)
16(sum of the values of f at the even positions)
on the even row f of the matrix }

Problems based on Double integrals


1.4
1
1. Evaluate dxdy using Trapezoidal and Simpson’s rule. Verify your result by actual
1 22.4
xy
integration.
Solution:
Divide the range of x and y into 4 equal parts
2. 4 2
h 0.1
4
1 .4 1
k 0.1
4
1
Get the values of f(x, y) = at nodal points
xy

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

y\x 2 2.1 2.2 2.3 2.4

1 0.5 0.4762 0.4545 0.4348 0.4167

1.1 0.4545 0.4329 0.4132 0.3953 0.3788

1.2 0.4167 0.3968 0.3788 0.3623 0.3472

1.3 0.3846 0.3663 0.3497 0.3344 0.3205

1.4 0.3571 0.3401 0.3247 0.3106 0.2976

(i) Trapezoidal Rule

0.4545 0.4167 0.3846 0.4762 0.4545


(0.1)(0.1) 0.5 0.4167 0.3571 0.2976 2 0.4348 0.3788 0.3472 0.3205 0.3106
I
4 0.3247 0.3401
4 0.4329 0.4132 0.3953 0.3968 0.3788 0.3623 0.3663 0.3497 0.3344

I=0.0614
(ii) Simpson’s Rule:

0.5 0.4167 0.3571 0.2976 2(0.4167 0.4545 0.3472 0.3247)


(0.1)(0.1) 4(0.3846 0.4545 0.4762 0.4348 0.3788 0.3205 0.3106
I
9 0.3401 0.3788) 8(0.3968 0.3623 0.3497 0.4132)
16(0.3663 0.3344 0.4329 0.3953)

0.01(55.2116)
I=
9
I=0.0613
------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

UNIT IV
INITIAL VALUE PROBLEMS FOR
ORDINARY DIFFERENTIAL EQUATIONS
Taylor series method

Euler methods

Runge-Kutta method for solving first and second order equations

Milne’spredictor and corrector method

Adam’s predictor and corrector method.

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Introduction
An ordinary differential equation of order n is a relation of the form
dry
F x, y, y ' , y" ,..., y n 0 where y y x and y r . The solution of this differential
dx r
equation involves n constants and these constants are determined with the help of n conditions
y, y ' , y" ,..., y n 1 are prescribed at x x0 , by
y x0 y0 , y ' x0 y0' ,... y n 1
x0 y0n 1

These conditions are called the initial conditions because they depend only on x 0 .
The differential equation together with the initial conditions is called an initial value problem.
Taylor’s Series
Point wise solution
If y x is the solution of (1), then by Tailor series,
2 3
x x0 ' x x0 x x0
y x y0 y0 y0" y0"' ...
1! 2! 3!
Put x1 x0 h where h is the step-size, we have
h ' h 2 " h 3 '"
y x1 y1 y0
y0 y0 y0 ... (3)
1! 2! 3!
once y1 has been calculated form (1), y1' , y1" , y1'" can be calculated from
y' f x, y
Expanding y x in a Taylor series about x x1 , we get
h 2 " h3 '"
h '
y2 y1 y1 y1 y1 ...
1! 2! 3!
Where y2 y x2 and x2 x1 h
The Tailor algorithm is given as follows
h ' h 2 " h 3 '"
ym 1 ym ym ym ym ...
1! 2! 3!
dry
Where ymr at the point xm , ym where m 0,1,2,...
dx r
Problems based on Taylor’s Series
Solve y ' y 2 x; y 0 1 using Taylor series method and compute y 0.1 and y 0.2
Solution
Here x0 0, y0 1 .
Given y ' y 2 x ; y0' 1
"
y" 2 yy' 1 ; y 0 3
y" ' 2 yy" 2 y '2 ; y0"' 8
y iv 6 y" 2 yy" ' ; y0iv 34 etc.,
To find

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Here h 0.1
By Taylor algorithm
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
0.01 0.001 0.001
y1 1 0.1 1 3 8 34
2 6 24
y 0.1 1.1164
To find y 0.2
x2 x1 h where x2 0.2
h ' h " h 3 '" 2
y2 y1 y1 y1 y1 ...
1! 2! 3!
2
y1' 0.1 1.1164 1.3463
y1" 1 2 1.1164 1.3463 4.006
"' 2
y1 2 1.1164 4.006 2 1.3463
= 12.5696
0.01 0.0001
y 0.2 1.1164 0.1 1.3463 4.006 12.5696
2 6
y 0.2 1.2732
----------------------------------------------------------------------------------------------------------
2. Evaluate y 0.1 and y 0.2 , correct to four decimal places by Taylor series method, if y x
satisfies y ' xy 1, y 0 1
Solution
Here x0 0, y0 1
y' xy 1 ; y0' 1
y" xy' y ; y0" 1
y" ' xy" 2 y ' ; y0" 2
iv iv
y xy ' " 3 y" ; y 0 3
To find y 0.1
By Taylor algorithm
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
Let x1 x0 h where h 0.1
x1 0.1
0.01 0.001 0.0001
y1 1 0.1 1 2 3
2 3 24
= 1.1057
To find y 0.2
Let y2 y x2 where x2 x1 h

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

x2 0.2
By Taylor algorithm,
h ' h 2 " h 3 '"
y2 y1 y1 y1 y1 ...
1! 2! 3!
y1' 1 0.1 1.1057 1.11057
y1" 0.1 1.11057 1.1057 1.216757
"'
y1 0.1 1.216757 2 1.11057 2.3428157
0.01 0.0001
y2 1.1057 0.1 111057 1.216757 2.342815
2 6
y2 1.2178
Hence y 0.1 1.1057 and y 0.2 1.2178 .
--------------------------------------------------------------------------------------------------------
3.Solve by Taylor series method, y ' xy y 2 , y 0 1 at x 0.1 and 0.2, , correct to four decimal
places.
Solution
Given x0 0, y0 1
y ' xy y2 ; y0' 1
"
y" y xy' 2 yy' ; y 0 3
2
y" ' 2 y' xy" 2 y ' 2 yy" ; y0" 10
y iv 3 y" xy" 6 y ' y" 2 yy" ' ; y0iv 47
To find y1 y 0.1
Let x1 x0 h . Here h 0.1
x1 x0 h x1 0.1
By Taylor algorithm
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
0.01 0.001 0.0001
y1 1 0.1 1 3 10 47
2 6 24
1.1 0.015 0.0017 0.0002
y 0.1 1.1169
To find y 0.2
y2 y x2 where x2 x1 h
Here x1 0.1, h 0.1, x2 0.02
By Taylor algorithm,
h ' h2 " h 3 '"
y2 y1 y1 y1 y1 ...
1! 2! 3!
x1 0.1, y1 1.1169
y1' x1 y1 y12 y1' 1.35925

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

y1" y1 x1 y1' 2 y1 y1' y1' 1.35925

1.1169 0.1 1.35925 2 1.1169 1.35925


4.2891
2
y1"' 2 y1' x1 y1" 2 y1' 2 y1 y1"
2.7185 0.42891 3.6951 6.5810
16.4235
y1iv 3 y1" x1 y1"' 6 y1 y1" 2 y1 y1"'
212.8673 1.64235 34.9797 36.6868
86.17615
0.01 0.001 0.0001
y2 1.1169 0.1 1.35925 4.2891 16.4235 86.17615
2 6 24
1.1169 0.135925 0.02144 0.00274 0.00036
y 0.2 1.2774
Hence y 0.1 1.1169 and y 0.2 1.2774 .
------------------------------------------------------------------------------------------------------------
Taylor series method for simultaneous first order differential equation
dy dy
We can solve the equations of the form f x, y , z ; g x, y, z with initial
dx dx
conditions y x0 y0 and z x0 z0 .
The values of y and z at x1 x0 h are given by Taylor algorithm,
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
h ' h 2 " h 3 '"
z1 z0 z0 z0 z0 ...
1! 2! 3!
The derivatives on R.H.S of the above expressions are found at x x0 using the given
equations.
Similarly y 2 and z2 corresponding to x2 x1 h are calculated by Taylor series method.
Problems
dx dy
1.Evaluate x 0.1 and y 0.1 given 1 ty; tx given x 0, y 1 at t 0 by Taylor
dt dt
series method.
Solution
Given t0 0, x0 0, y0 1
x' 1 ty y' tx
x" y ty' y" x tx'
x'" 2 y' ty" y" ' 2 x' tx"
x iv 3 y" ty" ' y iv 3x" tx" '
Then
x0' 1 y0' 0

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

x 0" 1 y 0" 0
"' "'
x 0 0 y 0 2
iv iv
x 0 0 y 0 3
By Taylor algorithm, we have
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
0.01 0.001 0.0001
y 0.1 1 0.1 0 0 2 3
2 6 24
y 0.1 0.9997
h ' h2 " h 3 '"
x 0.1 x1 x0 x0 x0 x0 ...
1! 2! 3!
0.01
0 0.1 1 1 .....
2
0.105
------------------------------------------------------------------------------------------------------------
dx dy
2. Find x 0.2 and y 0.2 using Taylor series method given that xy 2t; 2ty x , with
dt dt
initial conditions x 1, y 1 at t 0 .
Solution
Given t 0 0, x0 1, y0 1
Taking h 0.2, t1 t0 h t1 0.2
x' xy 2t y' 2ty x
x" xy' x' y 2 y" 2ty' 2 y x'
x'" xy" 2 x' y x" y y"' 4 y' 2ty" x"
x0' 1 y 0' 1
" "
x 0 4 y 0 3
"' '
x 0 9 y 0 8
By Taylor algorithm, we have
h ' h 2 " h 3 '"
x1 x0 x0 x0 x0 ...
1! 2! 3!
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
2 3 3
x 0.2 1 0.2 1 2 0.2 0.2 ...
2
x 0.2 0.796
4
y1 y 0.2 1 0.2 1.5 0.04 0.008
3
0.8493
Hence x 0.2 0.796 and y 0.2 0.8493
------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Taylor series method for second order differential equations


d2y dy
Consider the differential equation 2
f x, y , with the initial conditions y x0 y0
dx dx
and y ' x0 y0' , where y0 , y0' are known values.
This equation can be reduced into a set of simultaneous equations, by putting y' p
we have y ' p, y x0 y0 (1)
'
And p ' f x, y, p , p x0 p0 y 0 (2)
Successively differentiating y" , the expression for y" ' , y iv etc., are known.
By Taylor series method, we find
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
h 2 " h 3 '"
y0 hp0 p0 p0 ...
2! 3!
Also by Taylor series method, we have
h ' h 2 " h 3 '"
p1 y1' p0 p0 p0 p0 ...
1! 2! 3!
Then the values y1" , y1"' , y1iv are found from y1" , y1"' etc
h ' h 2 " h 3 '"
y2 y1
y1 y1 y1 ...
1! 2! 3!
Thus we calculate y1 , y2 ,...
Problems
1.Find y 0.2 and 0.4 given y" xy if y 0 1, y ' 0 1 by Taylor series method.
Solution
Given y" xy, x0 0, y0 1 and y' 0 1
Then we have
y" ' xy' y
y iv xy" 2 y '
y v 3 y" xy" ' etc
y0" 0, y0"' 1, y0iv 2, y0v 0
By Taylor Algorithm,
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
Taking, h 0.2, x1 x0 h x1 0.2
0.04 0.008 0.0016
y1 y x1 1 0.2 1 0 1 2
2 6 24
y 0.2 1.2014
To find y1'

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Set p y' . Then p' xy


p" xy' y; p" ' xy" 2 y ' ; p iv 3 y" xy" '
' " '" iv
p0 1, p 0 0, p 0 1, p 0 2, p 0 0
By Taylor Algorithm,
h ' h 2 " h 3 '"
p1 p0 p0 p0 p0 ...
1! 2! 3!
0.04 0.08
p1 1 0.2 0 1 2
2 6
y1' 1 0.02 0.0027
1.0227
Let x2 x1 h . Since h 0.2, x1 0.2 x2 0.4
By Taylor series method,
h ' h 2 " h 3 '"
y x2 y 0.4 y1 y1 y1 y1 ...
1! 2! 3!
y" xy y1" x1 y1 0.2 1.2014 0.24028
y" ' xy' y y1'" 0.2 1.0227 1.2014 1.40594
y iv 2 y ' xy" y1iv 0.2 0.024028 2 1.0227 0.00048 2.0454 2.0459
0.04 0.008 0.0016
y2 1.2014 0.2 1.0227 0.024028 1.40594 2.0459
2 6 24
y 0.4 1.4084
Hence y 0.2 1.2014 and y 0.4 1.4084
------------------------------------------------------------------------------------------------------------
2.Find y at x 1.1,1.2 given y" x 3 y 2 y ' , y 1 and y' 1 1 , correct to four decimal places
using Taylor series method.
Solution
Given x0 1, y0 1; y0' 1
y" x 3 y 2 y' y0" 0
2 2
y"' 3x 2 y y' y 2 y" y0" 1
y iv 6 x 2 y 3 4 yy' y" 2 yy' y" y 2 y" '
y0iv 6 2 0 0 1 3
'
y 0 0, y0" 0, y0"' 1, y0iv 3
By Taylor series method,
h ' h 2 " h 3 '"
y1 y0 y0 y0 y0 ...
1! 2! 3!
Taking, h 0.1, x0 1, x1 x0 h 0.1
We have
0.01 0.001 0.0001
y 1.1 1 0.1 1 0 1 3
2 6 24
y 1.1 1.1002

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

To find y1'
Set p y' . Then p ' x 3 y 2 y ' , p0 y0' 1
1 " "'
p 0 1 1 0, p 0 1, p 0 3 etc.,
h " h 3 '"
h ' 2
p1 p0 p0
p0 p0 ...
1!
2! 3!
0.01 0.01
p1 1 0.1 0 1 2
2 6
p1 1.0053 y1' 1.0053
3 2
y" x 3 y 2 y' y1" 1. 1 1.1002 1.0053
0.11415
2 3 2 2
y" ' 3 xy 2 2 y y' y 2 y" y1"' 3 1.1 2 1.1002 1.0053 1.1002 0.11415
1.268
By Taylor Algorithm,
h ' h 2 " h 3 '"
y2 y1 y1 y1 y1 ...
1! 2! 3!
Where y2 y x2 , x2 1.2
0.01 0.01
1.1002 0.1 1.0053 0.11415 1.268
2 6
y 1.2 1.2015
Hence y 1.1 1.1002 and y 1.2 1.2015
------------------------------------------------------------------------------------------------------------
Euler method
Let y1 y xi , where x1 x0 h
Then y1 y x0 h . Then by Taylor’s series,
h h2
y1 y x0 y ' x0 y" x0 ..... (1)
1! 2!
Neglecting the terms with h 2 and higher powers of h, we get from (1),
y1 y0 hf x0 , y0 (2)
Expression (2) gives an approximate value of y at x1 x0 h.
Similarly, we get y2 y1 hf x1 , y1 for x2 x1 h .
for any m, ym 1 ym hf xm , ym , m 0,1,2,... (3)
In Euler’s method, we use (3) to compute successively y1 , y2 ,... etc., with an Error 0 h 2
Modified Euler method
The algorithm presented already in Modified Euler method in unit IV is sometimes
referred as Improved Euler Method.
Therefore a different algorithm for Modified Euler method to solve
dy
f x, y , y x0 y0 is explained with illustrations.
dx

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Explanation: Modified Euler Method


h h
yx h yx j f x ,y f x, y
2 2
h h
(or) yn 1 yn h f xn
, yn f x, y
2 2
Where yn 1 y xn h and h is the step – size
Problems based on Euler’s Method
dy
1,Using Euler’s method, compute y in the range 0 x 0.5 , if y satisfies 3x y 2 , y 0 1.
dx
Solution
Here f x, y 3 x y 2 , x0 0, y0 1
By Euler’s, method
yn 1 yn hf xn , yn , n 0,1,2,...
Choosing h 0.1 , we compute the values of y using (1)
yn 1 yn hf xn , yn , n 0,1,2,...
2
y 0.1 y1 y0 hf x0 , y0 1 0.1 3 0 1
1.1
2
y 0.2 y2 y1 hf x1 , y1 1.1 0.1 0.3 1.1
1.251
2
y 0.3 y3 y2 hf x2 , y2 1.251 0.1 0.6 1.251
1.4675
2
y 0.4 y4 y3 hf x3 , y3 1.4675 0.1 0.9 1.4675
1.7728
2
y 0.5 y5 y4 hf x4 , y4 1.7728 0.1 1.2 1.7728
2.2071
------------------------------------------------------------------------------------------------------------
dy y x
2.Given , with y 1 for x 0 . Find y approximately for x 0.1 by Euler’s method in
dx y x
five steps.
Solution
Given y0 1, x0 0 , choosing h 0.002 ,
xi x0 ih, i 1,2,3,4,5
To find y1 , y2 , y3 , y4 and y 5 where yi y xi
y x
Here f x, y
y x
Using yn 1 yn hf xn , yn , n 0,1,2,...
We get

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1 0
y1 y0 hf x0 , y0 1 0.02
1 0
1.02
1.02 0.02
y2 y1 hf x1 , y1 1.02 0.02
1.02 0.02
1.0392
1.0392 0.04
y3 y2 hf x2 , y2 1.0392 0.02
1.0392 0.04
1.0577
1.0577 0.06
y4 y3 hf x3 , y3 1.0577 0.02
1.0577 0.06
1.0756
1.0756 0.08
y5 y4 hf x4 , y4 1.0756 0.02
1.0756 0.08
1.0928
Hence y 1.0928 and x 0.1
----------------------------------------------------------------------------------------------
3.Compute y at x 0.25 by Modified Euler method given y' 2 xy, y 0 1
Solution

Here f x, y 2 xy, x0 0, y0 1
Choose h 0.25, x1 x0 h 0.25
By Modified Euler method
h h
y1 y0 h f x0 , y0 f x0 , y0
2 2
f x0 , y0 2 0 1 0
h h
f x0 , y0 f x0 , y0 f 0.125 ,1 0.25
2 2
y1 1 0.25 0.25 1.0625
Hence y 0.25 1.0625 .
--------------------------------------------------------------------------------------------------
dy
4.Using Modified Euler method, find y 0.1 and y 0.2 given x2 y2 , y 0 1 .
dx
Solution
Here x0 0, y0 1, h 0.1
h 0.1
f x, y x 2 y 2 , y0 f x0 , y0 1 0 1 1.05
2 2
h h
y1 y0 hf x0 , y0 x0 , y0 1 0.1 f 0.05,1.05
2 2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

2 2
1 0.1 0.05 1.05 1.1105
y 0.1 1.1105
2 2
f x1 , y1 f 0.1,1.1105 0.1 1.1105 1.24321
h
y1 f x1 , y1 1.1105 0.05 1.24321 1.17266
2
h h
y2 y1 hf x1 , y1 f x1 , y1
2 2
1.1105 0.1 f 0.15,1.17266
2 2
1.1105 0.1 0.15 1.17266
y 0.2 y2 1.2503
y 0.2 1.2503
-----------------------------------------------------------------------------------------------------
Fourth-order Range-Kutta method
This method is commonly used for solving the initial value problem
dy
f x, y , y x0 y0
dx
Working Rule
The value of y1 y x1 where x1 x0 h where h is the step-size is obtained as follows.
We calculate successively.
k1 hf x0 , y0
h k1
k2 hf x0
, y0
2 2
h k2
k3 hf x0 , y0
2 2
k 4 hf x0 h, y0 k3
Finally compute the increment
1
y k1 2k2 2k3 k4
6
The approximate value of y1 is given by
1
y1 y0 y y1 y0 k1 2k2 2k3 k4
6
Error in R-K fourth order method 0 h 5
In general, the algorithm can be written as
1
ym 1 ym k1 2k2 2k3 k4 where
6
k1 hf xm , ym
h k1
k2 hf xm , ym
2 2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

h k2
k3 hf xm , ym
2 2
k 4 hf xm h, ym k3 where m 0,1,2,...
Runge-Kutta method for second order differential equations
d2y dy
Consider the second order differential equation 2
f x, y , with initial conditions
dx dx
y x0 y0 and y ' x0 y0' . This can be reduced to a system of simultaneous linear first order
dy
equations, by putting z . Then we have,
dx
dy
z with y x0 y0
dx
dz
f x, y, z , with z x0 y ' x0 y0'
dx
dy
i.e., g x, y, z , where g x, y, z z
dx
dz
and f x, y, z with initial conditions y x0 y0 and
dx
z x0 z0 where z 0 y 0'
Now, starting from x0 , y0 , z0 , the increments y and z in y and z are given by (h-step size)
k1 hg x0 , y0 , z0 l1 hf x0 , y0 , z0
h k1 l h k1 l
k2 hg x0 , y0 , z0 1 l2 hf x0 , y0 , z0 1
2 2 2 2 2 2
h k2 l h k2 l
k3 hg x0 , y0 , z0 2 l3 hf x0 , y0 , z0 2
2 2 2 2 2 2
k4 hg x0 h, y0 k3 , z0 l3 l4 hf x0 h, y0 k3 , z0 l3
1 1
y k1 2k2 2k3 k4 z l1 2l2 2l3 l4
6 6
Then for x1 x0 h , the values of y and z are y1 y0 y and z1 z0 z respectively.
By repeating the above algorithm the value of y at x2 x1 h can be found.
Problems based on RK Method
dy
1.The value of y at x 0.2 if y satisfies x 2 y x, y 0 1 taking h 0.1 using Runge-Kutta
dx
method of fourth order.
Solution
Here f x, y x 2 y x, x0 0, y0 1.
Let x1 x0 h , choosing h 0.1, x1 0.1.
Then by R-K fourth order method,
1
y1 y0 k1 2k2 2k3 k4
6

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

k1 hf x0 , y0 0.1 0 0 0
h k1
k2 hf x0 , y0 hf 0.05,1 0.00525
2 2
h k2
k3 hf x0 , y0 hf 0.05,1.0026 0.00525
2 2
k4 hf x0 h, y0 k3 hf 0.1,1.00525 0.0110050
1
y1 1 0 0.00525 0.00525 2 0.011005 1.0053
6
y 0.1 1.0053
To find y2 y x2 where x2 x1 h . Then x2 0.2
1
y2 y1 k1 2 k2 k3 k4
6
k1 hf x1 , y1 0.1 0.1 0.01 1.0053 0.0110
h k1 2
k2 hf x1 , y1 0.1 0.15 0.15 1.0108 0.01727
2 2
h k2 2
k3 hf x2 , y2 0.1 0.15 0.15 1.013935 0.01728
2 2
2
k4 hf x1 h, y1 k3 0.1 0.2 0.2 1.02258 0.02409
1
y2 1.0053 0.0110 2 0.01727 0.01728 0.02409 1.0227
6
y 0.2 1.0227
Hence y 0.2 1.0227 .
---------------------------------------------------------------------------------------------------
2. Apply Runge-Kutta method to find an approximate value of y for x = 0.2 in steps of 0.1 if
dy
x y 2 , y 0 1 , correct to four decimal places.
dx
Solution

Here f x, y x y 2 , x0 0, y0 1
We choose h 0.1
1
y1 yo k1 2k2 2k3 k4
6
k1 hf x0 , y0 0.1 0 12 0.1
h k1 2
k2 hf x0 , y0 0.1 0.05 1.05 0.1152
2 2
h k2 2
k3 hf x0 , y0 0.1 0.05 1.0576 0.1168
2 2
2
k4 hf x0 h, y0 k3 0.1 0.1 1.1168 0.1347

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
y1 1 0.1 2 0.1152 0.1168 0.1347
6
y1 1.1165
Hence y 0.1 1.1165 .
---------------------------------------------------------------------------------------------------
dy
3.Use Runge-Kutta method to find y when x=1.2 in steps of 0.1, given that x2 y 2 and
dx
y 1 1.5 .
Solution
2 2
Given f x, y x y , x0 1, y0 1.5
Let x1 x0 h , we choose h 0.1
1
y1 yo k1 2k2 2k3 k4
6
2
k1 hf x0 , y0 0.1 1 1.5 0.325
h k1 2 2
k 2 hf x0 , y0 0.1 1.05 1.6625 0.3866
2 2
h k2 2
k3 hf x0 , y0 0.1 1.05 2.8673 0.397
2 2
2 2
k4 hf x0 h, y0 k3 0.1 1.1 1.897 0.4809
1
y1 1.5 0.325 2 0.3866 0.397 0.4809 1.8955
6
y1 1.8955
To compute y 1.2 :
y2 y x2 where x2 x1 h 1.2 , since h 0.1
1
y2 y1 k1 2 k2 k3 k4
6
2 2
k1 hf x1 , y1 0.1 1.1 1.8955 0.4803
h k1 2 2
k2 hf x1 , y1 0.1 1.15 2.1356 0.5883
2 2
h k2 2
k3 hf x2 , y2 0.1 1.3225 2.1897 0.6117
2 2
k4 hf x1 h, y1 k3 0.1 1.44 6.286 0.7726
1
y2 1.8955 0.4803 2 0.5883 2 0.6117 0.7726 2.5043
6
Hence y 1.2 2.5043 .
---------------------------------------------------------------------------------------------------
dy dz
4.Solve the equation xz 1, xy for x = 0.3 and 0.6. Given that y 0, z 1 when x 0
dx dx

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Solution
Here f1 x, y, z 1 xz, x0 0, y0 0, z0 0 and h 0.3
To find y 0.3 and z 0.3
k1 hf x0 , y0 0.3 0 1 0.3
h k1
k2 hf x0 , y0 0.3 0.15 1 0.3450
2 2
h k2
k3 hf x0 , y0 0.3 0.15 0.9966 1 0.3448
2 2
k4 hf x0 h, y0 k3 0.3 0.3 0.99224 1 0.3893
l1 hf x0 , y0 , z0 0.3 0 0
h k1 l
l2 hf x0 , y0 , z0 1 0.3 0.15 0.15 0.00675
2 2 2
h k2 l
l3 hf x0 , y0 , z0 2 0.3 0.15 0.1725 0.00776
2 2 2
l4 hf x0 h, y0 k3 , z0 l3 0.3 0.3 0.3448 0.031036
1
y 0.3 y1 y0 k1 2k2 2k3 k4
6
1
0 0.3 2 0.3450 0.3448 0.3893
6
y 0.3 0.3448
1
z 0.3 z1 z0 l1 2l2 2l3 l4
6
1
z 0.3 1 0 2 0.00675 0.00776 0.031036
6
z 0.3 0.9899
To find y at x = 0.6, the starting values are x1 0.3, y1 0.3448 , z1 0.9899 and h 0.3
k1 hf x0 , y0 0.3 1 0.3 0.9899 0.3891
h k1
k2 hf x0 , y0 0.3 1 0.45 0.9744 0.4315
2 2
h k2
k3 hf x0 , y0 0.3 1 0.45 0.9535 0.4287
2 2
k4 hf x0 h, y0 k3 0.3 1 0.6 0.9142 0.4645
l1 hf x0 , y0 , z0 0.3 0.3 0.3448 0.0310
h k1 l
l2 hf x0 , y0 , z0 1 0.3 0.45 0.53935 0.0728
2 2 2
h k2 l
l3 hf x0 , y0 , z0 2 0.3 0.45 0.56055 0.0757
2 2 2
l4 hf x0 h, y0 k3 , z0 l3 0.3 0.6 0.7735 0.1392

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
y2 y1 k1 2k2 2k3 k4
6
1
0.3448 0.3891 2 0.4315 0.4287 0.4645
6
y 0.6 0.7738
1
z2 z1 l1 2l2 2l3 l4
6
1
0.9899 0.0310 2 0.0728 0.0757 0.1392
6
z 0.3 0.9210
---------------------------------------------------------------------------------------------------
Using R-K method of fourth order solve y" x y ' 2 y 2 for x=0.2, given that y=1 and
y ' 0 when x = 0.
Solution
Let y' z then y" z '
Hence the given equation reduces to the form,
dy dz
z and xz 2 y 2
dx dx
Given x0 0, y0 1, z0 0 and h 0.2
Take f1 x, y, z z , f 2 x, y , z xz 2 y2
k1 hf x0 , y0 0.2 0 0
h k1
k2 hf x0 , y0 0.2 0.1 0.02
2 2
h k2
k3 hf x0 , y0 0.2 0.999 0.01998
2 2
k4 hf x0 h, y0 k3 0.3 0.1958 0.03916
2
l1 hf x0 , y0 , z0 0.2 0 1 0.2
h k1 l 2 2
l2 hf x0 , y0 , z0 1 0.2 0.1 0.1 0.99 0.1998
2 2 2
h k2 l 2 2
l3 hf x0 , y0 , z0 2 0.2 0.1 0.0999 0.99 0.1958
2 2 2
2 2
l4 hf x0 h, y0 k3 , z0 l3 0.2 0.2 0.1958 0.98 0.1905
1
y1 y0 k1 2k2 2k 3 k 4
6
1
1 0.2 2 0.02 0.01998 0.03916
6
y 0.2 0.9801
1
Also z 0.2 0 0.2 2 0.1998 0.1958 0.1905 0.1969
6
------------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Multi-Step Methods (Predictor-Corrector Methods)


Introduction
Predictor-corrector methods are methods which require function values at
xn , xn 1 , xn 2 , xn 3 for the computation of the function value at x n 1 . A predictor is used to find the
value of y at x n 1 and then the corrector formula is used to improve the value of y n 1 .
The following two methods are discussed in this chapter
(1) Milne’s Method (2) Adam’s Method
Milne’s Predictor-corrector method
dy
Consider the initial value problem f x, y , y x0 y0 . Assume that
dx
y0 y x0 , y1 y x1 , y2 y x2 , and y3 y x3 where xi 1 xi h, i 0,1,2,3 are known, these
are the starting values.
Milne’s predictor formula
4h '
y4 , p 2 y1 y2' 2 y3' and
y0
3
Milne’s corrector formula
h '
y4 ,c y2 y2 4 y3' y4' where y4' f x4 , y4, p
3
---------------------------------------------------------------------------------------------------
Problems based on Predictor-Corrector method
dy
1.Using Milne’s method, compute y(0.8) given that 1 y 2 , y 0 1, y 0.2 0.2027 ,
dx
y 0.4 0.4228 and y 0.6 0.6841
Solution
we have the following table of values
x y y' 1 y 2
0 0 1.0
0.2 0.2027 1.0411
0.4 0.4228 1.1787
0.6 0.6481 1.4681
x0 0, x1 0.2, x2 0.4, x3 0.6
y0 0, y1 0.2027 , y2 0.4228 , y3 0.6841
y0' 1, y1' 1.0411 , y2' 1.1787 , y3' 1.4681
To find y (0.8):
x4 0.8 . Here h = 0.2
By Milne’s predictor formula,
4h '
y 4 , p y0 2 y1 y2' 2 y3'
3
0.8
0 2 1.0411 1.1787 2 1.4681
3
y4, p 1.0239

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

2
y4' f x4 , y 4 1 1.0239
= 2.0480
By Milne’s corrector formula,
h '
y4 ,c y2 y2 4 y3' y4'
3
0.2
0.4228 1.1787 4 1.4681 2.0480
3
y 0.8 1.0294
---------------------------------------------------------------------------------------------------
2.Given y ' x 2 y, y 0 1, y 0.1 0.9052 , y 0.2 0.8213 , find y(0.3) by Taylor series
method. Also fine y(0.4) by Milne’s method
Solution
Given x0 0 , y0 1
x1 0.1 , y1 0.9052
x2 0.2 , y2 0.8213
x3 0.3 , y3 y x3
By Taylor algorithm
h2 "
y3 y2 hy2' y2 ...
2!
y' x 2 y y" 2 x y'
y" ' 2 y" , y iv y" ' etc
' 2
y 2 0.2 0.8213 0.7813
y2" 2 0.2 0.7813 1.1813
y2'" 2 1.1813 0.8187
y2iv 8187
0.01 0.001 0.0001
y3 0.8213 0.1 0.7813 1.1813 0.8187 0.8187
2 6 24
y 0.3 0.7492
For x3 0.3 y3 0.7492 and y3' 0.09 0.7492 0.6592
' ' '
Also y 1, y
0 0.01 0.905
1 0.8952 and y 2 0.7813
By Milne’s method
4h
y 4 , p y0 2 y1' y2' 2 y3'
3
0.4
y4, p 1 2 0.8952 0.7813 2 0.6952
3
y4, p 0.6897
y4' 0.16 0.6897 0.5297
By Correctors formula,

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

h '
y4 ,c y2 y2 4 y3' y4'
3
0.1
y4,c 0.8213 0.7813 4 0.6592 0.5297
3
y4,c 0.6897 y 0.4 0.6897
---------------------------------------------------------------------------------------------------
Adam-Bash Forth Predictor-Corrector Method
Using Newton’s backward difference interpolation formula, we derive a set of predictor
and corrector formulae. This method also requires past four values to estimate the fifth value.
Adam’s predictor formula
h
yn 1, p yn 55 yn' 59 yn' 1 37'n 2 9 yn' 3
24
Adam’s corrector formula
h
yn 1,c yn 59 yn' 1 19 yn' 5'n 1 yn' 2
24
The errors in these formulae are
251 5 iv 19 5 iv
h f and h f respectively.
720 720
In particular,
h
y4, p y3 55 y3' 59 y2' 37 y1' 9 y0'
24
And
h
y4,c y3 9 y4' 19 y3' 5 y2' y1'
24
---------------------------------------------------------------------------------------------------
Given y ' 1 y 2 , y 0 0, y 0.2 0.2027 , y 0.4 0.4228 , y 0.6 0.6841 , estimate
y 0.8 using Adam’s method.
Solution
Form the given data
x0 0 , y0 0 , y0' 1
x1 0.2 y1 0.2027 y1' 1.0411
x2 0.4 y2 0.4228 y2' 1.1786
'
x3 0.6 y3 0.6841 y 3 1.4680
To fine y 4 for x4 0.8 . Here h =0.2
h
y4, p y3 55 y3' 59 y2' 37 y1' 9 y0'
24
0.2
y4, p 0.6841 55 1.4680 59 1.1786 37 1.0411 9
24
y4, p 1.0235

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

h
y4 ,c y39 y4' 19 y3' 5 y2' y1'
24
2
y4' 1 1.0235 2.0475
0.2
y4 ,c 0.6481 9 2.0475 19 1.4680 5 1.1786 1.0411
24
y4 ,c 1.0297
y 0.8 1.0297
------------------------------------------------------------------------------------------------------------

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

UNIT V
BOUNDARY VALUE PROBLEMS IN
ORDINARY AND
PARTIALDIFFERENTIAL EQUATIONS

Finite difference solution of second order


ordinary differential equation

Finite difference solution of one dimensional


heat equation by explicit and implicit methods

One dimensional wave equation

Two dimensional Laplace equation

Poisson equation

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

 Solution of Boundary Value Problems in ODE


 Solution of One Dimensional Heat Equation
 Solution of One Dimensional Wave Equation
 Solution of Laplace Equation
 Solution of Poisson Equation

There are number of methods for solving second order boundary value problems.

 Finite Difference Method


 Shooting Method

Finite difference solution of second order ordinary differential equation

Let us consider
y”(x)+f(x)y’(x)+g(x)y(x)=0
with boundary conditions y(x0)=a and y(xn)=b

Formula
yi 1 2 yi yi 1 yi 1 yi 1
y" ( x) and y' ( x)
h2 2h

Steps for solving the second order ODE

 Put y”(x), y’(x), y(x) by yi " , yi ' , yi respectively


 substitute the above formula
 Form an equation
 Substitute the boundary conditions
 Solve the equations by putting i=1, 2, 3
 Write the solution of the intermediate values of boundary conditions

Problems based on Finite difference method for ODE

1. Solve by finite difference method, the boundary value problem y”(x) – y(x)=2 where
1
y(0)=0 and y(1)=1, taking h=
4
Solution:
Given y”(x) – y(x)=2
Step1:
Put y”(x), y(x) by yi " , yi respectively
i.e, yi " yi 2 -------------------(1)
Step2:

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

yi 1 2 yi yi 1
substitute the formula y" ( x)
h2
yi 1 2 yi yi 1
(1) becomes yi 2
h2

1
yi 1 ( 2 h 2 ) yi yi 1 2
16
1
yi 1 ( 2 h 2 ) yi yi 1
8

33 1
yi 1 yi yi 1
16 8
yi 1 2.0625 yi yi 1 0.125 ----------------------------(2)
Step3:
The boundary conditions are y0=0, y4=1
1
h= gives
x0=0 x1= 1 x2= 1 x3= 3 x4=1 4
4 2 4
y0=0 y1=? y2=? y3=? y4=1

Step4
Put i=1, 2, 3 we get the following equations
2.0625 y1 y21 0.125 ----------------------------(3)
y1 2.0625 y2 y3 0.125 ----------------------------(4)
y2 2.0625 y3 0.875 ----------------------------(5)
Solving these three equations we get
y1=0.0451 y2=0.2183 y3=0.5301
---------------------------------------------------------------------------------------------------------
1 2
2. Solve the equation y”(x) –x y(x)=0 where xi=0, , ,given that y(0)+y’(0)=1 and y(1)=1.
3 3
Solution:
Step1:
Put y”(x), y(x),x by yi " , yi , xi respectively
i.e, yi " xi yi 0 -------------------(1)
Step2:
yi 1 2 yi yi 1
substitute the formula y" ( x)
h2
y 2 yi yi 1
(1) becomes i 1 xi yi 0
h2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
yi 1 2 xi yi yi 1 0 ---------------------------(2)
9
Step3:
The conditions are y(0)+y’(0)=1 and y(1)=1

x0=0 x1= 1 x2= 2 x3=1


3 3
y0=? y1=? y2=? y3=1

Putting i=0, 1, 2 we get


y 1 2 y0 y1 0 -------------------------------(3)
55
y0 y1 y2 0 -------------------------------(4)
27
56
y1 y2 y3 0 -------------------------------(5)
27
Step4:
To solve the above equations we need the values of y-1 and y3
we have y3=1
So now we have to find the value of y-1 by using the condition y(0)+y’(0)=1
y(0)+y’(0)=1 y0 y0' 1
y1 y 1 yi 1 yi 1
y0 1 [put i=0 in yi' ]
2h 2h
1
put h= we get
3
2 y0 3 y1 2
y1 -----------------------------------------(6)
3
substitute (6) in (3),
2 y0 3 y1 1 -----------------------------------------(7)
55
y0 y1 y2 0 -----------------------------------------(8)
27
56
y1 y2 1 0 -------------------------------------------(9)
27
Solving the above three equations we get
y0=-0.9880 y1=-0.3253 y2=0.3253
-----------------------------------------------------------------------------------------------------------
Classification of second order PDE

The most general linear pde of second order can be written as


2 2 2
u u u u u
A 2 B C 2 D E Fu 0 ------------------------(1)
x x y y x y
where A, B, C, D, E, F are in general functions of x and y.
Equation (1) is said to be
 Elliptic if B2-4AC<0

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

 hyperbolic if B2-4AC>0
 Parabolic if B2-4AC=0
Note:
 The same differential equation may be elliptic in one region, parabolic in another region
and hyperbolic in some other region.
Examples

Elliptic Parabolic Hyperbolic


1. uxx+uyy=0 (Laplace 1 1
Equation) uxx= 2
ut (One dimensional uxx= 2
utt (One dimensional
2. uxx+uyy=f(x, y) (Poisson heat equation) wave equation)
Equation)

Problems based on the classification of 2nd order PDE


1. Classify uxx+4uxy+(x2+4y2)+uyy=sin(x+y)
Solution:
A = 1, B = 4, C = x2+4y2
B2-4AC=4[4-x2-4y2]
x2 y2 x2 y2
The equation is elliptic if 4-x2-4y2<0 1 (outside the ellipse 1)
4 1 4 1
x2 y2 x2 y2
Parabolic 4-x2-4y2=0 1 (on the ellipse 1)
4 1 4 1
x2 y2 x2 y2
Hyperbolic 4-x2-4y2>0 1 (inside the ellipse 1)
4 1 4 1
------------------------------------------------------------------------------------------------------------
2. Classify (x+1)uxx-2(x+2)uxy+(x+3)uyy=0

Solution:
A =(x+1), B=-2(x+2), C=(x+3)
B2-4AC=4>0
hyperbolic.
------------------------------------------------------------------------------------------------------------

One Dimensional Heat Equation


2
One dimensional heat equation is u 2 u
t x2
Classification: Parabolic
There are two types for finding the Finite difference solution of one dimensional heat
flow equation
1
(i) Bender-Schmidt Method(Explicit Method valid for 0 )
2
(ii) Crank-Nicholoson Method(Implicit Method)

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Bender-Schmidt Method(Explicit Method)


u
Coefficient of =a, xi=x0+ih and tj=t0+jk
t
Case 1: (If h is given and k is not given)
Assume that λ = ½
Find k, using the formula k= λah2
Using the given (i), (ii) and (iii) conditions fill the first row, first and last column of the table
Next using the Bender-Schmidt recurrence relation,
1
ui , j 1 ui 1, j ui 1, j
2

i.e,
ui-1,j a b ui+1,j

C ui,j+1 a b
c
2

Case 2: (If h and k are given)


2
Find , using the formula k= λah
Using the given (i), (ii) and (iii) conditions fill the first row, first and last column of the table
Next using the Bender-Schmidt recurrence relation,

ui , j 1 ui 1, j ui 1, j (1 2 )ui , j

Using the formula and tabulate the remaining rows.

Examples
1. Solve uxx=2ut when u(0, t) = u(4,t)=0 and with initial condition u(x, 0)=x(4-x) upto t=5
sec, assuming ∆x=h=1.

Solution:
u
Given: a=Coefficient of
t
a=2 ; h=1 and k is not given.
Assume that λ=½ k= λah2 = 1 2 1 =1
2
By the given conditions x=0, 1, 2, 3, 4 and t=0, 1, 2, 3, 4, 5

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Condition(i) u(0, t)=0 u(0, 0)=0, u(0, 1)=0, u(0, 2)=0, u(0, 3)=0, u(0, 4)=0, u(0, 5)=0
Condition(ii) u(4, t)=0 u(4, 0)=0, u(4, 1)=0, u(4, 2)=0, u(4, 3)=0, u(4, 4)=0, u(4, 5)=0
Condition(iii) u(x, 0)=x(4-x) u(1,0)=1(4-1)=3,
u(2,0)=2(4-2)=4,
u(3,0)=3(4-3)=3,
Bender-Schmidt recurrence relation,
1
ui , j 1 ui 1, j ui 1, j
2
i.e,
ui-1,j a b ui+1,j

C ui,j+1 a b
c
2
xi=x0+ih and tj=t0+jk
i 0 1 2 3 4
j x=0 x=1 x=2 x=3 x=4
0 t=0 0 3 4 3 0
1 t=1 0 2 3 2 0
2 t=2 0 1.5 2 1.5 0
3 t=3 0 1 1.5 1 0
4 t=4 0 0.75 1 0.75 0
5 t=5 0 0.5 0.75 0.5 0
------------------------------------------------------------------------------------------------------------
2. Find the values of the function satisfying the pde 4uxx=ut and the boundary conditions
u(0, t) = u(8,t)=0 and u(x, 0)=4x - x2 for points x=0,1, 2, 3, 4, 5, 6, 7, 8, t= j , j=0,1, 2, 3,
2 8
4, 5

Solution:
u
Given: a=Coefficient of t
a=¼ ; Here h and k is not given. Take h=1
Assume that λ=½ k= λah2 = 1 1 1 1
2 4 8
By the given conditions x=0,1, 2, 3, 4, 5, 6, 7, 8 and 1 2 3 4 5
t 0, , , , ,
8 8 8 8 8
Condition(i) u(0, t)=0 1 2 3 4 5
t
0, , , , ,
8 8 8 8 8
Condition(ii) u(8, t)=0 t 0, 1 , 2 , 3 , 4 , 5
8 8 8 8 8
2
Condition(iii) u(x, 0)=4x - x u(1,0)= 4- 1 =3.5, u(2,0)= 8 - 4 =6, u(3,0)= 12 - 9 =7.5,
2 2 2 2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

u(4,0)= 16 - 16 =8, u(5,0)= 20 - 25 =7.5, u(6,0)= 24 - 36 =6, u(7,0)= 28 - 49 =3.5.


2 2 2 2
Bender-Schmidt recurrence relation,
1
ui , j 1 ui 1, j ui 1, j
2
i.e,
ui-1,j a b ui+1,j
ui , j 1 ui 1, j ui 1, j (1 2 )u i , j
ui , j 1 ui 1, j ui 1, j (1 2 )u i , j
C ui,j+1 a b
c
2
xi=x0+ih and tj=t0+jk
i 0 1 2 3 4 5 6 7 8
j x=0 x=1 x=2 x=3 x=4 x=5 x=6 x=7 x=8
0 t=0 0 3.5 6 7.5 8 7.5 6 3.5 0
1 t= 1 0 3 5.5 7 7.5 7 5.5 3 0
8
2 t= 2 0 2.75 5 6.5 7 6.5 5 2.75 0
8
3 t= 3 0 2.5 4.625 6 6.5 6 4.625 2.5 0
8
4 t= 4 0 2.3125 4.25 5.5625 6 5.5625 4.25 2.3125 0
8
5 t= 5 0 2.125 3.9875 5.125 5.5625 5.125 3.9875 2.125 0
8

------------------------------------------------------------------------------------------------------------
3. Solve uxx=ut when u(0, t) =0, u(4, t) =0 with initial boundary condition u(x, 0) = x(4-x),
1
h= 1, k= upto t=1 sec.
4
Solution:
u
Given: a=Coefficient of t
1
a=1 ; Here h and k are given. Take h=1, k=
4
kh2 1
=
a 4
1
This is in the interval 0
2
So we use Bender-Schmidt method

Formula:
ui , j 1 ui 1, j ui 1, j (1 2 )ui , j

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1 1
put =
1 ui , j 1 ui 1, j ui 1, j ui , j
4 4 2

ui-1,j ui,j ui+1,j


b c d

a 1 1
ui,j+1 a b d c
4 2

i 0 1 2 3 4
j x=0 x=1 x=2 x=3 x=4 boundary condition
0 t=0 0 3 4 3 0
1 1 0 2.5 3.5 2.5 0
t=
4
2 1 0 2.125 3 2.125 0
t=
2
3 3 0 1.8125 2.5625 1.8125 0
t=
4
4 t=1 0 1.5468 2.1875 1.5468 0 boundary condition

boundary condition boundary condition

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Crank-Nicholson’s Method(Implicit Method)

Formula
Case(1) (h is given and k is not given)
k
Assume =1 where find k using this formula
ah 2

1
ui , j 1 ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j
4

ui-1,j ui+1,j
d e

b a c

ui-1,j+1 ui,j+1 ui+1,j+1

1
a= (b c d e)
4
using the formula and tabulate the values

Case(2) (h and k are given)

k
Find the value of using the formula
ah 2
Formula:

(2 2)ui , j 1 ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j (2 2 )ui , j

Using the formula and tabulate the values.

Problems based on Crank- Nicholson Method


1. Solve uxx=2ut when u(0, t) = u(4,t)=0 and with initial condition u(x, 0)=x(4-x) assuming
∆x=h=1 and compute u for one time step.
Solution:
Here h is given and k is not given.
=1. k= ah2=2

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Formula
1
ui , j ui 1, j 1 ui 1, j 1 ui 1, j ui 1, j
1
4
we have to find u11, u21, u31
put j=0,
1
ui ,1 ui 1,1 ui 1,1 ui 1,0 ui 1,0
4
put i=1, 2, 3 we get the following equations
4u11-4u21=4; -u11+4u21-u31=6; 0u11-u21+4u31=4 respectively.
We solve these equations we get the solution
u11=1.571, u21=2.2857, u31=1.571

i 0 1 2 3 4
j x=0 x=1 x=2 x=3 x=4
0 t=0 0 3 4 3 0
1 t=2 0 1.571 2.2857 1.571 0

One dimensional wave equation


1
One dimensional wave equation is uxx= 2
utt
There are two types

Type1:

Subject to the boundary conditions u(0, t) =0, u(l, t) =0 and the initial condition u(x,0)=f(x) and
ut(x, 0)=0.

Type2:

Subject to the boundary conditions u(0, t) =0, u(l, t) =0 and the initial condition u(x,0)=0 and ut(x, 0)=
f(x)

Formula

2
ui , j 1 21 a 2 ui , j 2
a 2 ui 1, j ui 1, j ui , j 1 -------------------------(1)
k
where .
h

This formula is the explicit scheme for the wave equation.

h
If k the equation (1) takes the form
a
ui, j 1 ui 1, j ui 1, j ui, j 1

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

ui,j-1
d

ui-1,j b ui,j ui+1,j c

ui,j+1 a a=b+c-d

1
and ut(x, 0)=0 ui ,1ui 1,0 ui 1, 0 which gives the values of u at the first time step in terms
2
of the values of u at time t =0.
This is used to solve the type 1

Suppose the problem is given in type2


We write ut(x, 0)=f(x) as ut(x, 0)=f(ih) and substitute in the formula
ui, j 1 ui, j 1
f (ih) for j =0
2k
And then find the value of u11, u21, u31.
The values of Remaining rows are same as type1
-----------------------------------------------------------------------------------------------

Problems based on one dimensional wave equation

1. Find the nodal values of the equation 16uxx=utt taking ∆x=1 given that u(0, t) =0,
u(5,t)=0, ut(x, 0)=0 and u(x, 0)=x2(5-x) and upto one half of the period of vibration.
Solution:
1
One dimensional wave equation is uxx= 2 utt a=4.
u(5, t)=0 l=5
2l 5
Period of vibration is = =2.5
a 2
Half period of vibration =1.25
h 1
∆x=1 h=1. Since k is not given we choose k k
a 4

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Formula:
ui, j 1 ui 1, j ui 1, j ui, j 1 ----------------------------(1)
Conditions
1 1 3 5 1 1 3 5
u(0,t)=0 for t=0, , , ,1, u(5,t)=0 for t=0, , , ,1,
4 2 4 4 4 2 4 4
2
u(x,0) = x (5-x) u(1,0)=4, u(2,0)=12, u(3,0)=18,u(4, 0)=16
ui, j 1 ui, j 1
ut(x, 0) =0 0 for j=0
2k
u i ,1 u i , 1 we find the values of the second using this formula
ui-1,j b c ui+1,j

a b c
ui, j+1 a
2
The remaining rows obtained by the following formula
ui,j-1
d

ui-1,j b ui,j ui+1,j c

a
ui,j+1 a=b+c-d

The values of u at the time steps


i 0 1 2 3 4 5
j x=0 x=1 x=2 x=3 x=4 x=5
0 t=0 0 4 12 18 16 0
1 t= 1 0 6 11 14 9 0
4
2 t= 1 0 7 8 2 -2 0
2
3 t= 3 0 2 -2 -8 -7 0
4
4 t=1 0 -9 -14 -11 -10 0
5 t= 5 0 -16 -22 -32 -18 0
4

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

2. Solve uxx=utt,0<x<2, t>0 subject u(x,0)=0, ut(x, 0)=100(2x-x2), u(0, t) =0, u(2,t)=0.
Choosing h=½, compute u for 4 time steps.
Solution
h 1
Here h=½ and a = 1. We choose k k
a 2
The simplest explicit scheme is given by

ui, j 1 ui 1, j ui 1, j ui, j 1 --------------------------------(1)


The boundary conditions are
1 3
u(0,t)=0 for t=0, , 1, , 2
2 2
1 3
u(5,t)=0 for t=0, , 1, , 2
2 2
1 3
u(x,0) = 0 for x =0, , 1, , 2
2 2

ui, j ui, j
ut(x, 0)=100(2x-x2)
1 1
100 (2ih i 2 h 2 ) for j =0
2k
i2
Here h=k=½ u i ,1 u i , 1 100 i for i=1, 2, 3.
4
i2
ui , 1 u i ,1 100 i for i=1, 2, 3. ---------------------------(2)
4
From (1) we get ui ,1 ui 1, 0 ui 1,0 ui , 1
Sub (2) in (1) we get
ui 1,0 ui 1,0 i2
ui ,1 50 i for i =1, 2, 3.
2 4
But u i , 0 0, i
i2
ui ,1 50 i
for i =1, 2, 3
4
So we have u11=37.5, u21=50, u31=37.5

i 0 1 2 3 4
j x=0 x= 1 x=1 x= 3 x=2
2 2
0 t=0 0 0 0 0 0
1 t= 1 0 37.5 50 37.5 0
2
2 t=1 0 50 75 50 0
3 t= 3 0 37.5 50 37.5 0
2
4 t=2 0 0 0 0 0

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

Two dimensional Laplace Equation


2
Laplace equation is u=uxx+uyy=0

Standard Five Point Formula(SFPF)


1
ui , j ui 1, j ui 1, j ui , j 1 ui , j 1
4
ui,j-1

ui-1,j ui,j ui+1,j

ui,j+1

Diagonal Five Point Formula(DFPF)


1
ui , j ui 1, j ui 1, j ui , j 1 ui , j 1
4

ui-1,j+1 ui+1,j+1

ui,j

ui-1,j-1
ui+1,j-1

Liebmann’s Iteration Process

b13 b12 b11 b10 b9


u1 u2 u3
b14 b8
u4 u5 u6
b15 b7
u7 u8 u9
b16 b6

b1 b2 b3 b4 b5

We compute the initial values of u1, u2, …,u9 by using SFPF and DFPF. First we compute u5 by
SFPF.

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

1
u5 b7 b15 b11 b3
4
We compute u1, u3, u7, u9 by using DFPF

1 1
u1 b1 u 5 b3 b15 u3 u5 b5 b3 b11
4 4
1 1
u7 b13 u 5 b15 b11 u9 b7 b11 u 5 b9
4 4
Finally we compute u2,u4,u6,u8 using SFPF

1 1
u2 b3 u 5 u1 u3 u4 u1 u 7 b15 u5
4 4
1 1
u6 u3 u9 u5 b7 u8 b11 u5 u 7 u9
4 4

These initial values are called rough values.


After that we use only SFPF method
Once all the values are computed their accuracy can be improved by Gauss-Seidal method.
The Gauss-Seidal formula is given by
1 ( n 1)
u i(,nj 1) u i 1, j u in 1, j u in, j 1 ui(,nj 11)
4

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in
www.Vidyarthiplus.com
www.Vidyarthiplus.in

www.Vidyarthiplus.com
www.Vidyarthiplus.in

You might also like