0% found this document useful (0 votes)
20 views47 pages

MA3251 Unit 5

Uploaded by

Mugunthan Kannan
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)
20 views47 pages

MA3251 Unit 5

Uploaded by

Mugunthan Kannan
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/ 47

MA3251- Statistics and Numerical Methods

UNIT V NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS


Single step methods: Taylor’s series method - Euler’s method - Modified Euler’s method -
Fourth order Runge-Kutta method for solving first order differential equations - Multi step
methods: Milne’s and Adams - Bash forth predictor corrector methods for solving first order
differential equations.
Single step methods:
Taylor’s series method:
𝑑𝑦
Consider a first order ODE as: 𝑑𝑥 = 𝑦 ′ = 𝑓(𝑥, 𝑦) with I.C 𝑦 𝑥0 = 𝑦0 .
This is an initial value problem.
Then, the Taylor’s series expansion of 𝑦(𝑥) around the point 𝑥 = 𝑥0 + ℎ is
𝒉 𝒉𝟐 𝒉𝟑 𝒉𝒏
𝒚 𝒙 = 𝒚 𝒙𝟎 + 𝒉 = 𝒚𝟎 + 𝟏! 𝒚𝟎 ′ + 𝟐! 𝒚𝟎 ′′ + 𝟑! 𝒚𝟎 ′′′ + ⋯ . . + 𝒏! 𝒚𝟎 (𝒏) + ⋯ … … ..
Where, ℎ = 𝑥 − 𝑥0 ; 𝑦0 = 𝑦(𝑥0 ); 𝑦0 ′ = 𝑦(𝑥0 ) etc.
The above series has to be truncated to get an approximate solution as a polynomial.
If the series truncates after "𝑛" terms, then the error is given by
ℎ𝑛
𝐸 = 𝑛! 𝑦0 𝑛 (𝜀) ≈ 𝑂(ℎ𝑛 ), 𝑥 ≤ 𝜀 ≤ 𝑥 + ℎ (or)
𝐸 = 𝐾ℎ𝑛 , where 𝐾 is a constant.
The truncation error is 𝑂(ℎ𝑛 ).
The Taylor’s series is said to be of order(𝑛 − 1).
Now, taking 𝑥1 = 𝑥0 + ℎ and 𝑦 𝑥1 = 𝑦1 , we have
𝒉 𝒉𝟐 𝒉𝟑 𝒉𝒏
𝒚𝟏 = 𝒚𝟎 + 𝟏! 𝒚𝟎 ′ + 𝟐! 𝒚𝟎 ′′ + 𝟑! 𝒚𝟎 ′′′ + ⋯ . . + 𝒏! 𝒚𝟎 (𝒏) + ⋯ … … ..
Taking 𝑥2 = 𝑥1 + ℎ and 𝑦 𝑥2 = 𝑦2 , we have
𝒉 𝒉𝟐 𝒉𝟑 𝒉𝒏
𝒚𝟐 = 𝒚𝟏 + 𝟏! 𝒚𝟏 ′ + 𝒚 ′′ + 𝒚 ′′′ + ⋯ . . + 𝒏! 𝒚𝟏 (𝒏) + ⋯ … … ..
𝟐! 𝟏 𝟑! 𝟏
In general,
𝒉 𝒉𝟐 𝒉𝟑 𝒉𝒏
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝟏! 𝒚𝒏 ′ + 𝒚 ′′ + 𝒚 ′′′ + ⋯ . . + 𝒏! 𝒚𝒏 (𝒏) + ⋯ … … ..
𝟐! 𝒏 𝟑! 𝒏
𝑑𝑦
1. Given that 𝑑𝑥 = 𝑥 2 + 𝑦 2 , 𝑦 1 = 2, find 𝑦(1.1) using Taylor’s series method of the fourth
order.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 1
2. Find 𝑦 0.1 = 0 (correct to four decimal places), using Taylor’s series expansion, given
that 𝑦 ′ = 𝑥 2 + 𝑦 2 , 𝑦 0 = 1.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 2
3. Solve:𝑦 ′ = 𝑦 2 + 𝑥, 𝑦 0 = 1. Apply Taylor series method of order 4 to find 𝑦(0.2) and
𝑦(0.4).
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 3
Dr.V.Nirmala,AP/Maths,UCET Page 4
4. Find by Taylor’s series method, the values of 𝑦 at 𝑥 = 0.1 & 𝑥 = 0.2, to four decimal
𝑑𝑦
places from 𝑑𝑥 = 𝑥 2 𝑦 − 1, 𝑦 0 = 1.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 5
Dr.V.Nirmala,AP/Maths,UCET Page 6
Euler’s Method
𝑑𝑦
Consider 𝑑𝑥 = 𝑦 ′ = 𝑓(𝑥, 𝑦), with 𝑦 𝑥0 = 𝑦0 .
Now, taking 𝑥1 = 𝑥0 + ℎ and 𝑦 𝑥1 = 𝑦1 ,
The Euler’s algorithm to find 𝑦1 is given by
𝒚𝟏 = 𝒚𝟎 + 𝒉𝒇(𝒙𝟎 , 𝒚𝟎 ) .
Similarly, 𝒚𝟐 = 𝒚𝟏 + 𝒉𝒇(𝒙𝟏 , 𝒚𝟏 )
In general,
𝒚𝒏+𝟏 = 𝒚𝒏 + 𝒉𝒇(𝒙𝒏 , 𝒚𝒏 )
𝑑𝑦 𝑦−𝑥
1. Given 𝑑𝑥 = 𝑦+𝑥 , with the boundary conditions 𝑦 = 1 for 𝑥 = 0, find 𝑦(0.1).
Solution:

2. Given 𝑦 ′ = 1 + 𝑥𝑦, with the boundary conditions 𝑦 2 = 0, find 𝑦(2.2)with step size 0.1.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 7
3.Given 𝑦 ′ = 𝑦𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥, with the boundary conditions 𝑦 0 = 0, find 𝑦(0.2).
Solution:

4. Given 𝑦 ′ = 𝑦 + 𝑒 𝑥 , with the boundary conditions 𝑦 0 = 0, find 𝑦(0.2) and 𝑦(0.4).


Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 8
Modified Euler’s Method
The Modified Euler’s formula is given by:
ℎ 𝑘
𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓 𝑥𝑛 + , 𝑦𝑛 + 1 , where 𝑘1 = ℎ𝑓 𝑥𝑛 , 𝑦𝑛 .
2 2
1. Given, 𝑦 ′ = 𝑦 2 + 1, 𝑦 = 0 at 𝑥 = 0, find 𝑦(0.2) and 𝑦(0.4).
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 9
2𝑥
2. Given, 𝑦 ′ = 𝑦 − , 𝑦 = 1 at 𝑥 = 0, find 𝑦(0.1) and 𝑦(0.2).
𝑦
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 10
Fourth order Runge-Kutta method for first order ODEs
The 4th order Runge-Kutta formula is given by
1
𝑦𝑛+1 = 𝑦𝑛 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 , where
6
𝑘1 = ℎ𝑓 𝑥𝑛 , 𝑦𝑛 ;
ℎ 𝑘
𝑘2 = ℎ𝑓 𝑥𝑛 + 2 , 𝑦𝑛 + 21 ;
ℎ 𝑘
𝑘3 = ℎ𝑓 𝑥𝑛 + 2 , 𝑦𝑛 + 22 ;
𝑘4 = ℎ𝑓 𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3 .
𝑑𝑦
1. Use Runge-Kutta method of order 4 to find 𝑦(0.2), given that 𝑦 𝑑𝑥 = 𝑦 2 − 𝑥, 𝑦 0 = 2, by
taking ℎ = 0.2.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 11
𝑑𝑦 1
2. Use Runge-Kutta method of order 4 to find 𝑦(0.2), given that 𝑑𝑥 = 𝑥+𝑦 , 𝑦 0 = 1.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 12
3. Find the values of 𝑦(0.2) and 𝑦(0.4), using Runge-Kutta method of order 4 with ℎ = 0.2,
𝑑𝑦
given that 𝑑𝑥 = 𝑥 2 + 𝑦; 𝑦 0 = 0.8.

Dr.V.Nirmala,AP/Maths,UCET Page 13
Dr.V.Nirmala,AP/Maths,UCET Page 14
4. Find the values of 𝑦(1.1) and 𝑦(1.2), using Runge-Kutta method of order 4, given that
𝑑𝑦
= 𝑦 2 + 𝑥𝑦; 𝑦 1 = 1.
𝑑𝑥

Dr.V.Nirmala,AP/Maths,UCET Page 15
Dr.V.Nirmala,AP/Maths,UCET Page 16
5. Find the values of 𝑦(1.2) and 𝑦(1.4), using Runge-Kutta method of order 4 with ℎ = 0.2,
𝑑𝑦
given that 𝑑𝑥 = 𝑥𝑦; 𝑦 1 = 2.

Dr.V.Nirmala,AP/Maths,UCET Page 17
Dr.V.Nirmala,AP/Maths,UCET Page 18
6. Find the values of 𝑦(0.1) and 𝑦(0.2), using Runge-Kutta method of order 4, given that
𝑑𝑦
= 𝑦 2 + 𝑥𝑦; 𝑦 0 = 1.
𝑑𝑥

Dr.V.Nirmala,AP/Maths,UCET Page 19
Dr.V.Nirmala,AP/Maths,UCET Page 20
7. Apply the Runge-Kutta method to find the approximate value of 𝑦 for 𝑥 = 0.2. in steps of
𝑑𝑦
0.1, if 𝑑𝑥 = 𝑥 + 𝑦 2 , 𝑦 = 1 when 𝑥 = 0.

Dr.V.Nirmala,AP/Maths,UCET Page 21
Dr.V.Nirmala,AP/Maths,UCET Page 22
Multistep Methods
Milne’s Predictor-Corrector Method
Consider the IVP 𝑦 ′ = 𝑓(𝑥, 𝑦) with boundary conditions :
𝑦 𝑥0 = 𝑦0 ; 𝑦 𝑥1 = 𝑦1 ; 𝑦 𝑥2 = 𝑦2 ; 𝑦 𝑥3 = 𝑦3 .
Then, Milne’s Predictor formula to find 𝑦 𝑥4 = 𝑦4 is:
𝟒𝒉
𝒚𝟒,𝒑 = 𝒚𝟎 + 𝟑 𝟐𝒚′𝟏 − 𝒚′𝟐 + 𝟐𝒚′𝟑
And the Milne’s Corrector formula to find 𝑦 𝑥4 = 𝑦4 is:
𝒉
𝒚𝟒,𝒄 = 𝒚𝟐 + 𝟑 𝒚′𝟐 + 𝟒𝒚′𝟑 + 𝒚′𝟒
In general, the Milne’s Predictor –Corrector formula is:
𝟒𝒉
𝒚𝒏+𝟏,𝒑 = 𝒚𝒏−𝟑 + 𝟑 𝟐𝒚′𝒏−𝟐 − 𝒚′𝒏−𝟏 + 𝟐𝒚′𝒏 and
𝒉
𝒚𝒏+𝟏,𝒄 = 𝒚𝒏−𝟏 + 𝟑 𝒚′𝒏−𝟏 + 𝟒𝒚′𝒏 + 𝒚′𝒏+𝟏 .
1
1. Given, 𝑦 ′ = 2 1 + 𝑥 2 𝑦 2 , 𝑦 0 = 1, 𝑦 0.1 = 1.06, 𝑦 0.2 = 1.12, 𝑦 0.3 = 1.21.
Compute𝑦 0.4 , using Milne’s Predictor-Corrector formula.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 23
1
2. Given, 𝑦 ′ = 𝑥+𝑦 , 𝑦 0 = 2,𝑦 0.2 = 2.09, 𝑦 0.4 = 2.17 and 𝑦 0.6 = 2.24. Find 𝑦 0.8
using Milne’s method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 24
3. Given, 5𝑥𝑦 ′ + 𝑦 2 = 2, 𝑦 4 = 1, 𝑦 4.1 = 1.0049, 𝑦 4.2 = 1.0097, 𝑦 4.3 = 1.0143,
compute 𝑦 4.4 using Milne’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 25
4. Given, 𝑦 ′ = 𝑥𝑦(1 + 𝑦), 𝑦 −0.2 = 1.0412,𝑦 −0.1 = 1.0108, 𝑦 0 = 1, 𝑦 0.1 =
1.0108, compute 𝑦 0.2 using Milne’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 26
𝑑𝑦
5. Solve 𝑑𝑥 = 𝑦 − 𝑥 2 at 𝑥 = 0.8 by Milne’s Predictor and Corrector method, given
𝑦 0 = 1, 𝑦 0.2 = 1.12186, 𝑦 0.4 = 1.46820, 𝑦 0.6 = 1.7379.

Dr.V.Nirmala,AP/Maths,UCET Page 27
𝑑𝑦
6. Given, 𝑑𝑥 = 𝑥𝑦 + 𝑦 2 , 𝑦 0 = 1, 𝑦 0.1 = 1.1169, 𝑦 0.2 = 1.2773,find 𝑦 0.3 by R-K
method of order four and hence find 𝑦 4.4 using Milne’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 28
Dr.V.Nirmala,AP/Maths,UCET Page 29
𝑑𝑦
7. Given that 𝑑𝑥 = 𝑥 − 𝑦 2 , 𝑦 0 = 0, find 𝑦 0.2 , 𝑦 0.4 , 𝑦 0.6 using Taylor’s series
method of the third order. Also find 𝑦 0.8 using Milne’s method.

Dr.V.Nirmala,AP/Maths,UCET Page 30
Dr.V.Nirmala,AP/Maths,UCET Page 31
8. Given, 𝑦 ′ = 𝑥 + 𝑦, with the initial condition 𝑥0 = 0,𝑦0 = 1 , solve 𝑦 for 𝑥 = 0 𝑡𝑜 𝑥 = 0.3,
by Euler’s method and hence for 𝑥 = 0.4 using Milne’s method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 32
Dr.V.Nirmala,AP/Maths,UCET Page 33
𝑑𝑦
9. Given 𝑑𝑥 = 𝑥 𝑥 2 + 𝑦 2 𝑒 −𝑥 , 𝑦 0 = 1, find 𝑦 at 𝑥 = 0.1,0.2,0.3 by Taylor’s series method
and compute 𝑦(0.4) by Milne’s method.

Dr.V.Nirmala,AP/Maths,UCET Page 34
Dr.V.Nirmala,AP/Maths,UCET Page 35
Adam’s or Adam-Bashforth Predictor-Corrector Method
Consider the IVP 𝑦 ′ = 𝑓(𝑥, 𝑦) with boundary conditions 𝑦 𝑥0 = 𝑦0 ; 𝑦 𝑥1 = 𝑦1 ; 𝑦 𝑥2 =
𝑦2 ; 𝑦 𝑥3 = 𝑦3 .
Then, Adam’s Predictor formula to find 𝑦 𝑥4 = 𝑦4 is:
𝒉
𝒚𝟒,𝒑 = 𝒚𝟑 + 𝟐𝟒 𝟓𝟓𝒚′𝟑 − 𝟓𝟗𝒚′𝟐 + 𝟑𝟕𝒚′𝟏 − 𝟗𝒚′𝟎
And the Adam’s Corrector formula to find 𝑦 𝑥4 = 𝑦4 is:
𝒉
𝒚𝟒,𝒄 = 𝒚𝟑 + 𝟐𝟒 𝟗𝒚′𝟒 + 𝟏𝟗𝒚′𝟑 − 𝟓𝒚′𝟐 + 𝒚′𝟏
In general, the Adam’s Predictor –Corrector formula is:
𝒉
𝒚𝒏+𝟏,𝒑 = 𝒚𝒏 + 𝟐𝟒 𝟓𝟓𝒚′𝒏 − 𝟓𝟗𝒚′𝒏−𝟏 + 𝟑𝟕𝒚′𝒏−𝟐 − 𝟗𝒚′𝒏−𝟑 and
𝒉
𝒚𝒏+𝟏,𝒄 = 𝒚𝒏−𝟏 + 𝟐𝟒 𝟗𝒚′𝒏+𝟏 + 𝟏𝟗𝒚′𝒏 − 𝟓𝒚′𝒏−𝟏 + 𝒚′𝒏−𝟐 .
1
1. Given, 𝑦 ′ = 2 1 + 𝑥 2 𝑦 2 , 𝑦 0 = 1, 𝑦 0.1 = 1.06, 𝑦 0.2 = 1.12, 𝑦 0.3 = 1.21.
Compute 𝑦 0.4 , using Adam’s Predictor-Corrector formula.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 36
1
2. Given, 𝑦 ′ = 𝑥+𝑦 , 𝑦 0 = 2,𝑦 0.2 = 2.09, 𝑦 0.4 = 2.17 and 𝑦 0.6 = 2.24. Find 𝑦 0.8
using Adam’s method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 37
3. Given, 5𝑥𝑦 ′ + 𝑦 2 = 2, 𝑦 4 = 1, 𝑦 4.1 = 1.0049, 𝑦 4.2 = 1.0097, 𝑦 4.3 = 1.0143,
compute 𝑦 4.4 using Adam’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 38
4. Given, 𝑦 ′ = 𝑥𝑦(1 + 𝑦), 𝑦 −0.2 = 1.0412,𝑦 −0.1 = 1.0108, 𝑦 0 = 1, 𝑦 0.1 =
1.0108, compute 𝑦 0.2 using Adam’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 39
𝑑𝑦
5. Solve 𝑑𝑥 = 𝑦 − 𝑥 2 at 𝑥 = 0.8 by Adam’s Predictor and Corrector method, given
𝑦 0 = 1, 𝑦 0.2 = 1.12186, 𝑦 0.4 = 1.46820, 𝑦 0.6 = 1.7379.

Dr.V.Nirmala,AP/Maths,UCET Page 40
𝑑𝑦
6. Given, 𝑑𝑥 = 𝑥𝑦 + 𝑦 2 , 𝑦 0 = 1, 𝑦 0.1 = 1.1169, 𝑦 0.2 = 1.2773,find 𝑦 0.3 by R-K
method of order four and hence find 𝑦 4.4 using Adam’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 41
Dr.V.Nirmala,AP/Maths,UCET Page 42
𝑑𝑦
7. Given that 𝑑𝑥 = 𝑥 − 𝑦 2 , 𝑦 0 = 0, find 𝑦 0.2 , 𝑦 0.4 , 𝑦 0.6 using Taylor’s series
method of the third order. Also find 𝑦 0.8 using Adam’s Method.

Dr.V.Nirmala,AP/Maths,UCET Page 43
Dr.V.Nirmala,AP/Maths,UCET Page 44
8. Given, 𝑦 ′ = 𝑥 + 𝑦, with the initial condition 𝑥0 = 0,𝑦0 = 1 , solve 𝑦 for 𝑥 = 0 𝑡𝑜 𝑥 = 0.3,
by Euler’s method and hence for 𝑥 = 0.4 using Adam’s Method.
Solution:

Dr.V.Nirmala,AP/Maths,UCET Page 45
Dr.V.Nirmala,AP/Maths,UCET Page 46
𝑑𝑦
9. Given 𝑑𝑥 = 𝑥 𝑥 2 + 𝑦 2 𝑒 −𝑥 , 𝑦 0 = 1, find 𝑦 at 𝑥 = 0.1,0.2,0.3 by Taylor’s series method
and compute 𝑦(0.4) by Adam’s Method.

Dr.V.Nirmala,AP/Maths,UCET Page 47

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy