Professional Documents
Culture Documents
𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)
𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)
𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)
𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
Numerical Methods Runge-Kutta by Ch.M.Verriyya Naidu is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
EULER’S METHOD
𝑑𝑦
To solve a differential equation of first order of the type = 𝑓 𝑥, 𝑦 , with initial
𝑑𝑥
conditions 𝑦 𝑥0 = 𝑦0 .
The method is used to find the values of 𝑦(𝑥) for different values of 𝑥 at equal
intervals. The length of the interval is ℎ, i.e. ℎ = 𝑥𝑛+1 − 𝑥𝑛 .
In other words, 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥1 + ℎ, 𝑥3 = 𝑥2 + ℎ … etc.
Also 𝑦𝑛 is defined as 𝑦𝑛 = 𝑦 𝑥𝑛 .
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Problem 1
𝑑𝑦
Given = 𝑥, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.1 and find
𝑑𝑥
𝑦 0.1 , 𝑦 0.2 , 𝑦 0.3 and 𝑦 0.4 .
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
Here 𝑓 𝑥, 𝑦 = 𝑥, 𝑥0 = 0, 𝑦0 = 1
n 𝑥𝑛 𝑦𝑛
0 0 1
1 0.1 1.005
2 0.2 1.02
3 0.3 1.045
4 0.4 1.08
Comparison
Actual solution of the differential equation is
𝑥2
𝑦= +1
2
n 𝑥𝑛 𝑦𝑛 (actual) 𝑦𝑛 (approx)
0 0 1 1
1 0.1 1.005 1
2 0.2 1.02 1.01
3 0.3 1.045 1.03
4 0.4 1.08 1.06
Comparison
Actual solution of the differential equation is
𝑥2
𝑦= +1
2
n 𝑥𝑛 𝑦𝑛
0 0 1
1 0.05 1
2 0.1 1.0025
3 0.15 1.0075
4 0.2 1.015
5 0.25 1.025
6 0.3 1.0375
7 0.35 1.0525
8 0.4 1.07
Problem 2
𝑑𝑦
Given = 𝑥, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.05 and find 𝑦 0.4 .
𝑑𝑥
Here 𝑓 𝑥, 𝑦 = 2 − 2𝑦 − 𝑒 −4𝑥 , 𝑥0 = 0, 𝑦0 =0
Problem 3
Given 𝑦 ′ + 2𝑦 = 2 − 𝑒 −4𝑥 , with initial conditions 𝑦 0 = 0. Choose ℎ = 0.01 and
find 𝑦 0.04 . What is the exact value of 𝑦 0.04 ?
Here 𝑓 𝑥, 𝑦 = 2 − 2𝑦 − 𝑒 −4𝑥 , 𝑥0 = 0, 𝑦0 =0
n 𝑥𝑛 𝑦𝑛
0 0 0
1 0.01
2 0.02
3 0.03
4 0.04
Problem 3
Given 𝑦 ′ + 2𝑦 = 2 − 𝑒 −4𝑥 , with initial conditions 𝑦 0 = 0. Choose ℎ = 0.01 and
find 𝑦 0.04 . What is the exact value of 𝑦 0.04 ?
Here 𝑓 𝑥, 𝑦 = 2 − 2𝑦 − 𝑒 −4𝑥 , 𝑥0 = 0, 𝑦0 =0
n 𝑥𝑛 𝑦𝑛
0 0 0
1 0.01 0.01
2 0.02
3 0.03
4 0.04
Problem 3
Given 𝑦 ′ + 2𝑦 = 2 − 𝑒 −4𝑥 , with initial conditions 𝑦 0 = 0. Choose ℎ = 0.01 and
find 𝑦 0.04 . What is the exact value of 𝑦 0.04 ?
Here 𝑓 𝑥, 𝑦 = 2 − 2𝑦 − 𝑒 −4𝑥 , 𝑥0 = 0, 𝑦0 =0
n 𝑥𝑛 𝑦𝑛
0 0 0
1 0.01 0.01
2 0.02 0.020192
3 0.03
4 0.04
Problem 3
Given 𝑦 ′ + 2𝑦 = 2 − 𝑒 −4𝑥 , with initial conditions 𝑦 0 = 0. Choose ℎ = 0.01 and
find 𝑦 0.04 . What is the exact value of 𝑦 0.04 ?
Here 𝑓 𝑥, 𝑦 = 2 − 2𝑦 − 𝑒 −4𝑥 , 𝑥0 = 0, 𝑦0 =0
n 𝑥𝑛 𝑦𝑛
0 0 0
1 0.01 0.01
2 0.02 0.020192
3 0.03 0.030557
4 0.04 0.041077
Comparison
Actual solution of the differential equation is
1 −4𝑥 3 −2𝑥
𝑦 =1+ 𝑒 − 𝑒
2 2
n 𝑥𝑛 𝑦𝑛 (actual)
0 0 0
1 0.01 0.010097
2 0.02 0.020374
3 0.03 0.030813
4 0.04 0.041397
Comparison
Actual solution of the differential equation is
1 −4𝑥 3 −2𝑥
𝑦 =1+ 𝑒 − 𝑒
2 2
Here 𝑓 𝑥, 𝑦 = , 𝑥0 = , 𝑦0 =
Problem 4
Given 𝑥 + 1 𝑑𝑦 = 𝑦 − 1 𝑑𝑥, with initial conditions 𝑦 0.5 = 2.5. Choose ℎ = 0.025
and find 𝑦 0.6 . Compare with the exact value of 𝑦 0.6 .
𝑦−1
Here 𝑓 𝑥, 𝑦 = , 𝑥0 = 0.5, 𝑦0 = 2.5
𝑥+1
Problem 4
Given 𝑥 + 1 𝑑𝑦 = 𝑦 − 1 𝑑𝑥, with initial conditions 𝑦 0.5 = 2.5. Choose ℎ = 0.025
and find 𝑦 0.6 . Compare with the exact value of 𝑦 0.6 .
𝑦−1
Here 𝑓 𝑥, 𝑦 = , 𝑥0 = 0.5, 𝑦0 = 2.5
𝑥+1
𝑦𝑛 = 𝑥𝑛 + 2
n 𝑥𝑛 𝑦𝑛 (approx) (actual) % error
0 0.5 2.5 2.5 0
1 0.525 2.525 2.525 0
2 0.55 2.55 2.55 0
3 0.575 2.575 2.575 0
4 0.6 2.6 2.6 0
RUNGE-KUTTA’S METHOD
1. Second order
1
𝑦𝑛+1 = 𝑦𝑛 + 𝑘1 + 𝑘2
2
where 𝑘1 = ℎ𝑓 𝑥𝑛 , 𝑦𝑛
𝑘2 = ℎ𝑓 𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘1
2. Fourth order
1
𝑦𝑛+1 = 𝑦𝑛 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥𝑛 , 𝑦𝑛
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥𝑛 + , 𝑦𝑛 +
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥𝑛 + , 𝑦𝑛 +
2 2
𝑘4 = ℎ𝑓 𝑥𝑛 + ℎ, 𝑦𝑛 + 𝑘3
Problem 1
𝑑𝑦
Given = 𝑥 + 𝑦, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.1 and find
𝑑𝑥
𝑦 0.1 , 𝑦 0.2 and 𝑦 0.3 using Runge-Kutta’s method of fourth order.
Problem 1
𝑑𝑦
Given = 𝑥 + 𝑦, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.1 and find
𝑑𝑥
𝑦 0.1 , 𝑦 0.2 and 𝑦 0.3 using Runge-Kutta’s method of fourth order.