Data initialization : Différence entre versions

De Wiki
Aller à : navigation, rechercher
Ligne 104 : Ligne 104 :
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Aerodynamic ==
+
=== Aerodynamic ===
  
 
Then we could add an aerodynamic force model
 
Then we could add an aerodynamic force model
Ligne 121 : Ligne 121 :
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Solar adiative pressure ==
+
=== Solar adiative pressure ===
  
 
Here are explained how to use both radiative pressure and rediffused radiative pressure force models:
 
Here are explained how to use both radiative pressure and rediffused radiative pressure force models:

Version du 7 juillet 2017 à 07:21

Orbit

To initialize an orbit, we simply have to build it using [PATRIUS] object. For example:

final TimeScale TUC = TimeScalesFactory.getUTC();
final AbsoluteDate date = new AbsoluteDate("2010-01-01T12:00:00.000", TUC);       
final double sma = Constants.WGS84_EARTH_EQUATORIAL_RADIUS + 250.e3;
final double ecc = 0.;
final double inc = FastMath.toRadians(51.6);
final double raan = FastMath.toRadians(0.);
final double pa  = FastMath.toRadians(0.);
final double ano = FastMath.toRadians(0.);
final Frame GCRF = FramesFactory.getGCRF();
final KeplerianOrbit iniOrbit =
  new KeplerianOrbit(sma, ecc, inc, raan, pa, ano, PositionAngle.MEAN, GCRF, date, MU);

Earth features

Data equivalent to the “Earth features” tab are distributed via two arguments:

1. A ExtendedOneAxisEllipsoid object which will define the shape of the planet
final ExtendedOneAxisEllipsoid EARTH =
   new ExtendedOneAxisEllipsoid(REQ, FLAT, ITRF, "EARTH");
2. A type of enumerates that will propose some pre-defined configurations as:
  • NOTHING (all options set to null)
  • ONLY_PREC_NUT (only precession and nutation)
  • FACTORY (equivalent to the most complete definition as in the GUI)
  • IGNORE (nothing is define internally by PSIMU which will take into account the user parametrization previously done)

Vehicle

In fact, we need to pass both an Assembly and a MassProvider. It could seem curious but it is due to the fact that, if we have maneuvers, it will be mandatory to initialize them with the same MassProvider (see example here). To get them, we could use the AssemblyBuilder given by [PATRIUS] or the CustomVehicle class coming from [GENOPUS] waiting for the next Vehicle class that will appear from [PATRIUS] V3.4. In the example below, we will use the CustomVehicle class initializing mass and aerodynamic properties (here no engines and no tanks):

// Dry mass
final double dryMass = 1000.;
final MassProperty dryMassProperty = new MassProperty(dryMass);
// Shape
final CustomSphere sphere = new CustomSphere(5.0);
final CustomVehicleSurfaceModel vehicleRefSurface =
   new CustomVehicleSurfaceModel(sphere);
// Aerodynamic properties
final double cd = 2.0;
final double cl = 0.;
final CustomAerodynamicProperties aerodynamicProperties =
   new CustomAerodynamicProperties(vehicleRefSurface, cd, cl);
 
final CustomVehicle vehicle =
   new CustomVehicle(dryMassProperty, aerodynamicProperties, null, null, null);
final Assembly assembly = vehicle.getAssembly(GCRF);
final MassProvider mm = new MassModel(assembly);

Note : be careful that the frame (GCRF in the previous example), mandatory in the construction of the vehicle must be exactly the same that the one used for the propagation (limitation due to PATRIUS).

Forces

To define, which forces will be applied along the trajectory, we use the CustomForceModels class (waiting for the equivalent [PATRIUS] class).

Potential

In the following example, we will initialize the potential model (mandatory).

// Potential
final ForceModel potential =  createPot("grim4s4_gr", 8, 8);
 
final CustomForceModels forces = new CustomForceModels(potential, null, null, null, null, null, null, null, null, null, null);

Note that the createPot() static method is the following one (waiting for such utility from V3.4.1 of [PATRIUS]):

public static ForceModel createPot ( String namePot, int nzo, int nte) throws IOException, ParseException, OrekitException {
 
// Adding « reader » for gravity models
GravityFieldFactory.addPotentialCoefficientsReader(
    new GRGSFormatReader(namePot, true));
 
// Getting gravity model from « namePot » model
final PotentialCoefficientsProvider provider =
    GravityFieldFactory.getPotentialProvider();
 
// Getting zonal and tesseral terms
final int n = nzo; // max zonal degree
final int m = nte; // max tesseral order
 
int ntmp = 1;
if ( n != 0 ) ntmp = nzo;
 
final double[][] C = provider.getC(ntmp, m, false);
final double[][] S = provider.getS(ntmp, m, false);
 
// Force model creation
ForceModel pot = new DrozinerAttractionModel(FramesFactory.getITRF(),
                    provider.getAe(), provider.getMu(), C, S);
 
return pot;
 
}

Aerodynamic

Then we could add an aerodynamic force model

final double REQ  = Constants.WGS84_EARTH_EQUATORIAL_RADIUS;
final double FLAT = Constants.WGS84_EARTH_FLATTENING;
final Frame ITRF = FramesFactory.getITRF();
final ExtendedOneAxisEllipsoid EARTH =
   new ExtendedOneAxisEllipsoid(REQ, FLAT, ITRF, "EARTH");
 
final CustomAtmosphere atmosphere = new CustomUS76(EARTH);
final CustomDragForce dragForce = new CustomDragForce(1., atmosphere, assembly);
 
forces.setDragForce(dragForce);

Solar adiative pressure

Here are explained how to use both radiative pressure and rediffused radiative pressure force models:

final CelestialBody sunBody = new MeeusSun();
final double dRef = 1.4959787E11;
final double pRef = 4.5605E-6;
final ExtendedOneAxisEllipsoid EARTH =
   new ExtendedOneAxisEllipsoid(REQ, FLAT, ITRF, "EARTH");
 
final CustomPatriusSolarRadiationPressure radPres =
   new CustomPatriusSolarRadiationPressure(dRef, pRef, sunBody, EARTH, assembly, 1.);
 
forces.setSolarRadiationPressure(radPres);
 
// By default values used when GUI mode ...
final int inCorona = 1;
final int inMeridian = 10;
final IEmissivityModel inEmissivityModel = new KnockeRiesModel();
// Value accessible via GUI mode
final boolean inAlbedo = false;
final boolean inIr = false;
final double coefAlbedo = 1.;
final double coefIr = 1.;
 
final CustomRediffusedRadiationPressure rediffusedRadiationPressure =
   new CustomRediffusedRadiationPressure(sunBody, GCRF, inCorona, inMeridian,
                                         inEmissivityModel, inAlbedo, inIr,
                                         coefAlbedo, coefK0Ir, assembly);
 
forces.setRediffusedSolarRadiationPressure(rediffusedRadiationPressure);

Maneuvers