Solve the following initial value problem by Picard methody dy xe dx= with y 0 =0, compute y 0.1.. These methods are well-known as Runge-Kutta Method.. They are distinguished by their o
Trang 1( )
(1.07152 0.075)
1.07152 0.025
1.07152 0.075
−
+ =1.09324
⇒ y4=1.09324 at (x4=x0+4h= + ×0 4 0.025 0.1= )
Hence, y(0.1)=1.0932 Ans
Example 18 Given dy x y
dx= + with initial condition y(0) = 1 Find y(.05) and y(.1) correct to 6
decimal places.
Sol Using Euler’s method, we obtain
y = = +y y hf x y = 1+.05 0 1( + =) 1.05
We improve y1 by using Euler’s modified method
( ) 1 ( ) ( 0)
2
h
1 0 1 05 1.05
=1.0525
( ) 2 = + ( + +) ( + )
1
.05
1 0 1 05 1.0525 2
y
=1.0525625
1
.05
1 0 1 05 1.0525625 2
=1.052564
( ) 4 = + ( + +) ( + )
1
.05
1 0 1 05 1.052564 2
y
=1.0525641 Since, ( ) 3 ( ) 4
1 1 1.052564
y =y = correct to 6 decimal places Hence we take y1=1.052564 i.e., we have y( ).05 =1.052564
Again, using Euler’s method, we obtain
=1.052564 05 1.052564 05+ ( + ) =1.1076922
We improve y2 by using Euler’s modified method
( ) 1 = + ( + ) (+ + )
2
.05 1.052564 1.052564 05 1.1076922 1
2
y
=1.1120511
2
.05 1.052564 1.052564 05 1.1120511 1
2
=1.1104294
Trang 2( ) 3 = + ( + ) (+ + )
2
.05 1.052564 1.052564 05 1.1104294 1
2
y
1.1103888
=
2
.05 1.052564 1.052564 05 1.1103888 1
2
y
1.1103878
=
2
.05 1.052564 1.052564 05 1.1103878 1
2
y
1.1103878
=
Since, ( ) 4 ( ) 5
2 2 1.1103878,
y =y = correct to 7 decimal places Hence, we take y2=1.1103878 Therefore, we have y( ).1 =1.110388, correct to 6 decimal places Ans
Example 19 Find y(2.2) using Euler’s method for
2,
dy xy
Sol By Euler’s method, we obtain,
y = = +y y hf x y = + − − = This value of y1 is improved by using Euler’s modified method
2
h
( ) ( )( )
2 8328
=
Similarly ( ) 2 { ( ) (2 )( )2}
1
0.1
1 2 1 2.1 8328 2
.8272
=
( ) 3 { ( ) (2 )( )2}
1
0.1
1 2 1 2.1 8272 2
.8281
=
( ) 4 { ( ) (2 )( )2}
1
0.1
1 2 1 2.1 8281 2
=.8280
( ) 5 { ( ) (2 )( )2}
1
0.1
1 2 1 2.1 8280 2
= 8280 Since ( ) 4 ( ) 5
1 1 0.8280
y =y = Hence, we take y1=.828at x1=2.1
Now, if y2 is the value of y at x=2.2 Then, we apply Euler’s method to compute y( )2.2 ,
i.e., we obtain
y = = +y y hf x y
( )( )2
.828 1 2.1 828
Trang 3Now, using Euler’s modified formula, we obtain
2
0.1 828 2.1 828 2.2 68402 2
.70454
=
( ) 2 = + − ( ) (2+ − )( )2
2
0.1 828 ( 2.1) 828 2.2 70454 2
y
.70141
=
2
0.1 828 2.1 828 2.2 70141 2
.70189
=
2
0.1 828 2.1 828 2.2 70189 2
.70182
=
2
0.1 828 2.1 828 2.2 70182 2
.70183
=
Since, ( ) 4 ( ) 5
2 2 7018
y =y = , correct to 4 decimal places
Hence, we have y( )2.2 =.7018 Ans
Example 20 Find y(.2) and y(.5) Given
10
dy
= log x + y dx
with initial condition y = 1 for x = 0.
Sol Let dy f x y( ), log10(x y)
dx= = + and h=.2
By Euler’s formula, we have
y = = +y y hf x y
( )
1 2log 0 1 1
Now, we improve this value by using Euler’s modified formula and thus we obtain
2
h
0.2
1 log 0 1 log 2 1 2
1.0079
=
1
0.2
1 log 0 1 log 2 1.0079 2
1.0082
=
1
0.2
1 log 0 1 log 2 1.0082 2
1.0082
=
Trang 4Since, ( ) 2 ( ) 3
1 1 1.0082
y =y = Hence, we take y1=1.0082 at x=.2, i.e., y( ).2 =1.0082 Ans Again using Euler’s formula, we obtain
2
y = = +y y hf x +y
1.0082 0.3 log 0.2 1.0082 1.0328
To improve y2, we use Euler’s modified formula and we obtain
y (1)
2 =1.0082+0.3log 1.0328 5 log 2 1.0082( + +) ( + )
2 1.0483
=
2
0.3 1.0082 log 1.0483 5 log 2 1.0082
2
1.049
=
2
0.3 1.0082 log 1.049 5 log 2 1.0082
2
y
1.0490
=
Since ( ) 3 ( ) 2
2 2 1.0490,
y =y = we take y2=1.0490, i.e., y( ).5 =1.0490 Ans
Example 21 Using Euler’s modified method, compute y(0.1) correct to six decimal figures, where
2
dy
x y
dx= + with y = 94 when x = 0.
Sol By Euler’s method, we have
y =y =y +hf x y
.94 1 0 94
1.034
=
Now, we improve y1 by using Euler’s modified formula and we obtain
2
h
=.94 + 0 1
2 0 94 1 1 034
2
= 1.0392
y (2)
1 0.1 ( ) { ( )2 }
.94 0 94 1 1.0392
=1.03946
1
0.1 94 0 94 1 1.03946 2
1.039473
=
1
0.1 94 0 94 1 1.039473 2
1.0394737
=
Trang 5Since, ( ) 3 ( ) 4
1 1 1.039473,
y =y = correct to 6 decimal places
Hence, we have y( ).1 =1.039473 Ans.
Example 22 Using Euler’s modified method, solve numerically the equation dy x y
dx= + with
y(0) = 1 for 0 ≤ x ≤ 0.6, in steps of 0.2.
Sol The interval h=0.2
By Euler’s method, we obtain ( ) 0 ( )
y = = +y y h x y
= +1 0.2 0( + 1)=1.2
The value of ( ) 0
1
y , thus obtained is improved by modified method
2
By considering n = 0, we obtain
y1(1) = y0 + h
2 B N O( , )0 0 +B N O( , )1 1
=1.2295
By considering n=1, we obtain
1
0.2
2
=1.2309
By considering n=2, we obtain
( )= + ( + ) (+ + )
3 1
0.2
2
y
=1.2309
Since ( ) 2 ( ) 3
1 1 1.2309
y =y == Hence, we take y1=1.2309 at x=0.2 and proceed to compute y at
0.4
Again, applying Euler’s method, we obtain
2
2 1.2309 0.2 0.2 1.2309 1.49279
Now, we apply modified method for more accurate approximations and we obtain
2
.2 1.2309 2 1.2309 0.4 1.49279
2
=1.52402
2
.2 1.2309 2 1.2309 0.4 1.52402
2
=1.525297
Trang 6( ) 3 ( ) ( )
2
.2 1.2309 2 1.2309 0.4 1.525297
2
1.52535
=
2
.2 1.2309 2 1.2309 0.4 1.52535
2
1.52535
=
Since, ( ) 3 ( ) 4
2 2 1.52535
y =y = Hence, we take y2=1.52535 at x=0.4 To find the value of y(=y3) for x=0.6, we apply Euler’s method to have
0 3
3 1.52535 2 4 1.52535
For better approximations, we use Euler’s modified formula and we obtain
1 3
.2 1.52535 4 1.52535 0.6 1.85236
2
y
1.88496
=
3
.2 1.52535 4 1.52535 0.6 1.88496
2
1.88615
=
3
.2 1.52535 4 1.52535 0.6 1.88615
2
1.88619
=
4 3
.2 1.52535 4 1.52535 0.6 1.88619
2
y
1.88619,
= correct to 5 decimal places
Since, ( ) 3 ( ) 4
3 3 1.88619
y =y = Hence, we take y=1.88619 at x=0.6 Ans
PROBLEM SET 7.1
1 Solve by Taylor’s method, y′= +x′′ y′′,y( )0 =1 Computer y( )0.1 [Ans 1.11146]
2 Solve by Taylor’s method, dy y 2x;y( )0 1
dx= − y = Also compute y( )0.1 [Ans 1.0954]
3 Given differential equation dy 21
dx= x y
+ with y( )4 =4 Obtain y( )4.1 and y( )4.2 by Taylor’s
4 Apply Picard’s method to find the third approximation of the solution of dy dx = x + y2 with
2
4 3
+ +x x + x + ]
5 Using Picard’d method, obtain the solution of dy x(1 x y3 );y( )0 3
dx= + = Compute the value of
( )0.1
Trang 76 Solve the following initial value problem by Picard method
y
dy
xe
dx= with y( )0 =0, compute y( )0.1 [Ans 0.0050125]
7 Use Picard’s method to approximate y when x=0.2, given that dy x y
dx= − with y( )0 =1
[Ans 0.0837]
8 Use Picard’s method to approximate the value of y when x=0.1, given that dy 3x y2
dx= + with
( )0 1
9 Solve by Euler’s method dy 2y 0,y( )0 1,h 0.1
dx− = = = and x∈[0, 0.3] [Ans y(0.3) = 0512]
10 Apply Euler’s method to find the approximate solution of dy x y y, ( )0 1,h 0.1
[ ]0, 1
11 Obtain by Euler’s modified method for the numerical solution for y( )1 of dy dx=1−y x
+ with
( )3 2
12 Using Euler’s modified method, solve dy 1 y
dx= − with y (0) = 0 in the range 0≤ ≤x 0.2
(take h=0.1) [Ans y(0.1) = 0.09524, y(0.2) = 0.1814076]
7.6 RUNGE-KUTTA METHOD
The method is very simple It is named after two german mathematicians Carl Runge (1856-1927) and Wilhelm Kutta (1867-1944) These methods are well-known as Runge-Kutta Method They are distinguished by their orders in the sense that they agree with Taylor’s series solution upto terms
of h r where r is the order of the method.
It was developed to avoid the computation of higher order derivations which the Taylors’ method may involve In the place of these derivatives extra values of the given function f x y( ), are used
(i ) First order Runge-Kutta method
Consider the differential equation
( ),
dy
f x y
By Euler’s method, we know that
Expanding by Taylor’s series, we get
1 ( 0 ) 0 0 2 0
2!
h
It follows that Euler’s method agrees with Taylor’s series solution upto the terms in h Hence Euler’s method is the first order Runge-Kutta method
Trang 8(ii ) Second order Runge-Kutta method
Consider the differential equation
( ), ;
dy
f x y
dx= y x( )0 =y0 Let hbe the interval between equidistant values of x.Then the second order Runge-Kutta method, the first increment in y is computed from the formulae
2
, , 1
2
k hf x y
x h y k
k hf
=
Then, x1=x0+h
1 2
y =y + ∆ =y y + k +k
Similarly, the increment in y for the second interval is computed by the formulae,
, , 1
2
=
and similarly for other intervals
(iii ) Third order Runge-Kutta method
This method agrees with Taylors’ series solution upto the terms in h3 The formula is as follows:
1
6
y =y + k + k +k x =x +h
where, k1 =hf x y( 0, 0)
1
k h
Similarly for other intervals
(iv) Fourth order Runge-Kutta method
This method coincides with the Taylor’s series solution upto terms of h4.
Consider the differential equation
( ),
dy
f x y
dx= with initial condition y x( )0 =y0 Let h be the interval between equidistant values of x Then the first increment in y is computed from the formulae
1
k h
Trang 9k h
1
6
and x1=x0+h
Similarly, the increment in yfor the second interval is computed by
1
k h
2
k h
k =hf x +h y +k
1
6
y =y + k + k + k +k
and similarly for the next intervals
Runge-Kutta Method for Simultaneous First Order Equations
Consider the simultaneous equations
1 , ,
dy
f x y z
dx=
2 , ,
dy
f x y z
dx= With the initial condition y x( )0 =y0 and z x( )0 =z0 Now, starting from (x y z0, 0, 0), increments k and l in y and z are given by the following formulae:
1 1 0, 0, 0 ;
h
h
h
h
k =hf x +h y +k z +l ; l4 =hf x2( 0+h y, 0+k z3, 0+l3) Hence, 1 0 ( 1 2 3 4)
1
6
y =y + k + k + k +k 1 0 (1 2 3 4)
1
6
z =z + l + l + l +l
To compute y z2, 2, we simply replace (x y z0, 0, 0)by (x y z1, 1, 1) in the above formulae
Trang 10Example 1 Apply Runge-Kutta Method to solve.
dy 1/3 ( )
= xy , y 1 = 1
dx to obtain y(1.1).
Sol Here, x0 =1,y0 =1 and h=0.1 Then, we can find
k1 =hf x y( 0, 0) =0.1 1 1( )( )1/3 =0.1
2 0 , 0 1
k h
1/3
= + + =
3 0 , 0 2
k h
1/3 0.1 0.10672
k4 =hf x( 0+h y, 0+k3) ( )( )1/3
0.1 1 0.1 1 0.10684 0.11378
∴ ( ) 0 ( 1 2 3 4)
1
6
1 0.1 2 0.10672 2 1.0684 0.11378 6
= +1 0.10682 1.10682= Ans
Example 2 The unique solution of the problem
y′ = −xy with y 0 = 1 is y=e−x2/2 Find approximately the value of y (0.2) using one application of Runge-Kutta method of order four.
Sol Let h=0.2, we have y0 =1 when x0 = 0
k1 =hf x y( 0, 0) =0.2[ 0 1] 0( ) =
2 0 , 0 1
k h
0.2 0 0.2 (1 0) 0.02
2
= − + + = −
3 0 , 0 2
k h
=0.2−0+0.22 1−0.022 = −0.0198