0% found this document useful (0 votes)
36 views

Numercial Methods-2

Uploaded by

dakax40517
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Numercial Methods-2

Uploaded by

dakax40517
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

B.M.S.

COLLEGE OF ENGINEERING, BENGALURU – 560 0 19


Autonomous college, affiliated to VTU
DEPARTMENT OF MATHEMATICS
UNIT-5: NUMERICAL METHODS – 2
Course: Mathematical Foundation for Computer Science Stream-2 (23MA2BSMCS)

Mathematical Foundation for Mechanical and Civil Engineering Stream -2(23MA2BSMCM)

Mathematical Foundation for Electrical Stream-2 (23MA2BSMES)

Numerical Solution of Ordinary Differential Equations (ODE’S):


Numerical Solution of Ordinary Differential Equations of First Order and First Degree:
An ODE of the first order is of the form F ( x, y, y ) = 0 .
An ODE of the first order and first degree is of the form y = f ( x, y ) .
An initial value problem is of the form y = f ( x, y ) , with y( x0 ) = y0 .
We assume that the problem has a unique solution on some open interval a  x  b containing x0 .

I Taylor’s series method


Consider y = f ( x, y ) ---- (1)
Differentiating Equation (1), we get y = f x + f y y . Similarly, the higher order derivatives of y
can be found by successive differentiation. Substituting y( x0 ) = y0 we obtain the values of ( y)0 ,
( x − x0 )2
( y)0 etc. Hence the Taylor’s series y ( x) = y0 + ( x − x0 ) ( y )0 + ( y )0 + ... gives the
2!
values of y for every value of x for which the series converges.

1) Find by Taylor’s series method the value of y at x = 0.1 and x = 0.2 to five decimals from
dy
= x 2 y − 1, y ( 0 ) = 1 . Ans: y ( 0.1) = 0.90033, y ( 0.2 ) = 0.80227
dx
2) Employ Taylor’s method to obtain approximate value of y at x = 0.2 for the differential
dy
equation = 2 y + 3e x , y ( 0 ) = 0 . Compare the numerical solution obtained with the exact
dx
solution upto three decimal places. Ans: 0.811
dy
3) Solve by Taylor’s series method the equation = log e ( xy), y (1) = 2 for y(1.1) and y(1.2) .
dx
Ans: y (1.1) = 2.036, y (1.2 ) = 2.081

dy
4) Find an approximate value of y when x = 0.1 if = x − y 2 and y = 1 at x = 0 using
dx
Taylor’s series. Ans: 0.1938
5) Solve y = x + y, y(1) = 0. Find y(1.1) and y(1.2) by Taylor’s method. Compare the result
with its exact value. Ans: y (1.1) = 0.1103, y (1.2 ) = 0.2428

6) Evaluate y(0.1) correct to 4 decimal places by Taylor’s series method if y ( x) satisfies


y = xy + 1, y(0) = 1. Ans: 1.1053

Dept of Mathematics, BMSCE Page 1 of 6


Course code: 23MA2BSMCS/MES/MCM Unit-5 Numerical Methods-2

7) Solve y = 3x + y 2 , y (0) = 1 by Taylor’s series method and compute y(0.1) .


Ans:1.1272
8) Using Taylor’s series method, find y(0.1) correct to 3-decimal places given that
dy
= e x − y2 , y ( 0 ) = 1 . Ans:1.005
dx

II Modified Euler’s Method


= f (x, y ) with y ( x0 ) = y0 and taking h as the step length.
dy
Consider
dx
Then x1 = x0 + h , y1 = ?
To find y1 use Modified Euler’s formula which is given below:
y1P = y0 + h f ( x0 , y0 )

y1(1) = y 0 +
h
2
 
f (x0 , y 0 ) + f (x1 , y1E ) where y1(1) is known as the first modified value of y1

 
y1(2 ) = y 0 + f (x0 , y 0 ) + f (x1 , y1(1) ) , y1(2) is known as the second modified value of y1
h
2
 
y1(3) = y 0 + f (x0 , y 0 ) + f (x1 , y1(2 ) ) , y1(3) is known as the third modified value of y1
h
2
.
.
 ( )
y1(n ) = y 0 + f (x0 , y 0 ) + f x1 , y1(n −1) , y1( ) is known as the n th modified value of y1
h
2
n

----------------------------------------------------------------------------------------------------------------
Then, x 2 = x1 + h , y 2 = ?
To find y 2 use Modified Euler’s formula which is given below:
y2P = y1 + h f ( x1 , y1 ) ,

y 2(1) = y1 +
h
2
 
f (x1 , y1 ) + f (x 2 , y 2E ) , y 2(1) is known as the first modified value of y 2

 
y 2(2 ) = y1 + f (x1 , y1 ) + f (x 2 , y 2(1) ) , y2(2) is known as the second modified value of y 2
h
2
 
y 2(3) = y1 + f (x1 , y1 ) + f (x 2 , y 2(2 ) ) , y2(3) is known as the third modified value of y 2
h
2
.
.
 
y 2(n ) = y1 + f (x1 , y1 ) + f (x2 , y 2(n −1) ) , y2(n ) is known as the n th modified value of y 2
h
2
Similarly, we can find the values of y3 , y4 , ...

Dept of Mathematics, BMSCE Page 2 of 6


Course code: 23MA2BSMCS/MES/MCM Unit-5 Numerical Methods-2

Solve the following differential equations using Modified Euler’s method:


1) y = x + y , y ( 0 ) = 1 at x = 0.1 and x = 0.2 with h = 0.1 .
Ans: y(0.1) = 1.1105, y(0.2) = 1.2432
2) y = y + e , y (0) = 0 at x = 0.2 . Take h = 0.2 .
x
Ans: y ( 0.2) = 0.2468
3) y = log ( x + y ) , y ( 0) = 2 at x = 0.4 . Take h = 0.2 .
Ans: y ( 0.2) = 2.0656, y ( 0.4) = 2.1416
4) y = 1 − y, y(0) = 0 at x = 0.1 and x = 0.2 with h = 0.1 .
Ans: y ( 0.1) = 0.095 y ( 0.2) = 0.181
5) y = x + sin y , y ( 0 ) = 1 . Compute y ( 0.2 ) and y ( 0.4 ) .
Ans: y ( 0.2) = 1.2046, y ( 0.4) = 1.4644
6) dy = y − x with the boundary conditions y = 1 when x = 0 , find approximately y for
dx y+x
x = 0.1 Ans: y ( 0.1) = 1.0928

7) Given = x 2 + y and y = 1 when x = 0 . Find an approximate value of y ( 0.1) taking


dy
dx
h = 0.05 . Ans: y ( 0.1) = 2.2352
8) y = x + y and y = 1 when x = 0 for 0.2 ( 0.2) 0.4 .
Ans: y ( 0.2) = 1.2309, y ( 0.4) = 1.5253
9) Intensity of radiation is directly proportional to the amount of remaining radioactive
dy
substance. The differential equation is = −ky , where k = 0.01, t0 = 0, y0 = 100 g .
dt
Determine how much substance will remain at the moment t = 50 sec by Modified Euler’s
method with h = 25.

10) If water is drained from a vertical cylindrical tank by opening a valve at the base, the water
will flow fast when the tank is full and slow down as it continues to drain. As it turns out,
dy
the rate at which the water level drops is : = −k y
dt
where k is a constant depending on the shape of the hole and the cross-sectional area of the
tank and drain hole. The depth of the water y is measured in meters and the time t in minutes.
If the fluid level is initially 3m then determine the depth of the water when t=0.1 min and
0.2 min by taking k = 0.06 .

Dept of Mathematics, BMSCE Page 3 of 6


Course code: 23MA2BSMCS/MES/MCM Unit-5 Numerical Methods-2

11) Assuming the drag is proportional to the square of velocity, we can model the velocity of a
dv c
falling object like a parachutist with the following differential equation: = g − d v2
dt m
where v is velocity, t = time, g is the acceleration due to gravity, c d is a second-order drag
coefficient, m= mass. Solve for the velocity and distance fallen by a 90-kg object with a drag
coefficient of 0.0225 kg/m. if the initial height is 1km.

III Runge-Kutta method of fourth-order


= f (x, y ) with y ( x0 ) = y0 and taking h as the step length.
dy
Consider
dx
Then, x1 = x0 + h , y1 = ?
To find y1 use the Runge-Kutta formula which is given below:

y1 = y0 + k where k = (k1 + 2k 2 + 2k 3 + k 4 ) ,
1
6
 h k   h k 
k1 = h f ( x0 , y0 ) , k 2 = h f  x0 + , y 0 + 1  , k 3 = h f  x0 + , y 0 + 2  ,
 2 2  2 2
k 4 = h f ( x0 + h , y 0 + k 3 ) .
----------------------------------------------------------------------------------------
Then, x 2 = x1 + h , y 2 = ?
To find y 2 use the Runge-Kutta formula which is given below:

where k = (k1 + 2k 2 + 2k 3 + k 4 ) ,
1
y2 = y1 + k
6
 h k   h k 
k1 = h f (x1 , y1 ) , k 2 = h f  x1 + , y1 + 1  , k 3 = h f  x1 + , y1 + 2  ,
 2 2  2 2
k 4 = h f (x1 + h , y1 + k3 ) .
Similarly, we can find the values of y3 , y4 , ...

Dept of Mathematics, BMSCE Page 4 of 6


Course code: 23MA2BSMCS/MES/MCM Unit-5 Numerical Methods-2

Solve the following differential equations using Runge-Kutta method of fourth-order:


1) y = x + y , y ( 0 ) = 1 at x = 0.2 Ans: y(0.2) = 1.2428
2) ( x + y ) y = 1 , y ( 0.4) = 1 at x = 0.5
dy y − x 2 2
3) = with y ( 0 ) = 1 at x = 0.2 and 0.4 . Ans: y(0.2) = 1.196, y(0.4) = 1.3752
dx y 2 + x 2
4) y = x + y 2 , y ( 0) = 1 at x = 0.2 in steps of 0.1 Ans: y(0.1) = 1.1165, y(0.2) = 1.2736
dy 2 xy + e x
5) = with y (1) = 0 at x = 1.2 Ans: y(1.2) = 0.1402
dx x 2 + xe x
6) y = 3x + y 2 at x = 1.1 , given that y = 1.2 when x = 1 Ans: y(1.1) = 1.7278
7) y  = 3x + , y ( 0 ) = 1 at x = 0.2 taking h = 0.1 Ans: y(0.2) = 1.1749
y
2
dy y − x
8) = , y ( 0 ) = 1 at x = 0.2 taking h = 0.2 Ans: y(0.2) = 1.1678
dx y + x
9) Assuming the drag is proportional to the square of velocity, we can model the velocity of a
dv c
falling object like a parachutist with the following differential equation: = g − d v2
dt m
where v is velocity, t = time, g is the acceleration due to gravity, c d is a second-order drag
coefficient, m= mass. Solve for the velocity and distance fallen by a 90-kg object with a drag
coefficient of 0.0225 kg/m. if the initial height is 1km.

IV Milne’s predictor-corrector formula


= f (x, y ) with y ( x0 ) = y0 and taking h as the step length.
dy
Consider
dx
Given y0 = y ( x0 ) , we compute y1 = y ( x0 + h ) , y2 = y ( x0 + 2h ) , y3 = y ( x0 + 3h ) by Euler’s
formula yk +1 = yk + h f ( xk , yk ) . [or values are given by Taylor’s series method or Runge-Kutta
method of Fourth order]
Next we calculate f 0 = f ( x0 , y0 ) , f1 = f ( x1 , y1 ) , f 2 = f ( x2 , y2 ) and f 3 = f ( x3 , y3 ) .
To find y4 :
4h
( 2 f1 − f 2 + 2 f3 ) which is called a Predictor formula.
y4( P ) = y0 +
3
(
Now we find first approximation to f 4 = f x0 + 4h, y4 ( P ) . )
The better value of y4 is found by
h
y4(C ) = y2 + ( f 2 + 4 f3 + f 4 ) which is called a Corrector formula.
3
Then an improved value of f 4 is computed and again the corrector is applied to find a still better
value of y4 remains unchanged. Once y4 and f 4 are obtained to desired degree of accuracy,
4h
y5 = y ( x0 + 5h ) is found from the predictor as y5( P ) = y1 + ( 2 f 2 − f3 + 2 f 4 ) and
3
f5 is calculated. Then a better approximation to the value of y5 is obtained from the corrector
h
y5(C ) = y3 + ( f3 + 4 f 4 + f5 ) .
3

Dept of Mathematics, BMSCE Page 5 of 6


Course code: 23MA2BSMCS/MES/MCM Unit-5 Numerical Methods-2

dy
1) Given = x3 + y, y (0) = 2. The value of y(0.2) = 2.073 , y(0.4) = 2.452 and
dx
y(0.6) = 3.023 are got by Runge-Kutta method of Fourth order. Find y(0.8) by Milne’s
predictor-corrector method taking h = 0.2 . Ans: y(0.8) = 3.795
dy
2) Given 2 = (1 + x 2 ) y 2 and y(0) = 1, y(0.1) = 1.06 , y(0.2) = 1.12, y(0.3) = 1.21, evaluate
dx
y(0.4) by Milne’s predictor-corrector method. Ans: y(0.4) = 1.2797 .
3) From the data given below, find y at x = 1.4 , using Milne’s predictor-corrector formula:
dy y
= x2 + x 1 1.1 1.2 1.3
dx 2
y 2 2.2156 2.4549 2.7514

Ans: y(1.4) = 3.0794


dy
4) If = 2e x − y, y (0) = 2 , y(0.1) = 2.010 , y(0.2) = 2.04 and y(0.3) = 2.09 ; find y(0.4)
dx
using Milne’s predictor-corrector method. Ans: y(0.4) = 2.162
dy
5) Given = xy + y 2 , y (0) = 1. The value of y(0.1) = 1.1169 , y(0.2) = 1.2773 and
dx
y(0.3) = 1.5049 are got by Runge-Kutta method of Fourth order. Find y(0.4) by Milne’s
predictor-corrector method. Ans: y(0.4) = 1.8391 .

6) Given y = x( x 2 + y 2 )e− x , y ( 0 ) = 1, compute y(0.4) by Milne’s predictor-corrector method.


The values of y(0.1) = 1.005 , y(0.2) = 1.018 and y(0.3) = 1.04 are obtained by Taylor’s
series method. Ans: y(0.4) = 1.071

Dept of Mathematics, BMSCE Page 6 of 6

You might also like