Package org.hipparchus.ode
Class EquationsMapper
- java.lang.Object
-
- org.hipparchus.ode.EquationsMapper
-
- All Implemented Interfaces:
Serializable
public class EquationsMapper extends Object implements Serializable
Class mapping the part of a complete state or derivative that pertains to a specific differential equation.Instances of this class are guaranteed to be immutable.
- See Also:
SecondaryODE, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]extractEquationData(int index, double[] complete)Extract equation data from a complete state or derivative array.intgetNumberOfEquations()Get the number of equations mapped.intgetTotalDimension()Return the dimension of the complete set of equations.voidinsertEquationData(int index, double[] equationData, double[] complete)Insert equation data into a complete state or derivative array.ODEStateAndDerivativemapStateAndDerivative(double t, double[] y, double[] yDot)Map flat arrays to a state and derivative.
-
-
-
Method Detail
-
getNumberOfEquations
public int getNumberOfEquations()
Get the number of equations mapped.- Returns:
- number of equations mapped
-
getTotalDimension
public int getTotalDimension()
Return the dimension of the complete set of equations.The complete set of equations correspond to the primary set plus all secondary sets.
- Returns:
- dimension of the complete set of equations
-
mapStateAndDerivative
public ODEStateAndDerivative mapStateAndDerivative(double t, double[] y, double[] yDot) throws MathIllegalArgumentException
Map flat arrays to a state and derivative.- Parameters:
t- timey- state array to map, including primary and secondary componentsyDot- state derivative array to map, including primary and secondary components- Returns:
- mapped state
- Throws:
MathIllegalArgumentException- if an array does not match total dimension
-
extractEquationData
public double[] extractEquationData(int index, double[] complete) throws MathIllegalArgumentExceptionExtract equation data from a complete state or derivative array.- Parameters:
index- index of the equation, must be between 0 included andgetNumberOfEquations()(excluded)complete- complete state or derivative array from which equation data should be retrieved- Returns:
- equation data
- Throws:
MathIllegalArgumentException- if index is out of rangeMathIllegalArgumentException- if complete state has not enough elements
-
insertEquationData
public void insertEquationData(int index, double[] equationData, double[] complete) throws MathIllegalArgumentExceptionInsert equation data into a complete state or derivative array.- Parameters:
index- index of the equation, must be between 0 included andgetNumberOfEquations()(excluded)equationData- equation data to be inserted into the complete arraycomplete- placeholder where to put equation data (only the part corresponding to the equation will be overwritten)- Throws:
MathIllegalArgumentException- if either array has not enough elements
-
-