Package gaiasky.util.gaia.utils
Class RungeKuttaNs
java.lang.Object
gaiasky.util.gaia.utils.RungeKuttaNs
Provides an implementation of the Runge-Kutta method for solving single or
sets of ordinary differential equations (ODEs).
A set of ODEs are supplied by means of the interface DiffnFunction.
This class is taken from the Java library developed by Michael Thomas Flanagan available at http://www.ee.ucl.ac.uk/~mflanaga/java/RungeKutta.html
NOTE: This is for RSLS use only - do not use in any other software
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
fourthOrder(DiffnFunctionNs g, long tOld, double[] y0, long tNew, long tStepMax, long tUnit)
Returns the value of y at a given value of x (xn) for a set of ordinary differential equation (ODEs)
See http://www.ee.ucl.ac.uk/~mflanaga/java/RungeKutta.html#four
-
Constructor Details
-
RungeKuttaNs
public RungeKuttaNs()
-
-
Method Details
-
fourthOrder
public static double[] fourthOrder(DiffnFunctionNs g, long tOld, double[] y0, long tNew, long tStepMax, long tUnit)Returns the value of y at a given value of x (xn) for a set of ordinary differential equation (ODEs)
See http://www.ee.ucl.ac.uk/~mflanaga/java/RungeKutta.html#four- Parameters:
g
- an implementation of DiffnFunction describing a set of Ordinary Differential EquationstOld
- the initial value for ty0
- the initial value for ytNew
- the value of t where we want to know ytStepMax
- the initial step sizetUnit
- the time unit used for the derivatives- Returns:
- the value of y at xn
-