CreateKeplerianOrbit : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(Page créée avec « <syntaxhighlight lang="java"> public class SimpleKeplerianOrbit { public static void main(String[] args) throws PatriusException { // Patrius Dat... »)
 
(Aucune différence)

Version actuelle en date du 13 février 2018 à 10:09

public class SimpleKeplerianOrbit {
 
    public static void main(String[] args) throws PatriusException {
 
        // Patrius Dataset initialization (needed for example to get the UTC time)
        PatriusDataset.addResourcesFromPatriusDataset() ;
 
        // Recovery of the UTC time scale using a "factory" (not to duplicate such unique object)
        final TimeScale TUC = TimeScalesFactory.getUTC();
 
        // Date of the orbit given in UTC time scale)
        final AbsoluteDate date = new AbsoluteDate("2010-01-01T12:00:00.000", TUC);
 
        // Getting the frame with wich will defined the orbit parameters
        // As for time scale, we will use also a "factory".
        final Frame GCRF = FramesFactory.getGCRF();
 
        // Creation of a keplerian orbit
        final double sma = 7200.e+3;
        final double exc = 0.01;
        final double inc = FastMath.toRadians(98.);
        final double pa = FastMath.toRadians(0.);
        final double raan = FastMath.toRadians(0.);
        final double anm = FastMath.toRadians(0.);
        final double MU = Constants.WGS84_EARTH_MU;
        final KeplerianOrbit iniOrbit = new KeplerianOrbit(sma, exc, inc, pa, raan, anm, PositionAngle.MEAN, GCRF, date, MU);
 
        // Printing the Keplerian period
        System.out.println();
        System.out.println("Tper = "+iniOrbit.getKeplerianPeriod()+" s");
 
        // Propagating 100 s with a keplerian motion
        final double dt = 100.;
        final Orbit finalOrbit = iniOrbit.shiftedBy(dt);
 
        // Printing new date and latitude argument
        System.out.println();
        System.out.println("Initial true latitude argument = "+FastMath.toDegrees(iniOrbit.getLv())+" deg");
        System.out.println("New date = "+finalOrbit.getDate().toString(TUC)+" deg");
        System.out.println("True latitude argument = "+FastMath.toDegrees(finalOrbit.getLv())+" deg");
 
    }
 
}