Added init methods for primary and secondary ODE.

This addition is for consistency with other user-implemented interfaces
as step handlers and event handlers. However, since the equations have
only the state as input and the produce derivatives as output, their
init method also only uses state, as derivatives can be computed only
after equations have been initialized, not before.
This commit is contained in:
Luc Maisonobe 2015-11-15 10:27:10 +01:00
parent 136f644e22
commit 70e48a02d0
2 changed files with 25 additions and 0 deletions

View File

@ -51,6 +51,18 @@ public interface FieldFirstOrderDifferentialEquations<T extends RealFieldElement
*/
int getDimension();
/** Initialize equations at the start of an ODE integration.
* <p>
* This method is called once at the start of the integration. It
* may be used by the equations to initialize some internal data
* if needed.
* </p>
* @param t0 value of the independent <I>time</I> variable at integration start
* @param y0 array containing the value of the state vector at integration start
* @param finalTime target time for the integration
*/
void init(T t0, T[] y0, T finalTime);
/** Get the current time derivative of the state vector.
* @param t current value of the independent <I>time</I> variable
* @param y array containing the current value of the state vector

View File

@ -47,6 +47,19 @@ public interface FieldSecondaryEquations<T extends RealFieldElement<T>> {
*/
int getDimension();
/** Initialize equations at the start of an ODE integration.
* <p>
* This method is called once at the start of the integration. It
* may be used by the equations to initialize some internal data
* if needed.
* </p>
* @param t0 value of the independent <I>time</I> variable at integration start
* @param primary0 array containing the value of the primary state vector at integration start
* @param secondary0 array containing the value of the secondary state vector at integration start
* @param finalTime target time for the integration
*/
void init(T t0, T[] primary0, T[] secondary0, T finalTime);
/** Compute the derivatives related to the secondary state parameters.
* @param t current value of the independent <I>time</I> variable
* @param primary array containing the current value of the primary state vector