Example usage for org.apache.commons.math3.ode.nonstiff GraggBulirschStoerIntegrator GraggBulirschStoerIntegrator

List of usage examples for org.apache.commons.math3.ode.nonstiff GraggBulirschStoerIntegrator GraggBulirschStoerIntegrator

Introduction

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

Prototype

public GraggBulirschStoerIntegrator(final double minStep, final double maxStep,
        final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) 

Source Link

Document

Simple constructor.

Usage

From source file:org.orekit.forces.gravity.ThirdBodyAttractionTest.java

@Test(expected = OrekitException.class)
public void testSunContrib() throws OrekitException {

    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816),
            TimeScalesFactory.getUTC());
    Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3,
            FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3),
            FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE,
            FramesFactory.getEME2000(), date, mu);
    double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());

    // set up propagator
    NumericalPropagator calc = new NumericalPropagator(
            new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
    calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getSun()));

    // set up step handler to perform checks
    calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {
        protected double hXRef(double t) {
            return -1.06757e-3 + 0.221415e-11 * t + 18.9421e-5 * FastMath.cos(3.9820426e-7 * t)
                    - 7.59983e-5 * FastMath.sin(3.9820426e-7 * t);
        }/* w  w w  .  j a v a2 s  .  co  m*/

        protected double hYRef(double t) {
            return 1.43526e-3 + 7.49765e-11 * t + 6.9448e-5 * FastMath.cos(3.9820426e-7 * t)
                    + 17.6083e-5 * FastMath.sin(3.9820426e-7 * t);
        }
    });
    AbsoluteDate finalDate = date.shiftedBy(365 * period);
    calc.setInitialState(new SpacecraftState(orbit));
    calc.propagate(finalDate);

}

From source file:org.orekit.forces.gravity.ThirdBodyAttractionTest.java

@Test
public void testMoonContrib() throws OrekitException {

    // initialization
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 07, 01), new TimeComponents(13, 59, 27.816),
            TimeScalesFactory.getUTC());
    Orbit orbit = new EquinoctialOrbit(42164000, 10e-3, 10e-3,
            FastMath.tan(0.001745329) * FastMath.cos(2 * FastMath.PI / 3),
            FastMath.tan(0.001745329) * FastMath.sin(2 * FastMath.PI / 3), 0.1, PositionAngle.TRUE,
            FramesFactory.getEME2000(), date, mu);
    double period = 2 * FastMath.PI * orbit.getA() * FastMath.sqrt(orbit.getA() / orbit.getMu());

    // set up propagator
    NumericalPropagator calc = new NumericalPropagator(
            new GraggBulirschStoerIntegrator(10.0, period, 0, 1.0e-5));
    calc.addForceModel(new ThirdBodyAttraction(CelestialBodyFactory.getMoon()));

    // set up step handler to perform checks
    calc.setMasterMode(FastMath.floor(period), new ReferenceChecker(date) {
        protected double hXRef(double t) {
            return -0.000906173 + 1.93933e-11 * t + 1.0856e-06 * FastMath.cos(5.30637e-05 * t)
                    - 1.22574e-06 * FastMath.sin(5.30637e-05 * t);
        }/*  w w  w .  j a  va 2 s .  c o m*/

        protected double hYRef(double t) {
            return 0.00151973 + 1.88991e-10 * t - 1.25972e-06 * FastMath.cos(5.30637e-05 * t)
                    - 1.00581e-06 * FastMath.sin(5.30637e-05 * t);
        }
    });
    AbsoluteDate finalDate = date.shiftedBy(31 * period);
    calc.setInitialState(new SpacecraftState(orbit));
    calc.propagate(finalDate);

}

From source file:org.orekit.propagation.conversion.GraggBulirschStoerIntegratorBuilder.java

/** {@inheritDoc} */
public AbstractIntegrator buildIntegrator(final Orbit orbit) throws PropagationException {
    final double[][] tol = NumericalPropagator.tolerances(dP, orbit, OrbitType.CARTESIAN);
    return new GraggBulirschStoerIntegrator(minStep, maxStep, tol[0], tol[1]);
}

From source file:ummisco.gaml.extensions.maths.ode.utils.solver.GraggBulirschStoerSolver.java

public GraggBulirschStoerSolver(final double minStep, final double maxStep, final double scalAbsoluteTolerance,
        final double scalRelativeTolerance, final GamaMap<String, IList<Double>> integrated_val) {
    super((minStep + maxStep) / 2,
            new GraggBulirschStoerIntegrator(minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance),
            integrated_val);
}