0% found this document useful (0 votes)
16 views13 pages

Pemodelan Dan Metode Numerik (Modeling and Numerical Methods)

This document discusses numerical methods for solving ordinary differential equations (ODEs). It provides examples of fundamental laws written as ODEs involving time and position. It then explains the Runge-Kutta method for solving ODEs, including first-order Euler's method, second-order midpoint method, third-order method, and fourth-order classical Runge-Kutta method. It provides an example of using each of these methods to solve an ODE numerically from x=0 to x=4 with a step size of 0.5, beginning with the initial condition y=1. The document concludes with an assignment for students to solve a problem using Euler's method and the fourth-order Runge-Kutta

Uploaded by

Anto Padaunan
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)
16 views13 pages

Pemodelan Dan Metode Numerik (Modeling and Numerical Methods)

This document discusses numerical methods for solving ordinary differential equations (ODEs). It provides examples of fundamental laws written as ODEs involving time and position. It then explains the Runge-Kutta method for solving ODEs, including first-order Euler's method, second-order midpoint method, third-order method, and fourth-order classical Runge-Kutta method. It provides an example of using each of these methods to solve an ODE numerically from x=0 to x=4 with a step size of 0.5, beginning with the initial condition y=1. The document concludes with an assignment for students to solve a problem using Euler's method and the fourth-order Runge-Kutta

Uploaded by

Anto Padaunan
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/ 13

Pemodelan dan Metode Numerik

(Modeling and Numerical Methods)


http://www.unhas.ac.id/amil/S2TE/pmn2016/
L #5 ORDINARY DIFFERENTIAL EQUATIONS
Amil Ahmad Ilham

ODE
(ORDINARY DIFFERENTIAL EQUATIONS)

Examples of fundamental laws that are written in ODE


(t = time and x = position)

Runge-Kutta Methods
Solving ODEs of the form

First-Order Runge-Kutta Methods


(Eulers method)
Use Eulers method to numerically integrate

from x = 0 to x = 4 with a step size of 0.5. The initial condition at x = 0 is y = 1.


y(0) = 1
y(0.5) = y(0) + f(0, 1)0.5
f(0, 1) = 2(0)3 + 12(0)2 20(0) + 8.5 = 8.5
y(0.5) = 1.0 + 8.5(0.5) = 5.25
y(1) = y(0.5) + f(0.5, 5.25)0.5
f(0.5, 5.25) = 2(0.5)3 + 12(0.5)2 20(0.5) + 8.5 = 1.25
y(1) = 5.25 + 1.25(0.5) = 5.875

First-Order Runge-Kutta Methods


(Eulers method)
Use Eulers method to numerically integrate

from x = 0 to x = 4 with a step size of 0.5. The initial condition at x = 0 is y = 1.

Second-Order Runge-Kutta Methods (The


Midpoint Method)
Use the midpoint method to numerically integrate

from x = 0 to x = 4 with a step size of 0.5. The initial condition at x = 0 is y = 1.


y(0) = 1
y(0.5) = ?

k1 = f(0,1)
k1 = 2(0)3 + 12(0)2 20(0) + 8.5 = 8.5
k2 = 2(0.25)3 + 12(0.25)2 20(0.25) + 8.5 = 4.21875
y(0.5) = 1 + 4.21875(0.5) = 3.109375
y(1) = ?
k1 = f(0.5,3.1)

Second-Order Runge-Kutta Methods (The


Midpoint Method)
Use the midpoint method to numerically integrate

from x = 0 to x = 4 with a step size of 0.5. The initial condition at x = 0 is y = 1.

Third-Order Runge-Kutta Methods

Fourth-Order Runge-Kutta Methods

The most popular RK methods are fourth order


(classical fourth-order RK method)

Use the classical fourth-order RK to


numerically integrate

from x = 0 to x = 4 with a step size of 0.5.


The initial condition at x = 0 is y = 1.
k1 = 8.5, k2 = 4.21875, k3 = 4.21875, k4 = 1.25

10

Group assignment
Group Assignment

11

Group Assignment #3
1. Solve manually the following problem over the interval from x =
0 to 1 using a step size of 0.25 where y(0) = 1.

(a) Use Eulers method


(b) Fourth-order RK method
2. Develop a user-friendly computer program to solve problem
No. 1.

12

Group Assignment #3
Work in pairs (1 group = 2 members)
Print out the result, screenshot, and source code for no. 2.
For the source code, print only part of the source code where the calculation
is performed.

Prepare for demo!

13

You might also like