Propagation : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(New fashion (since V11.4))
(Old fashion (before V11.4))
Ligne 25 : Ligne 25 :
 
Then, the propagation will be done by calling the <font color=#4169E1>propagateInMasterMode</font> method.
 
Then, the propagation will be done by calling the <font color=#4169E1>propagateInMasterMode</font> method.
  
=== Old fashion (before V11.4) ===
+
=== Old fashion (before V11.4 but still available) ===
  
 
The list of <font color=#4169E1>SpacecraftState</font> (see [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] definition) could be recover using the <font color=#4169E1>getSpacecraftStateList()</font> method. In the following example, we have no additional events (reason why of the null second argument).
 
The list of <font color=#4169E1>SpacecraftState</font> (see [[https://logiciels.cnes.fr/en/node/62?type=desc PATRIUS]] definition) could be recover using the <font color=#4169E1>getSpacecraftStateList()</font> method. In the following example, we have no additional events (reason why of the null second argument).

Version du 24 septembre 2019 à 12:42

Slave mode

The simplest way to propagate is to use the “slave mode”. The final result (at the date of the end of the propagation will be stored in a [PATRIUS] SpacecraftState object.

System.out.println("Initial orbit:");
System.out.println("Date:"+iniOrbit.getDate());
System.out.println("SMA:"+iniOrbit.getA());
 
final SpacecraftState sc = test.propagateInSlaveMode();
 
System.out.println("Final orbit:");
System.out.println("Date:"+sc.getDate());
System.out.println("SMA:"+sc.getA());

Master mode

On the other side, if the user wants to store intermediate data all along the propagation, it is possible to use the “master mode”. To do it, it will have to create an OutputConfig object as below, giving the output frames (inertial and local ones) as well as the output step (here 60s):

final OutputConfig output = new OutputConfig(FramesFactory.getEME2000(), LOFType.LVLH, 60.);

Then, the propagation will be done by calling the propagateInMasterMode method.

Old fashion (before V11.4 but still available)

The list of SpacecraftState (see [PATRIUS] definition) could be recover using the getSpacecraftStateList() method. In the following example, we have no additional events (reason why of the null second argument).

The last argument allows to specify how results will be stored. We may choose between the following options:

  • StorageType.MEMORY => only the spacecraft states in memory
  • StorageType.FILE_SC_BINARY => only the spacecraft states but directly written in a SQLite file (to avoid to use too much RAM)
  • StorageType.FILE_COLUMNS => all output variables (see here) are computed and stored in a SQLite file (since V11.1).
test.propagateInMasterMode(output, null, StorageType.MEMORY);
List<SpacecraftState> listOfSc = test.getSpacecraftStateList();

The user may now use this list …

final int nb = listOfSc.size();
System.out.println("Amount of S/C states = "+nb);
System.out.println("Final orbit:");
System.out.println("Date:"+listOfSc.get(nb-1).getDate());
System.out.println("SMA:"+listOfSc.get(nb-1).getA());

New fashion (since V11.4)

Now, it is possible to combine any kind of output modes, using the following states:

  • StorageType.MEMORY_SC (ex StorageType.MEMORY) ⇒ spacecraft states memory stored
  • StorageType.MEMORY_COL ⇒ output variables memory stored; possibility to get them using getVarsList(), getVars(index), getVar(index,key) methods
  • StorageType.MEMORY_ALLMEMORY_SC et MEMORY_COL
  • StorageType.NONE ⇒ no memory storage
  • StorageType.FILE_SC (ex StorageType.FILE_SC_BINARY) ⇒ spacecraft states stored in a file
  • StorageType.FILE_COL (ex StorageType.FILE_COLUMNS) ⇒ output variables stored in a file
  • StorageType.FILE_ALL ⇒ StorageType.FILE_SC et StorageType.FILE_COL
  • StorageType.NONE ⇒ no files

In order to differentiate memory vs file choice, the propagateInMasterMode() method can accept both states as in the examples below:

test.propagateInMasterMode(output, events, StorageType.MEMORY_SC, StorageType.NONE);

⇒ only spacecraft states memory stored (equivalent to the old MEMORY state)

test.propagateInMasterMode(output, events, StorageType.NONE, StorageType.File_COL);

⇒ no memory storage and output variables stored in a file (as the old FILE_COLUMNS state)

test.propagateInMasterMode(output, events, StorageType.MEMORY_SC, StorageType.File_ALL);

⇒ spacecraft states stored both in memory and file as output variables will be stored in a file.

At last, to manage output variables as spacecraft states, these methods are available:

  • getVariablesList(), getVariablesWithoutEventsList(), getVariablesOnlyEventsList()
  • getVariables(index), getVariablesWithoutEvents(index), getVariablesOnlyEvents(index)
  • getVariable (index, key), getVariableWithoutEvents(index, key), getVariableOnlyEvents(index, key)

Note that to get those lists of spacecraft states and/or variables, it is not necessary to have stored them in memory. Indeed, PSIMU is able to know if data has been directly stored in a file and, if it is the case, it will read in this file rather than in memory (using the methods described below).