diff --git a/src/main/java/org/apache/commons/math3/ode/FieldFirstOrderDifferentialEquations.java b/src/main/java/org/apache/commons/math3/ode/FieldFirstOrderDifferentialEquations.java index 63c14a596..887451b19 100644 --- a/src/main/java/org/apache/commons/math3/ode/FieldFirstOrderDifferentialEquations.java +++ b/src/main/java/org/apache/commons/math3/ode/FieldFirstOrderDifferentialEquations.java @@ -51,6 +51,18 @@ public interface FieldFirstOrderDifferentialEquations + * 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. + *

+ * @param t0 value of the independent time 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 time variable * @param y array containing the current value of the state vector diff --git a/src/main/java/org/apache/commons/math3/ode/FieldSecondaryEquations.java b/src/main/java/org/apache/commons/math3/ode/FieldSecondaryEquations.java index 073f7cf05..32e0abee1 100644 --- a/src/main/java/org/apache/commons/math3/ode/FieldSecondaryEquations.java +++ b/src/main/java/org/apache/commons/math3/ode/FieldSecondaryEquations.java @@ -47,6 +47,19 @@ public interface FieldSecondaryEquations> { */ int getDimension(); + /** Initialize equations at the start of an ODE integration. + *

+ * 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. + *

+ * @param t0 value of the independent time 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 time variable * @param primary array containing the current value of the primary state vector