Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
370 views7 pages

Modified Euler's Method and RK Method

This document discusses Runge-Kutta's method of fourth order to solve differential equations. It presents the formulas for the second and fourth order methods. As an example, it applies the fourth order method to solve the differential equation dy/dx = x + y with initial conditions y(0) = 1. It calculates the solutions y(0.1), y(0.2), and y(0.3) by iterating the Runge-Kutta formula with a step size h = 0.1.

Uploaded by

Devarsh Sohagia
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)
370 views7 pages

Modified Euler's Method and RK Method

This document discusses Runge-Kutta's method of fourth order to solve differential equations. It presents the formulas for the second and fourth order methods. As an example, it applies the fourth order method to solve the differential equation dy/dx = x + y with initial conditions y(0) = 1. It calculates the solutions y(0.1), y(0.2), and y(0.3) by iterating the Runge-Kutta formula with a step size h = 0.1.

Uploaded by

Devarsh Sohagia
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/ 7

Scanned with CamScanner

Scanned with CamScanner


Scanned with CamScanner
Scanned with CamScanner
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.

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
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