<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=NumericalPropagationWithUsedDV_4.5.1</id>
	<title>NumericalPropagationWithUsedDV 4.5.1 - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://patrius.cnes.fr/index.php?action=history&amp;feed=atom&amp;title=NumericalPropagationWithUsedDV_4.5.1"/>
	<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=NumericalPropagationWithUsedDV_4.5.1&amp;action=history"/>
	<updated>2026-04-05T13:00:28Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://patrius.cnes.fr/index.php?title=NumericalPropagationWithUsedDV_4.5.1&amp;diff=2708&amp;oldid=prev</id>
		<title>Admin : Page créée avec « &lt;syntaxhighlight lang=&quot;java&quot;&gt; public class NumericalPropagationWithUsedDV {      public static void main(String[] args) throws PatriusException {                  Locale.s... »</title>
		<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=NumericalPropagationWithUsedDV_4.5.1&amp;diff=2708&amp;oldid=prev"/>
		<updated>2020-08-17T09:11:50Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt; public class NumericalPropagationWithUsedDV {      public static void main(String[] args) throws PatriusException {                  Locale.s... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class NumericalPropagationWithUsedDV {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws PatriusException {&lt;br /&gt;
        &lt;br /&gt;
        Locale.setDefault(Locale.US);&lt;br /&gt;
        &lt;br /&gt;
        // Patrius Dataset initialization (needed for example to get the UTC time)&lt;br /&gt;
        PatriusDataset.addResourcesFromPatriusDataset() ;&lt;br /&gt;
&lt;br /&gt;
        // Recovery of the UTC time scale using a &amp;quot;factory&amp;quot; (not to duplicate such unique object)&lt;br /&gt;
        final TimeScale TUC = TimeScalesFactory.getUTC();&lt;br /&gt;
        &lt;br /&gt;
        // Date of the orbit given in UTC time scale)&lt;br /&gt;
        final AbsoluteDate date0 = new AbsoluteDate(&amp;quot;2010-01-01T12:00:00.000&amp;quot;, TUC);&lt;br /&gt;
        &lt;br /&gt;
        // Getting the frame with wich will defined the orbit parameters&lt;br /&gt;
        // As for time scale, we will use also a &amp;quot;factory&amp;quot;.&lt;br /&gt;
        final Frame GCRF = FramesFactory.getGCRF();&lt;br /&gt;
&lt;br /&gt;
        // Initial orbit&lt;br /&gt;
        final double sma = 7200.e+3;&lt;br /&gt;
        final double ecc = 0.;&lt;br /&gt;
        final double inc = FastMath.toRadians(98.);&lt;br /&gt;
        final double pa = FastMath.toRadians(0.);&lt;br /&gt;
        final double raan = FastMath.toRadians(0.);&lt;br /&gt;
        final double anm = FastMath.toRadians(0.);&lt;br /&gt;
        final double MU = Constants.WGS84_EARTH_MU;&lt;br /&gt;
        &lt;br /&gt;
        final KeplerianParameters par = new KeplerianParameters(sma, ecc, inc, pa, raan, anm, PositionAngle.MEAN, MU);&lt;br /&gt;
        final KeplerianOrbit iniOrbit = new KeplerianOrbit(par, GCRF, date0);&lt;br /&gt;
        &lt;br /&gt;
        // Creating a mass model (see also specific example)&lt;br /&gt;
        final AssemblyBuilder builder = new AssemblyBuilder();&lt;br /&gt;
        &lt;br /&gt;
        // Main part&lt;br /&gt;
        final double iniMass = 900.;&lt;br /&gt;
        builder.addMainPart(&amp;quot;MAIN&amp;quot;);&lt;br /&gt;
        builder.addProperty(new MassProperty(iniMass), &amp;quot;MAIN&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Tank part (ergols mass)&lt;br /&gt;
        final double ergolsMass = 100.;&lt;br /&gt;
        final TankProperty tank = new TankProperty(ergolsMass);&lt;br /&gt;
        builder.addPart(&amp;quot;TANK&amp;quot;, &amp;quot;MAIN&amp;quot;, Transform.IDENTITY);&lt;br /&gt;
        builder.addProperty(tank, &amp;quot;TANK&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        // Engine part&lt;br /&gt;
        final double isp = 300.;&lt;br /&gt;
        final double thrust = 400.;&lt;br /&gt;
        final PropulsiveProperty prop = new PropulsiveProperty(thrust, isp); // au lieu de new PropulsiveProperty(&amp;quot;PROP&amp;quot;, thrust, isp);&lt;br /&gt;
        &lt;br /&gt;
        builder.addPart(&amp;quot;PROP&amp;quot;, &amp;quot;MAIN&amp;quot;, Transform.IDENTITY);&lt;br /&gt;
        builder.addProperty(prop, &amp;quot;PROP&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        final Assembly assembly = builder.returnAssembly();&lt;br /&gt;
        final MassProvider mm = new MassModel(assembly);&lt;br /&gt;
&lt;br /&gt;
        // We create a spacecratftstate&lt;br /&gt;
        final SpacecraftState iniState = new SpacecraftState(iniOrbit, mm);&lt;br /&gt;
        &lt;br /&gt;
        // Initialization of the Runge Kutta integrator with a 2 s step&lt;br /&gt;
        final double pasRk = 2.;&lt;br /&gt;
        final FirstOrderIntegrator integrator = new ClassicalRungeKuttaIntegrator(pasRk);&lt;br /&gt;
&lt;br /&gt;
        // Initialization of the propagator&lt;br /&gt;
        final NumericalPropagator propagator = new NumericalPropagator(integrator);&lt;br /&gt;
        propagator.resetInitialState(iniState);&lt;br /&gt;
        &lt;br /&gt;
        // Forcing integration using cartesian equations&lt;br /&gt;
        propagator.setOrbitType(OrbitType.CARTESIAN);&lt;br /&gt;
        &lt;br /&gt;
        final ArrayList&amp;lt;DateDetector&amp;gt; listOfEvents = new ArrayList&amp;lt;DateDetector&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Event corresponding to the criteria to trigger the impulsive maneuver&lt;br /&gt;
        final DateDetector eventImp = new DateDetector(date0.shiftedBy(10.));&lt;br /&gt;
        listOfEvents.add(eventImp);&lt;br /&gt;
        // Creation of the impulsive maneuver&lt;br /&gt;
        final double dv = 20.;&lt;br /&gt;
        final Vector3D deltaV = new Vector3D(dv, 0., 0.);&lt;br /&gt;
        final ImpulseManeuver imp = new ImpulseManeuver(eventImp, deltaV, prop, mm, tank, LOFType.TNW);&lt;br /&gt;
&lt;br /&gt;
        // Duration of the maneuver to reach the initial semi major axis&lt;br /&gt;
        final double duration = 49.4933;&lt;br /&gt;
        System.out.println(duration);&lt;br /&gt;
        // Creation of the continuous thrust maneuver&lt;br /&gt;
        final AbsoluteDate startDate = date0.shiftedBy(iniOrbit.getKeplerianPeriod()-0.5*duration);&lt;br /&gt;
        final DateDetector eventStart = new DateDetector(startDate);&lt;br /&gt;
        final DateDetector eventEnd = new DateDetector(startDate.shiftedBy(duration));&lt;br /&gt;
        listOfEvents.add(eventStart);&lt;br /&gt;
        listOfEvents.add(eventEnd);&lt;br /&gt;
        final Vector3D direction = new Vector3D(-1., 0., 0.);&lt;br /&gt;
        final ContinuousThrustManeuver man = new ContinuousThrustManeuver(eventStart, eventEnd, prop, direction, mm, tank);&lt;br /&gt;
        &lt;br /&gt;
        // Creation of the sequence of maneuver&lt;br /&gt;
        ManeuversSequence seq = new ManeuversSequence(0., 0.);&lt;br /&gt;
        seq.add(imp);&lt;br /&gt;
        seq.add(man);&lt;br /&gt;
        &lt;br /&gt;
        // Adding the maneuver sequence to the propagator&lt;br /&gt;
        seq.applyTo(propagator);&lt;br /&gt;
        // Adding additional state&lt;br /&gt;
        propagator.setMassProviderEquation(mm);&lt;br /&gt;
        &lt;br /&gt;
        // Adding an attitude law (or attitude sequence : mandatory)&lt;br /&gt;
        final AttitudeLaw attitudeLaw = new LofOffset(LOFType.TNW, RotationOrder.ZYX, 0., 0., 0.);&lt;br /&gt;
        propagator.setAttitudeProvider(attitudeLaw);&lt;br /&gt;
&lt;br /&gt;
        // Dt to get information just before/after an event&lt;br /&gt;
        final double dt = 1.e-6;&lt;br /&gt;
        &lt;br /&gt;
        for (int i = 0; i &amp;lt; listOfEvents.size(); i++) {&lt;br /&gt;
            &lt;br /&gt;
            System.out.println(&amp;quot;\nEVENT #&amp;quot;+i);&lt;br /&gt;
            &lt;br /&gt;
            System.out.println(&amp;quot;Before ...&amp;quot;);&lt;br /&gt;
            final AbsoluteDate dateBefore = listOfEvents.get(i).getDate().shiftedBy(-dt);&lt;br /&gt;
            final SpacecraftState finalStateBefore = propagator.propagate(dateBefore);&lt;br /&gt;
            printResults(dateBefore.toString(TUC), finalStateBefore, imp, man);&lt;br /&gt;
            &lt;br /&gt;
            System.out.println(&amp;quot;After ...&amp;quot;);&lt;br /&gt;
            final AbsoluteDate dateAfter = listOfEvents.get(i).getDate().shiftedBy(dt);&lt;br /&gt;
            final SpacecraftState finalStateAfter = propagator.propagate(dateAfter);&lt;br /&gt;
            printResults(dateAfter.toString(TUC), finalStateAfter, imp, man);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private static void printResults ( final String sdate, final SpacecraftState sc,&lt;br /&gt;
            final ImpulseManeuver imp, final ContinuousThrustManeuver man ) throws PatriusException {&lt;br /&gt;
        System.out.println(&amp;quot;  Date = &amp;quot;+sdate);&lt;br /&gt;
        System.out.println(&amp;quot;  Impulsive Maneuver = &amp;quot;+imp.getUsedDV()+&amp;quot; m/s&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;  Continuous Maneuver = &amp;quot;+man.getUsedDV()+&amp;quot; m/s&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;  Ergols Mass = &amp;quot;+sc.getMass(&amp;quot;TANK&amp;quot;)+&amp;quot; kg&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;  Semi major axis = &amp;quot;+sc.getA()/1000.+&amp;quot; km&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;  Eccentricity = &amp;quot;+sc.getE());&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>