<?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=SequenceOfAttitudes_4.4</id>
	<title>SequenceOfAttitudes 4.4 - 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=SequenceOfAttitudes_4.4"/>
	<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=SequenceOfAttitudes_4.4&amp;action=history"/>
	<updated>2026-04-04T19:49:23Z</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=SequenceOfAttitudes_4.4&amp;diff=2471&amp;oldid=prev</id>
		<title>Admin le 3 octobre 2019 à 12:01</title>
		<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=SequenceOfAttitudes_4.4&amp;diff=2471&amp;oldid=prev"/>
		<updated>2019-10-03T12:01:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 3 octobre 2019 à 12:01&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Ligne 1 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 1 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;java&quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class SequenceOfAttitudeLaws {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class SequenceOfAttitudeLaws {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l125&quot;&gt;Ligne 125 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 126 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key w3?hpatrius?hprod:diff:1.41:old-2458:rev-2471:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://patrius.cnes.fr/index.php?title=SequenceOfAttitudes_4.4&amp;diff=2458&amp;oldid=prev</id>
		<title>Admin : Page créée avec « public class SequenceOfAttitudeLaws {      public static void main(String[] args) throws PatriusException, IOException, URISyntaxException {                  // Patrius Da... »</title>
		<link rel="alternate" type="text/html" href="https://patrius.cnes.fr/index.php?title=SequenceOfAttitudes_4.4&amp;diff=2458&amp;oldid=prev"/>
		<updated>2019-10-03T11:44:25Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « public class SequenceOfAttitudeLaws {      public static void main(String[] args) throws PatriusException, IOException, URISyntaxException {                  // Patrius Da... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;public class SequenceOfAttitudeLaws {&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws PatriusException, IOException, URISyntaxException {&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 iniDate = 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 exc = 0.01;&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(90.);&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, exc, inc, pa, raan, anm, PositionAngle.MEAN, MU);&lt;br /&gt;
        final Orbit iniOrbit = new KeplerianOrbit(par, GCRF, iniDate);&lt;br /&gt;
        &lt;br /&gt;
        // Using the Meeus model for the Sun.&lt;br /&gt;
        final CelestialBody sun = new MeeusSun();&lt;br /&gt;
        final double sunRadius = Constants.SUN_RADIUS;&lt;br /&gt;
        &lt;br /&gt;
        // Definition of the Earth ellipsoid for later atmospheric density computation&lt;br /&gt;
        final Frame ITRF = FramesFactory.getITRF();&lt;br /&gt;
        final double earthRadius = Constants.WGS84_EARTH_EQUATORIAL_RADIUS;&lt;br /&gt;
        final GeometricBodyShape earth = new ExtendedOneAxisEllipsoid(earthRadius, Constants.WGS84_EARTH_FLATTENING, ITRF, &amp;quot;EARTH&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Initializing attitude sequence&lt;br /&gt;
        final AttitudesSequence seqAtt = new AttitudesSequence();&lt;br /&gt;
        &lt;br /&gt;
        // Building a first attitude law (Sun pointing)&lt;br /&gt;
        final Vector3D firstAxis = new Vector3D(1., 0., 0.);&lt;br /&gt;
        final Vector3D secondAxis = new Vector3D(0., 1., 0.);&lt;br /&gt;
        final AttitudeLaw sunPointingLaw = new SunPointing(sun, firstAxis, secondAxis, sun);&lt;br /&gt;
        &lt;br /&gt;
        // Building a second attitude law (LVLH)&lt;br /&gt;
        final AttitudeLaw lvlhLaw = new LofOffset(LOFType.LVLH);&lt;br /&gt;
        &lt;br /&gt;
        // Events that will switch from a law to another&lt;br /&gt;
        final double maxCheck = 10.;&lt;br /&gt;
        final double threshold = 1.e-3;&lt;br /&gt;
        final EventDetector eventEntryEclipse = new EclipseDetector(sun, sunRadius, earth, earthRadius, 0,&lt;br /&gt;
                maxCheck, threshold, Action.RESET_STATE, Action.RESET_STATE);&lt;br /&gt;
        final EventDetector eventExitEclipse = new EclipseDetector(sun, sunRadius, earth, earthRadius, 0,&lt;br /&gt;
                maxCheck, threshold, Action.RESET_STATE, Action.RESET_STATE);&lt;br /&gt;
        &lt;br /&gt;
        //Adding switches&lt;br /&gt;
        seqAtt.addSwitchingCondition(lvlhLaw, eventEntryEclipse, true, false, sunPointingLaw);&lt;br /&gt;
        seqAtt.addSwitchingCondition(sunPointingLaw, eventExitEclipse, false, true, lvlhLaw);&lt;br /&gt;
        &lt;br /&gt;
        testByPropagation(iniOrbit, seqAtt, sun);&lt;br /&gt;
              &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static void testByPropagation ( final Orbit iniOrbit, final AttitudesSequence seqAtt, final CelestialBody sun ) throws PatriusException {&lt;br /&gt;
        &lt;br /&gt;
        // We create a spacecratftstate&lt;br /&gt;
        final SpacecraftState iniState = new SpacecraftState(iniOrbit);&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;
        // Adding the attitude sequence&lt;br /&gt;
        propagator.setAttitudeProvider(seqAtt);&lt;br /&gt;
        seqAtt.registerSwitchEvents(propagator);&lt;br /&gt;
        &lt;br /&gt;
        // Loop every 10 mn ...&lt;br /&gt;
        final double step = 600.;&lt;br /&gt;
        final double epsilon = 1.e-12;&lt;br /&gt;
        for (int i = 1; i &amp;lt;= 20; i++) {&lt;br /&gt;
            &lt;br /&gt;
            AbsoluteDate date = iniOrbit.getDate().shiftedBy(i*step);&lt;br /&gt;
&lt;br /&gt;
            final SpacecraftState state = propagator.propagate(date);&lt;br /&gt;
&lt;br /&gt;
            // Attitude in LVLH&lt;br /&gt;
            final Attitude attLVLH = state.getAttitude(LOFType.LVLH);&lt;br /&gt;
            final double psiLVLH  = attLVLH.getRotation().getAngles(RotationOrder.ZYX)[0];&lt;br /&gt;
            final double tetaLVLH = attLVLH.getRotation().getAngles(RotationOrder.ZYX)[1];&lt;br /&gt;
&lt;br /&gt;
            // Attitude in GCRF&lt;br /&gt;
            final Attitude attGCRF = state.getAttitude();&lt;br /&gt;
            final double psiGCRF  = attGCRF.getRotation().getAngles(RotationOrder.ZYX)[0];&lt;br /&gt;
            final double tetaGCRF = attGCRF.getRotation().getAngles(RotationOrder.ZYX)[1];&lt;br /&gt;
&lt;br /&gt;
            // Direction of the Sun from the cdg of the satellite&lt;br /&gt;
            final Vector3D sunPos = sun.getPVCoordinates(date, FramesFactory.getGCRF()).getPosition();&lt;br /&gt;
            final Vector3D satPos = state.getPVCoordinates().getPosition();&lt;br /&gt;
            final Rotation sunDir = new Rotation(Vector3D.PLUS_I, sunPos.subtract(satPos));&lt;br /&gt;
            &lt;br /&gt;
            // Sun direction&lt;br /&gt;
            final double psiSun  = sunDir.getAngles(RotationOrder.ZYX)[0];&lt;br /&gt;
            final double tetaSun = sunDir.getAngles(RotationOrder.ZYX)[1];&lt;br /&gt;
&lt;br /&gt;
            if ( (FastMath.abs(psiLVLH) &amp;lt; epsilon) || (FastMath.abs(tetaLVLH) &amp;lt; epsilon) ) {&lt;br /&gt;
                System.out.println(date+&amp;quot; =&amp;gt; LVLH mode&amp;quot;);&lt;br /&gt;
            } else {&lt;br /&gt;
                System.out.println(date+&amp;quot; =&amp;gt; Sun pointing mode&amp;quot;);&lt;br /&gt;
                System.out.println(&amp;quot;    Delta Psi  = &amp;quot;+FastMath.toDegrees(psiSun-psiGCRF)+&amp;quot; deg&amp;quot;);&lt;br /&gt;
                System.out.println(&amp;quot;    Delta Teta = &amp;quot;+FastMath.toDegrees(tetaSun-tetaGCRF)+&amp;quot; deg&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>