Function Repository Resource:

# RungeKuttaMethod

Solve differential equations using the Runge-Kutta method

Contributed by: Jason Martinez
 ResourceFunction["RungeKuttaMethod"][method,eqns,u,{x,xmin,xmax}] finds a numerical solution to the ordinary differential equations eqns for the function u with the independent variable x in the range xmin to xmax using the specified method. ResourceFunction["RungeKuttaMethod"][method,eqns,u,{x,xmin,xmax},property] returns a specific property for the numerical calculation.

## Details and Options

ResourceFunction["RungeKuttaMethod"] supports most of the functionality and options for NDSolve but inserts the proper method options for the specified method.
method specifications include:
 "DOPRI" Dormand–Prince method "ExplicitEuler" forward Euler method "ExplicitMidpoint" explicit midpoint method "Heun" Heun's method "ImplicitEuler" backward Euler method "ImplicitMidpoint" implicit midpoint method "RK3" third-order Runge–Kutta method "RK4" fourth-order Runge–Kutta method "RKBS" Bogacki–Shampine method "RKF" Runge–Kutta–Fehlberg method
The function u must depend only on the single variable x.
The differential equations must contain enough initial or boundary conditions to determine the solutions for u completely.
property can take the following forms:
 "Solution" interpolation function for the solution to u "Steps" stepwise results "ButcherTableau" Butcher tableau for the method
"PropertyAssociation" can be used to return an Association of the properties.

## Examples

### Basic Examples (1)

Solve a differential equation using the fourth order Runge–Kutta method:

 In[1]:=
 Out[1]=

### Scope (3)

Find the Butcher tableau for the Dormand–Prince method:

 In[2]:=
 Out[2]=

Compute the steps to determine the interpolation function:

 In[3]:=
 Out[3]=

Get the property association of all properties:

 In[4]:=
 Out[4]=

## Version History

• 2.0.0 – 29 August 2019
• 1.0.0 – 14 August 2019