0% found this document useful (0 votes)
115 views10 pages

Runge-Kutta 4th Order Method Guide

This document discusses numerical methods for solving ordinary differential equations using the Runge-Kutta 4th order method. It introduces the Taylor series expansion that the Runge-Kutta method is based on. It then presents the general form of the 4th order Runge-Kutta method and provides examples of both the Runge and Kutta implementations. An example problem is worked through step-by-step to demonstrate how to apply the 4th order Runge-Kutta method to find successive approximations to the solution of a given differential equation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views10 pages

Runge-Kutta 4th Order Method Guide

This document discusses numerical methods for solving ordinary differential equations using the Runge-Kutta 4th order method. It introduces the Taylor series expansion that the Runge-Kutta method is based on. It then presents the general form of the 4th order Runge-Kutta method and provides examples of both the Runge and Kutta implementations. An example problem is worked through step-by-step to demonstrate how to apply the 4th order Runge-Kutta method to find successive approximations to the solution of a given differential equation.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

ORDINARY DIFFERENTIAL

EQUATIONS

NUMERICAL METHODS
MATH 134

Engr. CHRISTOPHER S. PALADIO


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD
𝑑𝑦
= 𝑓 𝑥, 𝑦 𝑦 0 = 𝑦0
𝑑𝑥
From Taylor Series Expansion
𝑑𝑦 1 𝑑2 𝑦 1 𝑑3 𝑦
𝑦𝑖+1 = 𝑦𝑖 + ቓ 𝑥𝑖+1 − 𝑥𝑖 + ቓ 𝑥𝑖+1 − 𝑥𝑖 2 + ቓ 𝑥𝑖+1 − 𝑥𝑖 3 +
𝑑𝑥 𝑥𝑖 ,𝑦𝑖 2! 𝑑𝑥 2 𝑥𝑖 ,𝑦𝑖 3! 𝑑𝑥 3 𝑥𝑖 ,𝑦𝑖
1 𝑑4 𝑦
ቓ 𝑥𝑖+1 − 𝑥𝑖 4 +…
4! 𝑑𝑥 4 𝑥𝑖 ,𝑦𝑖

1 ′ 1 ′′ 1 ′′′
𝑦𝑖+1 = 𝑦𝑖 + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ4
2 3
2! 3! 4!

Engr. CHRISTOPHER S. PALADIO ASCOT


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD

𝑦𝑖+1 = 𝑦𝑖 + 𝑎1 𝑘1 + 𝑎2 𝑘2 + 𝑎3 𝑘3 + 𝑎4 𝑘4 ℎ

RK4 Method - Runge

1
𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ℎ
6
1 1
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 ) 𝑘3 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘2 ℎ)
2 2
1 1
𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ) 𝑘4 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘3 ℎ)
2 2
Engr. CHRISTOPHER S. PALADIO ASCOT
ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD

RK4 Method - Kutta

1
𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 3𝑘2 + 3𝑘3 + 𝑘4 ℎ
8
2 1
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 ) 𝑘3 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 − 𝑘1 ℎ +𝑘2 ℎ)
3 3
1 1
𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ) 𝑘4 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ − 𝑘2 ℎ + 𝑘3 ℎ)
3 3

Engr. CHRISTOPHER S. PALADIO ASCOT


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD

 EXAMPLE

𝑑𝑦
Solve 𝑦 3 in the equation = 3𝑒 −𝑥 − 0.4𝑦 with initial
𝑑𝑥
condition of 𝑦 0 = 5 and h = 1.5

Engr. CHRISTOPHER S. PALADIO ASCOT


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD
1 1 1 1
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 ) 𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ) 𝑘3 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘2 ℎ) 𝑘4 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘3 ℎ)
2 2 2 2
𝑑𝑦
= 3𝑒 −𝑥 − 0.4𝑦 𝑥0 = 0 𝑦0 = 5
𝑑𝑥

𝑘1 = 𝑓 0,5 = 3𝑒 −0 − 0.4 5 = 1 𝑘3 = 𝑓 0.75, 4.3378


1 1
𝑘2 = 𝑓(0 + (1.5), 5 + (1)(1.5)) 𝑘3 = 3𝑒 −0.75 − 0.4 4.3378 = −0.3180
2 2

𝑘2 = 𝑓(0.75, 5.75) 𝑘4 = 𝑓(0 + (1.5), 5 + (−0.3180)(1.5)

𝑘2 = 3𝑒 −0.75 − 0.4 5.75 = −0.8829 𝑘4 = 𝑓(1.5, 4.523)


1 1
𝑘3 = 𝑓(0 + (1.5), 5 + (−0.8829)(1.5)) 𝑘4 = 3𝑒 −1.5 − 0.4 4.523 = −1.1398
2 2
Engr. CHRISTOPHER S. PALADIO ASCOT
ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD
1
𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ℎ
6
𝑘1 = 1 𝑘2 = −0.8829 𝑘3 = −0.3180 𝑘4 = −1.1398

1
𝑦1 = 5 + 1 + 2 −0.8829 + 2 −0.3180 + (−1.1398 (1.5)
6

𝑦1 = 𝑦 1.5 = 4.3646

Engr. CHRISTOPHER S. PALADIO ASCOT


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD
𝑥1 = 1.5 𝑦1 = 4.3646

𝑘1 = 𝑓 1.5,4.3646 = 3𝑒 −1.5 − 0.4 4.3646 𝑘3 = 𝑓 2.25, 3.5346

𝑘1 = −1.0764 𝑘3 = 3𝑒 −2.25 − 0.4 3.5346 = −1.0976


1 1
𝑘2 = 𝑓(1.5 + (1.5), 4.3646 + (−1.0764)(1.5))
2 2
𝑘2 = 𝑓(2.25, 3.5573) 𝑘4 = 𝑓(1.5 + (1.5), 4.3646 + (−1.0976)(1.5)

𝑘2 = 3𝑒 −2.25 − 0.4(3.5573) = −1.1067 𝑘4 = 𝑓(3, 2.7182)


1 1
𝑘3 = 𝑓(1.5 + (1.5), 4.3646 + (−1.1067)(1.5))
2 2
𝑘 = 3𝑒 −3 − 0.4 2.7182 = −0.9379
Engr. CHRISTOPHER S. PALADIO
4 ASCOT
ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD
1
𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 ℎ
6
𝑘1 = −1.0764 𝑘2 = −1.1067 𝑘3 = −1.0976 𝑘4 = −0.9379

1
𝑦2 = 4.3646 + −1.0764 + 2 −1.1067 + 2 −1.0976 + (−0.9379) (1.5)
6

𝑦2 = 𝑦 3.0 = 2.7589

Engr. CHRISTOPHER S. PALADIO ASCOT


ONE STEP METHOD
RUNGE – KUTTA 4TH ORDER METHOD

 PROBLEM:

Engr. CHRISTOPHER S. PALADIO ASCOT

You might also like