Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Physics LibreTexts

10.5: Runge-Kutta Methods

( \newcommand{\kernel}{\mathrm{null}\,}\)

The three methods that we have surveyed thus far (Forward Euler, Backward Euler, and Adams-Moulton) have all involved sampling the derivative function F(y,t) at one of the discrete time steps {tn}, and the solutions at those time steps {yn}. It is natural to ask whether we can improve the accuracy by sampling the derivative function at "intermediate" values of t and y. This is the basic idea behind a family of numerical methods known as Runge-Kutta methods.

Here is a simple version of the method, known as second-order Runge-Kutta (RK2). Our goal is to replace the derivative term with a pair of terms, of the form

yn+1=yn+AhFA+BhFB,

where

FA=F(yn,tn)FB=F(yn+βFA,tn+α).

The coefficients {A,B,α,β} are adjustable parameters whose values we'll shortly choose, so as to minimize the local truncation error.

During each time step, we start out knowing the solution yn at time tn, we first calculate FA (which is the derivative term that goes into the Forward Euler method); then we use that to calculate an "intermediate" derivative term FB. Finally, we use a weighted average of FA and FB as the derivative term for calculating yn+1. From this, it is evident that this is an explicit method: for each of the sub-equations, the "right-hand sides" contain known quantities.

We now have to determine the appropriate values of the parameters {A,B,α,β}. First, we Taylor expand yn+1 around tn, using the chain rule:

yn+1=yn+hdydt|tn+h22d2ydt2|tn+O(h3)=yn+hF(yn,tn)+h22[ddtF(y(t),t)]tn+O(h3)=yn+hF(yn,tn)+h22[jFyjdyjdt+Ft]tn+O(h3)=yn+hFA+h22{j[Fyj]tnFAj+[Ft]tn}+O(h3)

In the same way, we Taylor expand the intermediate derivative term FB, whose formula was given above:

FB=FA+βjFAj[Fyj]tn+α[Ft]tn.

If we compare these Taylor expansions to the RK2 formula, then it can be seen that the terms can be made to match up to (and including) O(h2), if the parameters are chosen to obey the equations

A+B=1,α=β=h2B.

One possible set of solutions is A=B=1/2 and α=β=h. With these conditions met, the RK2 method has local truncation error of O(h3), one order better than the Forward Euler Method (which is likewise an explicit method), and comparable to the Adams-Moulton Method (which is an implicit method).

The local truncation error can be further reduced by taking more intermediate samples of the derivative function. The most commonly-used Runge-Kutta method is the fourth-order Runge Kutta method (RK4), which is given by

yn+1=yn+h6(FA+2FB+2FC+FD)FA=F(yn,tn),FB=F(yn+h2FA,tn+h2),FC=F(yn+h2FB,tn+h2),FD=F(yn+hFC,tn+h).

This has local truncation error of O(h5). It is an explicit method, and therefore has the disadvantage of being unstable if the problem is stiff and h is sufficiently large.


This page titled 10.5: Runge-Kutta Methods is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Y. D. Chong via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?