Class RungeKuttaCashCarp
java.lang.Object
nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
nl.tudelft.simulation.jstats.ode.integrators.RungeKuttaCashCarp
- All Implemented Interfaces:
Serializable
The RungeKuttaCashCarp.java numerical integrator.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static double[]
the parameters for a_i, in f(x_n + a_i h, .).protected static double[][]
the parameters for b_ij, in f(., y_n + b_p1 k1 + bp2 k2 + ...).protected static double[]
the parameters for c_i, in y_n+1 = y_n + c_1 k_1 + c_2 k_2 + ...protected static double[]
the parameters for c4_i, in y_n+1 = y_n + c4_1 k_1 + c4_2 k_2 + ...protected static int
the numer of k-s in the method.Fields inherited from class nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
equation, error, stepSize
-
Constructor Summary
ConstructorDescriptionRungeKuttaCashCarp
(double stepSize, DifferentialEquationInterface equation) constructs a new RungeKuttaCashCarp. -
Method Summary
Methods inherited from class nl.tudelft.simulation.jstats.ode.integrators.NumericalIntegrator
add, add, add, add, add, getError, getStepSize, multiply, setStepSize
-
Field Details
-
a
protected static double[] athe parameters for a_i, in f(x_n + a_i h, .). -
b
protected static double[][] bthe parameters for b_ij, in f(., y_n + b_p1 k1 + bp2 k2 + ...). -
c
protected static double[] cthe parameters for c_i, in y_n+1 = y_n + c_1 k_1 + c_2 k_2 + ... -
c4
protected static double[] c4the parameters for c4_i, in y_n+1 = y_n + c4_1 k_1 + c4_2 k_2 + ... -
nk
protected static int nkthe numer of k-s in the method.
-
-
Constructor Details
-
RungeKuttaCashCarp
constructs a new RungeKuttaCashCarp.- Parameters:
stepSize
- double; the stepSizeequation
- DifferentialEquationInterface; the differentialEquation
-
-
Method Details
-
next
public double[] next(double x, double[] y) computes the next value.- Specified by:
next
in classNumericalIntegrator
- Parameters:
x
- double; the x value corresponding to the last y-value computedy
- double[]; the last y value- Returns:
- the new value
-