Mathematics Source Library
C & ASM

 Home Differential Equations Home Runge-Kutta Methods Home Heun's Method Improved Euler's Method Ralston's Second Order Method Third Order Method Version 1 Third Order Method Version 2 Classical Runge-Kutta Fourth Order Method Ralston's Fourth Order Method Runge-Kutta 3/8 Method Gill's Fourth Order Method Nystrom's Fifth Order Method Butcher's Sixth Order Method Verner's Eighth Order Method

## Runge-Kutta 3/8 Method

The 3/8 method is a fourth order Runge-Kutta method for approximating the solution of the initial value problem y'(x) = f(x,y);  y(x0) = y0 which evaluates the integrand,f(x,y), four times per step. For step i+1,
yi+1 = yi + 1/8 ( k1 + 3 k2 + 3 k3 + k4 ),

where
k1 = h f(xi, yi),
k2 = h f(xi + h / 3, yi + k1 / 3 ),
k3 = h f(xi + 2 h / 3, yi - k1 / 3 + k2 ),
k4 = h f(xi + h, yi + k1 - k2 + k3 ),

and xi = x0 + i h.

This method is a fourth order procedure for which Richardson extrapolation can be used.

### Function List

• double Runge_Kutta_3_8( double (*f)(double, double), double y0, double x0, double h, int number_of_steps )

This function uses the 3/8 method to return the estimate of the solution of the initial value problem, y' = f(x,y);  y(x0) = y0, at x = x0 + h * n, where h is the step size and n is number_of_steps.

• double Runge_Kutta_3_8_Richardson( double (*f)(double, double), double y0, double x0, double h, int number_of_steps, int richardson_columns )

This function uses the 3/8 method together with Richardson extrapolation to the limit to return the estimate of the solution of the initial value problem, y' = f(x,y);  y(x0) = y0, at x = x0 + h * n, where h is the step size and n is number_of_steps. The argument richardson_columns is the number of step size halving + 1 used in Richardson extrapolation so that if richardson_columns = 1 then no extrapolation to the limit is performed.

• void Runge_Kutta_3_8_Integral_Curve( double (*f)(double, double), double y[ ], double x0, double h, int number_of_steps_per_interval, int number_of_intervals )

This function uses 3/8 method to estimate the solution of the initial value problem,
y' = f(x,y);  y(x0) = y0, at x = x0 + h * n * m, where h is the step size and n is the interval number 0 ≤ n ≤ number_of_intervals, and m is the number_of_steps_per_interval. The values are return in the array y[ ] i.e.
y[n] = y(x0 + h * m * n), where m, n are as above.

• void Runge_Kutta_3_8_Richardson_Integral_Curve( double (*f)(double, double), double y[ ], double x0, double h, int number_of_steps_per_interval, int number_of_intervals, int richardson_columns )

This function uses the 3/8 method together with Richardson extrapolation to the limit to estimate the solution of the initial value problem, y' = f(x,y);  y(x0) = y0, at
x = x0 + h * n * m, where h is the step size and n is the interval number
0 ≤ n ≤ number_of_intervals, and m is the number_of_steps_per_interval. The values are return in the array y[ ] i.e. y[n] = y(x0 + h * m * n), where m, n are as above. The argument richardson_columns is the number of step size halving + 1 used in Richardson extrapolation so that if richardson_columns = 1 then no extrapolation to the limit is performed.

#### C Source Code

• The file, runge_kutta_3_8.c, contains versions of Runge_Kutta_3_8( ), Runge_Kutta_3_8_Richardson( ), Runge_Kutta_3_8_Integral_Curve( ), and Runge_Kutta_3_8_Richardson_Integral_Curve( ) written in C.