SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.differentialequation.ode.ivp.solver.rungekutta

Class RungeKutta

• java.lang.Object
• com.numericalmethod.suanshu.analysis.differentialequation.ode.ivp.solver.rungekutta.RungeKutta
• All Implemented Interfaces:
ODESolver
Direct Known Subclasses:
EulerMethod

public class RungeKutta
extends Object
implements ODESolver
The Runge-Kutta methods are an important family of implicit and explicit iterative methods for the approximation of solutions of ordinary differential equations. These techniques were developed around 1900 by the German mathematicians C. Runge and M.W. Kutta.
• D. Greenspan, Numerical Solution of Ordinary Differential Equations: for Classical, Relativistic and Nano Systems, 1st ed, Wiley-VCH, 2006.
• Wikipedia: Runge-Kutta methods
• Constructor Summary

Constructors
Constructor and Description
RungeKutta(RungeKuttaStepper stepper, double h)
Constructs a Runge-Kutta algorithm with the given integrator and the constant step size.
RungeKutta(RungeKuttaStepper stepper, int N)
Constructs a Runge-Kutta algorithm with the given integrator and the constant number of steps.
• Method Summary

All Methods
Modifier and Type Method and Description
ODESolution solve(ODE1stOrder ode)
Solves a first order ODE.
• Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• Constructor Detail

• RungeKutta

public RungeKutta(RungeKuttaStepper stepper,
double h)
Constructs a Runge-Kutta algorithm with the given integrator and the constant step size.
Parameters:
stepper - the integrator algorithm
h - constant step size
• RungeKutta

public RungeKutta(RungeKuttaStepper stepper,
int N)
Constructs a Runge-Kutta algorithm with the given integrator and the constant number of steps.
Parameters:
stepper - the integrator algorithm
N - constant number of steps
• Method Detail

• solve

public ODESolution solve(ODE1stOrder ode)
Solves a first order ODE.
Specified by:
solve in interface ODESolver
Parameters:
ode - the ODE problem
Returns:
the solution