You are on page 1of 48

INITIAL VALUE PROBLEM

(FIRST ORDER DIFFERENTIAL EQUATIONS)

A differential equation equipped with initial values (or conditions) is


called an initial value problem.

𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)

A differential equation equipped with initial values (or conditions) is


called an initial value problem.

𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)

A differential equation equipped with initial values (or conditions) is


called an initial value problem.

𝑑𝑦
A differential equation of first order is of the type = 𝑓(𝑥, 𝑦).
𝑑𝑥
INITIAL VALUE PROBLEM
(FIRST ORDER DIFFERENTIAL EQUATIONS)

A differential equation equipped with initial values (or conditions) is


called an initial value problem.

𝑑𝑦
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 𝑦𝑛 = 𝑦 𝑥𝑛 .

Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )

ℎ will be provided or need to be chosen. Smaller the value of ℎ, more accurate is


the answer and less is the error committed.
Problem 1
𝑑𝑦
Given = 𝑥, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.1 and find
𝑑𝑥
𝑦 0.1 , 𝑦 0.2 , 𝑦 0.3 and 𝑦 0.4 .
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
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4


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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 =
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0 = 1 + 0 = 1
𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0 = 1 + 0 = 1
𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦1 = 1 + 0.1 𝑥1 = 1 + (0.1)(0.1) = 1.01
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0 = 1 + 0 = 1
𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦1 = 1 + 0.1 𝑥1 = 1 + (0.1)(0.1) = 1.01
𝑦3 = ??
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0 = 1 + 0 = 1
𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦1 = 1 + 0.1 𝑥1 = 1 + (0.1)(0.1) = 1.01
𝑦3 = 1.03
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

𝑥1 = 𝑥0 + ℎ = 0 + 0.1 = 0.1, 𝑥2 = 𝑥1 + ℎ = 0.2, 𝑥3 = 𝑥2 + ℎ = 0.3, 𝑥4 = 0.4

Using Euler’s Method: 𝑦 𝑥𝑛+1 𝑖. 𝑒. 𝑦𝑛+1 = 𝑦𝑛 + ℎ𝑓(𝑥𝑛 , 𝑦𝑛 )


𝑦1 = 𝑦0 + ℎ𝑓 𝑥0 , 𝑦0 = 1 + 0.1 𝑥0 = 1 + 0 = 1
𝑦2 = 𝑦1 + ℎ𝑓 𝑥1 , 𝑦1 = 1 + 0.1 𝑥1 = 1 + (0.1)(0.1) = 1.01
𝑦3 = 1.03, 𝑦4 =1.06
Comparison
Actual solution of the differential equation is
𝑥2
𝑦= +1
2

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 𝑥𝑛 𝑦𝑛 (actual) 𝑦𝑛 (approx) % error


0 0 1 1 0
1 0.1 1.005 1 0.497512
2 0.2 1.02 1.01 0.980392
3 0.3 1.045 1.03 1.435407
4 0.4 1.08 1.06 1.851852
Problem 2
𝑑𝑦
Given = 𝑥, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.05 and find 𝑦 0.4 .
𝑑𝑥
Problem 2
𝑑𝑦
Given = 𝑥, with initial conditions 𝑦 0 = 1. Choose ℎ = 0.05 and find 𝑦 0.4 .
𝑑𝑥

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 .
𝑑𝑥

n 𝑥𝑛 𝑦𝑛 (actual) 𝑦𝑛 (approx) % error


0 0 1 1 0
1 0.05 1.00125 1 0.124844
2 0.1 1.005 1.0025 0.248756
3 0.15 1.01125 1.0075 0.370828
4 0.2 1.02 1.015 0.490196
5 0.25 1.03125 1.025 0.606061
6 0.3 1.045 1.0375 0.717703
7 0.35 1.06125 1.0525 0.824499
8 0.4 1.08 1.07 0.925926
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 ?
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
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

n 𝑥𝑛 𝑦𝑛 (approx) 𝑦𝑛 (actual) % error


0 0 0 0
1 0.01 0.01 0.010097 0.957833
2 0.02 0.020192 0.020374 0.892847
3 0.03 0.030557 0.030813 0.831839
4 0.04 0.041077 0.041397 0.774497
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 .
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 .

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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥0 , 𝑦0 = 0.1 0 + 1 = 0.1
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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥0 , 𝑦0 = 0.1 0 + 1 = 0.1
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.05 = 0.11
2 2
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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥0 , 𝑦0 = 0.1 0 + 1 = 0.1
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.05 = 0.11
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.055 = 0.1105
2 2
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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥0 , 𝑦0 = 0.1 0 + 1 = 0.1
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.05 = 0.11
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.055 = 0.1105
2 2
𝑘4 = ℎ𝑓 𝑥0 + ℎ, 𝑦0 + 𝑘3 = 0.1 0.1 + 1.1105 = 0.12105
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.

Putting 𝑛 = 0 in Runge-Kutta’s formula for fourth order, we get


1
𝑦1 = 𝑦0 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥0 , 𝑦0 = 0.1 0 + 1 = 0.1
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.05 = 0.11
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥0 + , 𝑦0 + = 0.1 0.05 + 1.055 = 0.1105
2 2
𝑘4 = ℎ𝑓 𝑥0 + ℎ, 𝑦0 + 𝑘3 = 0.1 0.1 + 1.1105 = 0.12105
1
𝑦 0.1 = 𝑦1 = 1 + 0.1 + 0.22 + 0.221 + 0.12105 =1.11034
6
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥1 , 𝑦1 = 0.1 0.1 + 1.11034 = 0.12103
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥1 , 𝑦1 = 0.1 0.1 + 1.11034 = 0.12103
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13208
2 2
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥1 , 𝑦1 = 0.1 0.1 + 1.11034 = 0.12103
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13208
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13263
2 2
𝑘4 = ℎ𝑓 𝑥1 + ℎ, 𝑦1 + 𝑘3 = 0.14429
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥1 , 𝑦1 = 0.1 0.1 + 1.11034 = 0.12103
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13208
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13263
2 2
𝑘4 = ℎ𝑓 𝑥1 + ℎ, 𝑦1 + 𝑘3 = 0.14429
𝑦 0.2 = 𝑦2 = 1.2428
Putting 𝑛 = 1 in Runge-Kutta’s formula for fourth order, we get
1
𝑦2 = 𝑦1 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4
6
where 𝑘1 = ℎ𝑓 𝑥1 , 𝑦1 = 0.1 0.1 + 1.11034 = 0.12103
ℎ 𝑘1
𝑘2 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13208
2 2
ℎ 𝑘2
𝑘3 = ℎ𝑓 𝑥1 + , 𝑦1 + = 0.13263
2 2
𝑘4 = ℎ𝑓 𝑥1 + ℎ, 𝑦1 + 𝑘3 = 0.14429
𝑦 0.2 = 𝑦2 = 1.2428

𝑛 = 2 will give 𝑦 0.3 = 1.399711

𝑘1 = 0.14428, 𝑘2 = 0.156494, 𝑘3 = 0.157105, 𝑘4 = 0.169990

You might also like