Tutorials 4.1 Vehicle : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(Page créée avec « == What is a propagator? == We must differentiate a numerical '''integrator''' and a numerical '''propagator''' ... A numerical integrator is a low level block allowing... »)
 
Ligne 1 : Ligne 1 :
== What is a propagator? ==
+
== What is an Assembly ? ==
  
We must differentiate a numerical '''integrator''' and a numerical '''propagator''' ...
+
As explained more in details in the user manual, the [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly] is a mean to build a vehicle. The main principles are the following ones:
 +
* An [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly] is described by its sub parts (and can be made of only one).
 +
* Each of these parts is defined by a name, a frame to know its position and orientation at any time, and a list of properties.
 +
* The first created part is the "main part". Its associated frame defines the "main frame" of the vehicle.
  
A numerical integrator is a low level block allowing to integrate differential equations, not only those linked to a trajectory. So, if you want to use this integrator level, you will have to define your own equations, specially the second term which can be complex  when you have to consider a lot of perturbation terms in a trajectory extrapolation.
+
The [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly]'s creation is made through a "builder" object as in the example below.
 
+
That is why <font color=#556B2F>'''PATRIUS'''</font> proposes a higher level object allowing to propagate an orbit (and more generally a trajectory). This object already have internaly some differential kind of equations (<font color=#FF0000>cartesian</font> form, <font color=#FF0000>equinoctial</font> form, ...) and has some very powerful mechanism to add <font color=#FF0000>perturbation force models</font> as we could see in further tutorials by using the <font color=#4169E1>addForceModel()</font> method.
+
 
+
The basic philosophy is then:
+
# to create a numerical propagator giving it an associated numerical integrator
+
# to give it initial conditions via a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] object (including at least an orbit but also possibly a mass model and an attitude).
+
# optionaly to specify which kind of equations and which frame to use (by default the ones consistent with the initial orbit definition).
+
# at last to call for the <font color=#4169E1>propagate()</font> method up to a certain absolute date. It will return a new [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] object.
+
  
 
'''Code examples:'''
 
'''Code examples:'''
  
* [[NumericalPropagatorRungeKutta|Numerical propagation using a 4th order Runge Kutta integrator]]
+
* [[VehicleWithMassProperty_4.1|Vehicle with mass property]]
 
+
* [[VehicleWithMassPropertyAndTank_4.1|Vehicle with mass property and tank]]
* [[NumericalPropagatorDOP|Numerical propagation using a DOP integrator]]
+
 
+
== With a step handler ==
+
 
+
A step handler (here a fixed step handler) is the functionnality allowing to extract some data along the numerical propagation. This mechanism is done thanks to an internal interpolation and do not modify the precision of the numerical integration.
+
 
+
For example, if you have a <font color=#FF8C00 title="4th order Runge Kutta">RK4</font> integrator with a time integration step of 10s and if you want to extract data every 5s, it will not interfere on the 10s steps (meaning that it will not reduce the time integration step to 5s).
+
 
+
'''Code example:''' [[NumericalPropagationtWithFixedStepHandler|Numerical propagation with a fixed step handler]]
+
 
+
== With a STOP event ==
+
 
+
Thanks to a "G-stop" functionnality included into numerical integrators, it is possible to add events to the propagator. This one will then automatically detect when the event occured and will execute the action associated with the event (a STOP action in the first example below). A large amount of predefined events are already available with <font color=#556B2F>'''PATRIUS'''</font>. Here, the example will treat of an altitude event. The second example is more or less the same kind of example than the previous one but, in that case, we added a custom event. This is done using an internal class in order to get all in the same method but, practically, it is recommended to define this custom event in a specific class for a better readability.
+
 
+
'''Code examples:'''
+
 
+
* [[NumericalPropagationWithStopEvent|Numerical propagation with a STOP event]]
+
 
+
* [[NumericalPropagationWithCustomEvent|Numerical propagation with a custom event]]
+
 
+
== With attitude laws ==
+
 
+
The way to consider a single attitude law is relatively easy as we have just to create an attitude law (in the code below, a <font color=#FF8C00 title="Local Orbital Frame">LOF</font> law) and call for the <font color=#4169E1>setAttitudeProvider()</font> method. For more explanations about creating attitude laws, see [[AttitudeTutorials|specific tutorials]].
+
 
+
To add an attitude sequence in a numerical propagator is just a bit more complex than just adding a single attitude law:
+
* first, we have to define an attitude sequence. In the code below, we considered a sequence only with two switches and two laws but it can be actually more sophisticated. For more explanations about the way to build attitude sequences, see [[AttitudeTutorials|specific tutorials]].
+
* then, we must add the sequence to the propagator by using the <font color=#4169E1>setAttitudeProvider()</font> method.
+
<syntaxhighlight lang="java">
+
propagator.setAttitudeProvider(seqAtt);
+
</syntaxhighlight>
+
* at last, we must not forget to tell to the sequence that a propagator is "looking" at it by calling the <font color=#4169E1>registerSwitchEvents()</font> method
+
<syntaxhighlight lang="java">
+
seqAtt.registerSwitchEvents(propagator);
+
</syntaxhighlight>
+
 
+
'''Code examples:'''
+
 
+
* [[NumericalPropagationWithAttitude|Numerical propagation with an attitude law]]
+
* [[NumericalPropagationWithAttitudeSequence|Numerical propagation with an attitude sequence]]
+
 
+
== With a mass model ==
+
 
+
A mass model allows, within a propagation, to take into account mass variations (typically due to maneuvers). This is done thanks to the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly] construction (see also specific tutorials on it). Anyway, when using such [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/models/MassModel.html MassModel], it is mandatory :
+
* to add it to the initial SpacecraftState
+
* to feed the additional equations to the propagator by using the (<font color=#4169E1>setMassProviderEquation()</font>) method.
+
 
+
'''Code example:''' [[NumericalPropagationWithMass|Numerical propagation with a mass model]]
+
 
+
== Using force models ==
+
 
+
If nothing specific is requested, a numerical propagator will only deal with a Keplerian motion using the central term of the potential got from the initial orbit. If we want to add other force models, we will have to use the <font color=#4169E1>addForceModel()</font> method.
+
 
+
=== Using a potential field ===
+
In the first example below, we will give the way to use a <font color=#FF8C00 title="International Center for Global Gravity Field Models">ICGEM</font> potential field with <font color=#FF8C00>Droziner</font> equations up to 8x8 degrees. Up to now, it is not possible simply to select a specific potential field if several ones are available. For such functionnality, we can use the utility method given at the end of this tutorial.
+
 
+
'''Code example:''' [[NumericalPropagationWithPotential|Numerical propagation with a specific potential field]]
+
 
+
=== Using a drag model ===
+
 
+
In the second example, we will take into account a drag model and have to do both things:
+
* adding to the vehicle (i.e. the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly]) the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/properties/AeroSphereProperty.html AeroSphereProperty]
+
* creating a force model including this aerodynamic drag model plus an atmospheric model and adding it to the propagator
+
 
+
'''Code example:''' [[NumericalpropagationWithDrag|Numerical propagation with a drag model]]
+
 
+
=== Using a drag and lift model ===
+
 
+
A bit like the previous example, we are going to see how to use a drag and a lift model. The way to do it is almost the same:
+
* adding to the vehicle (i.e. the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/Assembly.html Assembly]) the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/properties/AeroGlobalProperty.html AeroGlobalProperty]) (rather than the [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/properties/AeroSphereProperty.html AeroSphereProperty])
+
* creating a force model including this aerodynamic lift+drag model plus an atmospheric model and adding it to the propagator
+
 
+
Nevertheless, an another important point is mandatory: as we need to know which is the direction of the lift (perpendicular to the drag which is opposite to the relative velocity), <u>we must add an attitude law to the Spacecraft as it is done below by using the <font color=#4169E1>setAttitudeProvider()</font> method</u>.
+
 
+
The only difference between both example is due to the change of the atmospheric model.
+
 
+
'''Code examples:'''
+
 
+
* [[NumericalPropagationWithLiftAndDrag|Numerical propagation with a drag an lift model]]
+
 
+
* [[NumericalPropagationWithLiftAndDragAndMSISE2000|Numerical propagation with a drag an lift model and the MSIS2000 atmospheric model]]
+
 
+
== With maneuvers ==
+
 
+
=== Impusive maneuvers ===
+
 
+
Here we consider we will just add impulsive maneuvers. A way to do it is to consider such maneuvers as events. So, we will use the <font color=#4169E1>addEventDetector()</font> method.
+
 
+
Nevertheless, a very important point to consider is the fact that, due to a maneuver, the mass of the spacecraft will be modified: so, it is mandatory to define a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] with a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/models/MassModel.html MassModel] (see [[#With a mass model|specific tutorial]]).
+
 
+
'''Code example:''' [[NumericalPropagationWithImpulsiveManeuver|Numerical propagation with an impulsive maneuver]]
+
 
+
=== Continuous maneuvers ===
+
 
+
Here we will not use the principle of adding an event to the propagator but adding a force model, considering the thrust is a supplementary force. To do that, we will use the <font color=#4169E1>addForceModel()</font> method. For more details in the way to define a continuous thrust maneuver, see the specific items of the user manuel, the JavaDoc or specific tutorials.
+
 
+
As for the previous tutorial about impulsive maneuvers, it is mandatory to define a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] with a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/models/MassModel.html MassModel].
+
 
+
At last, if the thrust direction is defined in the vehicle frame, it is also mandatory to define an attitude law (or a sequence) to be able to know the actual direction of the thrust in the integration frame.
+
 
+
'''Code example:''' [[NumericalPropagationWithContinuousManeuver|Numerical propagation with a continuous maneuver]]
+
 
+
=== Sequence of maneuvers ===
+
  
Here we will use a sequence of maneuvers. This sequence will include both impulsive and continuous maneuvers (see specific tutorials to know how to do it). The main point to know is the fact that, once the maneuver sequence has been built, we do not have to pass it to the propagator ... but we must pass the propagator to the sequence using the applyTo() method !
+
== Using the Vehicle class ==
  
And, as for the two previous tutorials, do not forget to define a [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/assembly/models/MassModel.html MassModel] and eventually an attitude law ...
+
Since V3.4 version, it is now possible to use the [{{JavaDoc4.1}}/fr/cnes/sirius/patrius/assembly/Vehicle.html Vehicle] class which is simpler to use for basic spacecraft definition. the following example shows how to define:
 +
* the dry mass
 +
* the shape
 +
* the aerodynamic properties
 +
* the propulsive properties
  
'''Code example:''' [[NumericalPropagationWithManeuverSequence|Numerical propagation with a sequence of maneuvers]]
+
'''Code example:''' [[UsingVehicleClass_4.1|Using the Vehicle class]]
  
 
[[Category:Tutorials 4.1]]
 
[[Category:Tutorials 4.1]]

Version du 20 décembre 2018 à 15:48

What is an Assembly ?

As explained more in details in the user manual, the Assembly is a mean to build a vehicle. The main principles are the following ones:

  • An Assembly is described by its sub parts (and can be made of only one).
  • Each of these parts is defined by a name, a frame to know its position and orientation at any time, and a list of properties.
  • The first created part is the "main part". Its associated frame defines the "main frame" of the vehicle.

The Assembly's creation is made through a "builder" object as in the example below.

Code examples:

Using the Vehicle class

Since V3.4 version, it is now possible to use the Vehicle class which is simpler to use for basic spacecraft definition. the following example shows how to define:

  • the dry mass
  • the shape
  • the aerodynamic properties
  • the propulsive properties

Code example: Using the Vehicle class