

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of runge-kutta methods for solving initial value problems of differential equations. It covers methods of orders 2 and 4, including the modified euler method, midpoint method, minimum bound to the error method, heun's method, and the runge-kutta-fehlberg method. The general form of these methods, their error analysis, and the number of function evaluations required.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


CS 340 – Introduction to Scientific Computing Section 6.3: Runge-Kutta Methods April 14 & 16, 2005
NOTE: All of the following methods generate numerical solutions to the initial value problem
dy dx
= f (x, y) y(x 0 ) = y 0
Method 1 (Runge-Kutta Methods of Order 2 (RK2))
General Form
yi+1 = yi + ak 1 + bk 2 k 1 = hf (xi, yi) k 2 = hf (xi + αh, yi + βk 1 )
where a + b = 1, αb = 12 and βb = 12 , which has global error O(h^2 ).
NOTE: This method requires two function evaluations, one to determine k 1 and one to determine k 2.
Where a = 12 , b = 12 , α = 1, β = 1, i.e.
yi+1 = yi + h 2
f (xi, yi) + h 2
f (xi + h, yi + hf (xi, yi))
Where a = 0, b = 1, α = 12 , β = 12 , i.e.
yi+1 = yi + h f
( xi + h 2
, yi + h 2
f (xi, yi)
)
Where a = 13 , b = 23 , α = 34 , β = 34 , i.e.
yi+1 = yi + h 3 f (xi, yi) +^23 h f
( xi +^34 h, yi +^34 hf (xi, yi)
)
Where a = 14 , b = 34 , α = 23 , β = 23 , i.e.
yi+1 = yi +
h 4 f^ (xi, yi) +
4 h f
( xi +
3 h, yi^ +
3 hf^ (xi, yi)
)
Method 2 (RK4)
k 1 = h f (xi, yi) k 2 = h f
( xi + h 2
, yi +^1 2
k 1
)
k 3 = h f
( xi + h 2
, yi +^1 2
k 2
)
k 4 = h f (xi + h, yi + k 3 ) yi+1 = yi +^16 (k 1 + 2k 2 + 2k 3 + k 4 )
which has local truncation error O(h^4 ).
NOTE: This method requires four function evaluations, one to determine each ki , for i = 1, 2 , 3 , 4.
The main computational effort in applying the Runge-Kutta methos is the evaluation of f. There is a relationship between the number of evaluations per step and the order of the local truncation error that indicates that methods of order less than five, with smaller step size, are used in preference to the higher-order methods using a larger step size.
Evaluations per step 2 3 4 5 ≤ n ≤ 7 8 ≤ n ≤ 9 10 ≤ n Best possible local truncation error O(h^2 ) O(h^3 ) O(h^4 ) O(hn−^1 ) O(hn−^2 ) O(hn−^3 )
NOTE: This was taken from the text, Numerical Analysis, 7th^ Edition, by Burden & Faires, Brooks/Cole, 2001, p.270.
This method is analogous to the adaptive quadrature methods of chapter five (Adaptive Simpson’s (^13) Method is what we studied). Essentially, you want to choose your step size, h, as large as possible yet insure that your answer is correct within a certain tolerance.
One method to do this is to calculate your ˆyi+1 value with one h 1 , then repeat your procedure using h 2 = h 1 /2 (doing two iterations) to get yi+1. If |yi+1 − yˆi+1| < tol then use your better approximation, yi+1, otherwise, continue to halve your h’s until this condition is met. But note, if you’re using an RK method, this requires four function evaluations to get ˆyi+1 and six new function evaluations (one each for k 2 , k 3 , and k 4 at each iteration) to get yi+1, or ten in total.
(x_(i+1), y_(i+1))^
(x_i,y_i)
(x_i + h/2, y_(i+h/2)) x
y (^) = with original h stepsize = with h/2 step size
(x_(i+1), y_(i+1))
E