Propagation : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(Master mode)
(Old fashion (before V11.4))
Ligne 31 : Ligne 31 :
 
The last argument allows to specify how results will be stored. We may choose between the following options:
 
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.'''MEMORY''' => only the spacecraft states in memory
* StorageType.'''FILE_SC_BINARY''' => only the spacecraft states but directly written in a sqlLite file (to avoid to use too much RAM memory)
+
* StorageType.'''FILE_SC_BINARY''' => only the spacecraft states but directly written in a [https://www.sqlite.org/ SQLite] file (to avoid to use too much RAM memory)
 
* StorageType.'''FILE_COLUMNS''' => all output variables (see [[Output#List of available variables|here]]) are computed and stored in a [https://www.sqlite.org/ SQLite] file (since V11.1).
 
* StorageType.'''FILE_COLUMNS''' => all output variables (see [[Output#List of available variables|here]]) are computed and stored in a [https://www.sqlite.org/ SQLite] file (since V11.1).
 
  
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">

Version du 24 septembre 2019 à 12:39

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)

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 memory)
  • 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)