Package org.hipparchus.ode
Class ExpandableODE
 java.lang.Object

 org.hipparchus.ode.ExpandableODE

public class ExpandableODE extends Object
This class represents a combined set of first order differential equations, with at least a primary set of equations expandable by some sets of secondary equations.One typical use case is the computation of the Jacobian matrix for some ODE. In this case, the primary set of equations corresponds to the raw ODE, and we add to this set another bunch of secondary equations which represent the Jacobian matrix of the primary set.
We want the integrator to use only the primary set to estimate the errors and hence the step sizes. It should not use the secondary equations in this computation. The
integrator
will be able to know where the primary set ends and so where the secondary sets begin. See Also:
OrdinaryDifferentialEquation
,VariationalEquation


Constructor Summary
Constructors Constructor Description ExpandableODE(OrdinaryDifferentialEquation primary)
Build an expandable set from its primary ODE set.

Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addSecondaryEquations(SecondaryODE secondary)
Add a set of secondary equations to be integrated along with the primary set.double[]
computeDerivatives(double t, double[] y)
Get the current time derivative of the complete state vector.EquationsMapper
getMapper()
Get the mapper for the set of equations.OrdinaryDifferentialEquation
getPrimary()
Get the primaryset of differential equations to be integrated.void
init(ODEState s0, double finalTime)
Initialize equations at the start of an ODE integration.



Constructor Detail

ExpandableODE
public ExpandableODE(OrdinaryDifferentialEquation primary)
Build an expandable set from its primary ODE set. Parameters:
primary
 the primary set of differential equations to be integrated.


Method Detail

getPrimary
public OrdinaryDifferentialEquation getPrimary()
Get the primaryset of differential equations to be integrated. Returns:
 primary set of differential equations to be integrated

getMapper
public EquationsMapper getMapper()
Get the mapper for the set of equations. Returns:
 mapper for the set of equations

addSecondaryEquations
public int addSecondaryEquations(SecondaryODE secondary)
Add a set of secondary equations to be integrated along with the primary set. Parameters:
secondary
 secondary equations set Returns:
 index of the secondary equation in the expanded state, to be used
as the parameter to
FieldODEState.getSecondaryState(int)
andFieldODEStateAndDerivative.getSecondaryDerivative(int)
(beware index 0 corresponds to primary state, secondary states start at 1)

init
public void init(ODEState s0, double finalTime)
Initialize equations at the start of an ODE integration. Parameters:
s0
 state at integration startfinalTime
 target time for the integration Throws:
MathIllegalStateException
 if the number of functions evaluations is exceededMathIllegalArgumentException
 if arrays dimensions do not match equations settings

computeDerivatives
public double[] computeDerivatives(double t, double[] y) throws MathIllegalArgumentException, MathIllegalStateException
Get the current time derivative of the complete state vector. Parameters:
t
 current value of the independent time variabley
 array containing the current value of the complete state vector Returns:
 time derivative of the complete state vector
 Throws:
MathIllegalStateException
 if the number of functions evaluations is exceededMathIllegalArgumentException
 if arrays dimensions do not match equations settings

