Top Description Fields Constructors Methods
org.apache.commons.math3.ode

public Class FieldExpandableODE<T extends RealFieldElement<T>>

extends Object
Class Inheritance
Type Parameters
<T>
the type of the field elements
Imports
java.util.ArrayList, .List, org.apache.commons.math3.RealFieldElement, org.apache.commons.math3.exception.DimensionMismatchException, .MaxCountExceededException, org.apache.commons.math3.util.MathArrays

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.

Since
3.6
See Also
FirstOrderFieldDifferentialEquations, FieldSecondaryEquations

Field Summary

Modifier and TypeField and Description
private List<FieldSecondaryEquations<T>>
components

Components of the expandable ODE.

private FieldEquationsMapper<T>
mapper

Mapper for all equations.

private final FirstOrderFieldDifferentialEquations<T>
primary

Primary differential equation.

Constructor Summary

AccessConstructor and Description
public
FieldExpandableODE(final FirstOrderFieldDifferentialEquations<T>
the primary set of differential equations to be integrated.
primary
)

Build an expandable set from its primary ODE set.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

index of the secondary equation in the expanded state, to be used as the parameter to FieldODEState#getSecondaryState(int) and FieldODEStateAndDerivative#getSecondaryDerivative(int) (beware index 0 corresponds to main state, additional states start at 1)
addSecondaryEquations
(final FieldSecondaryEquations<T>
secondary equations set
secondary
)

Add a set of secondary equations to be integrated along with the primary set.

public T[]

Returns:

time derivative of the complete state vector
computeDerivatives
(final T
current value of the independent time variable
t
,
final T[]
array containing the current value of the complete state vector
y
)

Get the current time derivative of the complete state vector.

public FieldEquationsMapper<T>

Returns:

mapper for the set of equations
getMapper
()

Get the mapper for the set of equations.

public void
init(final T
value of the independent time variable at integration start
t0
,
final T[]
array containing the value of the state vector at integration start
y0
,
final T
target time for the integration
finalTime
)

Initialize equations at the start of an ODE integration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

componentsback to summary
private List<FieldSecondaryEquations<T>> components

Components of the expandable ODE.

mapperback to summary
private FieldEquationsMapper<T> mapper

Mapper for all equations.

primaryback to summary
private final FirstOrderFieldDifferentialEquations<T> primary

Primary differential equation.

Constructor Detail

FieldExpandableODEback to summary
public FieldExpandableODE(final FirstOrderFieldDifferentialEquations<T> primary)

Build an expandable set from its primary ODE set.

Parameters
primary:FirstOrderFieldDifferentialEquations<T>

the primary set of differential equations to be integrated.

Method Detail

addSecondaryEquationsback to summary
public int addSecondaryEquations(final FieldSecondaryEquations<T> secondary)

Add a set of secondary equations to be integrated along with the primary set.

Parameters
secondary:FieldSecondaryEquations<T>

secondary equations set

Returns:int

index of the secondary equation in the expanded state, to be used as the parameter to FieldODEState#getSecondaryState(int) and FieldODEStateAndDerivative#getSecondaryDerivative(int) (beware index 0 corresponds to main state, additional states start at 1)

computeDerivativesback to summary
public T[] computeDerivatives(final T t, final T[] y) throws MaxCountExceededException, DimensionMismatchException

Get the current time derivative of the complete state vector.

Parameters
t:T

current value of the independent time variable

y:T[]

array containing the current value of the complete state vector

Returns:T[]

time derivative of the complete state vector

Exceptions
MaxCountExceededException:
if the number of functions evaluations is exceeded
DimensionMismatchException:
if arrays dimensions do not match equations settings
getMapperback to summary
public FieldEquationsMapper<T> getMapper()

Get the mapper for the set of equations.

Returns:FieldEquationsMapper<T>

mapper for the set of equations

initback to summary
public void init(final T t0, final T[] y0, final T finalTime)

Initialize equations at the start of an ODE integration.

Parameters
t0:T

value of the independent time variable at integration start

y0:T[]

array containing the value of the state vector at integration start

finalTime:T

target time for the integration

Exceptions
MaxCountExceededException:
if the number of functions evaluations is exceeded
DimensionMismatchException:
if arrays dimensions do not match equations settings