Data initialization : Différence entre versions

De Wiki
Aller à : navigation, rechercher
Ligne 31 : Ligne 31 :
 
:* '''FACTORY''' (equivalent to the most complete definition as in the <font color=#FF8C00>GUI</font>)
 
:* '''FACTORY''' (equivalent to the most complete definition as in the <font color=#FF8C00>GUI</font>)
 
:* '''IGNORE''' (nothing is define internally by <font color=#556B2F>'''PSIMU'''</font> which will take into account the user parametrization previously done)
 
:* '''IGNORE''' (nothing is define internally by <font color=#556B2F>'''PSIMU'''</font> which will take into account the user parametrization previously done)
 +
 +
== Vehicle ==
 +
 +
In fact, we need to pass both an Assembly and a mass provider. 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 mass provider (see example with maneuvers). To get them, we could use the <font color=#4169E1>AssemblyBuilder</font> given by [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] or the <font color=#4169E1>CustomVehicle</font> class coming from [[https://logiciels.cnes.fr/en/node/78?type=desc GENOPUS]] waiting for the next <font color=#4169E1>Vehicle</font> class that will appear from [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] V3.4. In the example below, we will use the <font color=#4169E1>CustomVehicle</font> class initializing mass and aerodynamic properties (here no engines and no tanks):
 +
 +
<syntaxhighlight lang="java">
 +
// 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);
 +
</syntaxhighlight>
 +
 +
<font color=#FF0000>''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).''</font>>

Version du 7 juillet 2017 à 07:09

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 mass provider. 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 mass provider (see example with maneuvers). 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).>