Example usage for org.apache.commons.math3.ode ExpandableStatefulODE setTime

List of usage examples for org.apache.commons.math3.ode ExpandableStatefulODE setTime

Introduction

In this page you can find the example usage for org.apache.commons.math3.ode ExpandableStatefulODE setTime.

Prototype

public void setTime(final double time) 

Source Link

Document

Set current time.

Usage

From source file:org.orekit.propagation.integration.AbstractIntegratedPropagator.java

/** Create an ODE with all equations.
 * @param integ numerical integrator to use for propagation.
 * @return a new ode/*from ww  w  .  j a v  a  2  s .com*/
 * @exception OrekitException if initial state cannot be mapped
 */
private ExpandableStatefulODE createODE(final AbstractIntegrator integ) throws OrekitException {

    // retrieve initial state
    final double[] initialStateVector = new double[getBasicDimension()];
    stateMapper.mapStateToArray(getInitialState(), initialStateVector);

    // main part of the ODE
    final ExpandableStatefulODE ode = new ExpandableStatefulODE(
            new ConvertedMainStateEquations(getMainStateEquations(integ)));
    ode.setTime(0.0);
    ode.setPrimaryState(initialStateVector);

    // secondary part of the ODE
    for (int i = 0; i < additionalEquations.size(); ++i) {
        final AdditionalEquations additional = additionalEquations.get(i);
        final double[] data = getInitialState().getAdditionalState(additional.getName());
        final SecondaryEquations secondary = new ConvertedSecondaryStateEquations(additional, data.length);
        ode.addSecondaryEquations(secondary);
        ode.setSecondaryState(i, data);
    }

    return ode;

}