0% found this document useful (0 votes)
47 views9 pages

Lecture 2 - Differential Equation

This document discusses numerical methods for solving ordinary differential equations. It introduces the Runge-Kutta second order method, including Heun's method and the midpoint method. It also presents Ralston's method. An example problem is shown to illustrate applying Heun's method to solve the differential equation dy/dx = 3e-x - 0.4y with an initial condition of y0 = 5 and step size h = 1.5.
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)
47 views9 pages

Lecture 2 - Differential Equation

This document discusses numerical methods for solving ordinary differential equations. It introduces the Runge-Kutta second order method, including Heun's method and the midpoint method. It also presents Ralston's method. An example problem is shown to illustrate applying Heun's method to solve the differential equation dy/dx = 3e-x - 0.4y with an initial condition of y0 = 5 and step size h = 1.5.
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
You are on page 1/ 9

ORDINARY DIFFERENTIAL

EQUATIONS

NUMERICAL METHODS
MATH 134

Engr. CHRISTOPHER S. PALADIO


𝑑𝑦
= 𝑓 𝑥, 𝑦 𝑦 0 = 𝑦0
𝑑𝑥
From Taylor Series Expansion
𝑑𝑦 1 𝑑2 𝑦 1 𝑑3 𝑦
𝑦𝑖+1 = 𝑦𝑖 + ቓ 𝑥𝑖+1 − 𝑥𝑖 + ቓ 𝑥𝑖+1 − 𝑥𝑖 2 + ቓ 𝑥𝑖+1 − 𝑥𝑖 3 +…
𝑑𝑥 𝑥𝑖 ,𝑦𝑖 2! 𝑑𝑥 2 𝑥𝑖 ,𝑦𝑖 3! 𝑑𝑥 3 𝑥𝑖 ,𝑦𝑖

𝑥𝑖+1 − 𝑥𝑖 = ℎ
1 ′
𝑦𝑖+1 = 𝑦𝑖 + 𝑓 𝑥𝑖 , 𝑦𝑖 ℎ + 𝑓 (𝑥𝑖 , 𝑦𝑖 )ℎ2
2!

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


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

𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 ) 1
𝑎2 𝑝1 =
2
𝑘2 = 𝑓(𝑥𝑖 + 𝑝1 ℎ, 𝑦𝑖 + 𝑞11 𝑘1 ℎ)
1
𝑎2 𝑞11 =
2

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


HEUN’S METHOD
1 1 1 1
𝑎2 = 𝑎1 + 𝑎2 =1 𝑎1 = 𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 𝑘2 ℎ
2 2 2 2
1
𝑎2 𝑝1 = 𝑝1 = 1
2 𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
1 𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ)
𝑎2 𝑞11 = 𝑞11 = 1
2

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


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

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


𝑑𝑦 1 1
𝑥0 = 0 𝑦0 = 5 = 3𝑒 −𝑥 − 0.4𝑦 𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 𝑘2 ℎ
𝑑𝑥 2 2
𝑘1 = 𝑓 0,5 = 3𝑒 −0 − 0.4 5 = 1
𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
𝑘2 = 𝑓 0 + 1.5, 5 + 1 1.5 = 𝑓(1.5, 6.5)
𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ)
𝑘2 = 3𝑒 −1.5 − 0.4 6.5 = −1.93061
1 1
𝑦1 = 5 + 1 + −1.93061 1.5 = 4.30204
2 2
𝑦1 = 𝑦 1.5 = 4.30204

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


𝑥1 = 1.5 𝑦1 = 4.30204

𝑘1 = 𝑓 1.5,4.30204 = 3𝑒 −1.5 − 0.4 4.30204 = −1.05143


𝑘2 = 𝑓 1.5 + 1.5,4.30204 + (−1.05143) 1.5 = 𝑓(3.0, 2.72490)

𝑘2 = 3𝑒 −3 − 0.4 2.72490 = −0.94060


1 1
𝑦2 = 4.30204 + −1.05143 + −0.94060 1.5 = 2.80802
2 2
𝑦2 = 𝑦 3.0 = 2.80802

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


MID POINT METHOD

𝑎2 = 1 𝑎1 + 𝑎2 =1 𝑎1 = 0 𝑦𝑖+1 = 𝑦𝑖 + 𝑘2 ℎ

1 1
𝑎2 𝑝1 = 𝑝1 = 𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
2 2
1 1
𝑎2 𝑞11 = 𝑞11 = 1 1
2 2 𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ)
2 2

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT


RALSTON’S METHOD

2 𝑎1 + 𝑎2 =1 1 1 2
𝑎2 = 𝑎1 = 𝑦𝑖+1 = 𝑦𝑖 + 𝑘1 + 𝑘2 ℎ
3 3 3 3
1
𝑎2 𝑝1 = 3
2 𝑝1 = 𝑘1 = 𝑓(𝑥𝑖 , 𝑦𝑖 )
4
1
𝑎2 𝑞11 = 3 3 3
2 𝑞11 = 𝑘2 = 𝑓(𝑥𝑖 + ℎ, 𝑦𝑖 + 𝑘1 ℎ)
4 4 4

ONE STEP METHOD


RUNGE – KUTTA 2ND ORDER METHOD

Engr. CHRISTOPHER S. PALADIO ASCOT

You might also like