User Manual 4.14 SpacecraftState : Différence entre versions
(Page créée avec « __NOTOC__ == Introduction == === Scope === This section describes the SpacecraftState object. === Javadoc === The object [{{JavaDoc4.13}}//fr/cnes/sirius/patrius/propag... ») |
|||
Ligne 5 : | Ligne 5 : | ||
=== Javadoc === | === Javadoc === | ||
− | The object [{{JavaDoc4. | + | The object [{{JavaDoc4.14}}//fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] is available in the package <code>fr.cnes.sirius.patrius.propagation</code>. |
Ligne 16 : | Ligne 16 : | ||
=== Overview === | === Overview === | ||
− | The [{{JavaDoc4. | + | The [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] is composed of :<br> |
− | - an [{{JavaDoc4. | + | - an [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/orbits/Orbit.html orbit]<br> |
− | - an [{{JavaDoc4. | + | - an [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/attitudes/Attitude.html attitude for forces computation] <br> |
− | - an [{{JavaDoc4. | + | - an [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/attitudes/Attitude.html attitude for events computation]<br> |
− | - a map of additional states (including mass states added from [{{JavaDoc4. | + | - a map of additional states (including mass states added from [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/MassProvider.html MassProvider]).<br> |
Two attitudes are stored in order to apply (if needed) a different treatment to each attitude. | Two attitudes are stored in order to apply (if needed) a different treatment to each attitude. | ||
Ligne 26 : | Ligne 26 : | ||
== Features Description == | == Features Description == | ||
=== One orbit === | === One orbit === | ||
− | The [{{JavaDoc4. | + | The [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] is composed of one [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/orbits/Orbit.html Orbit]. |
It is possible to simply declare a SpacecraftState with an orbit : | It is possible to simply declare a SpacecraftState with an orbit : | ||
<code>final SpacecraftState state = new SpacecraftState(orbit);</code> | <code>final SpacecraftState state = new SpacecraftState(orbit);</code> | ||
Ligne 37 : | Ligne 37 : | ||
The user can use one single | The user can use one single | ||
− | [{{JavaDoc4. | + | [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/attitudes/Attitude.html Attitude] or two different [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/attitudes/Attitude.html Attitude] objects : one for forces computation and one for events computation. The following constructor can be used : |
<code>final SpacecraftState state = new SpacecraftState(orbit, attitudeForces, attitudeEvents);</code> | <code>final SpacecraftState state = new SpacecraftState(orbit, attitudeForces, attitudeEvents);</code> | ||
Ligne 69 : | Ligne 69 : | ||
=== Mass === | === Mass === | ||
− | A [{{JavaDoc4. | + | A [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/MassProvider.html MassProvider] can be provided to the SpacecraftState. In that case, the mass information are automaticaly stored as additional states. Be careful, the mass values can never be negative: |
<syntaxhighlight lang="java">final SpacecraftState state = new SpacecraftState(orbit, massProvider); | <syntaxhighlight lang="java">final SpacecraftState state = new SpacecraftState(orbit, massProvider); | ||
Ligne 90 : | Ligne 90 : | ||
=== State vector === | === State vector === | ||
− | The [{{JavaDoc4. | + | The [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] object could be created from a state vector : |
<code>final SpacecraftState state = new SpacecraftState(stateVector, OrbitType.CARTESIAN, PositionAngle.MEAN, date, mu, frame, addStatesInfo, attProviderForces, attProviderEvents);</code> | <code>final SpacecraftState state = new SpacecraftState(stateVector, OrbitType.CARTESIAN, PositionAngle.MEAN, date, mu, frame, addStatesInfo, attProviderForces, attProviderEvents);</code> | ||
Ligne 102 : | Ligne 102 : | ||
=== Transform === | === Transform === | ||
− | The [{{JavaDoc4. | + | The [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html SpacecraftState] class contains methods to compute the following transformations : |
- <code>toTransform()</code> or <code>toTransformForces()</code> : Transform from orbit/attitude reference frame to spacecraft frame (attitude used for forces computation which is the default attitude).<br> | - <code>toTransform()</code> or <code>toTransformForces()</code> : Transform from orbit/attitude reference frame to spacecraft frame (attitude used for forces computation which is the default attitude).<br> | ||
- <code>toTransformEvents()</code> : Transform from orbit/attitude reference frame to spacecraft frame attitude used for events computation (same as toTransform if there is no specific attitude for Events). | - <code>toTransformEvents()</code> : Transform from orbit/attitude reference frame to spacecraft frame attitude used for events computation (same as toTransform if there is no specific attitude for Events). | ||
− | - <code>toTransform(Frame)</code> or <code>toTransformForces(Frame)</code> : Transform from specified [{{JavaDoc4. | + | - <code>toTransform(Frame)</code> or <code>toTransformForces(Frame)</code> : Transform from specified [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/frames/Frame.html Frame] to spacecraft frame (attitude used for forces computation which is the default attitude).<br> |
− | - <code>toTransformEvents(Frame)</code> : Transform from specified [{{JavaDoc4. | + | - <code>toTransformEvents(Frame)</code> : Transform from specified [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/frames/Frame.html Frame] to spacecraft frame attitude used for events computation (same as toTransform(Frame) if there is no attitude specific for Events).<br> |
− | - <code>toTransform(LOFType)</code> : Transform from orbit/attitude reference frame to local orbital frame ([{{JavaDoc4. | + | - <code>toTransform(LOFType)</code> : Transform from orbit/attitude reference frame to local orbital frame ([{{JavaDoc4.14}}/fr/cnes/sirius/patrius/frames/LOFType.html LOFType]).<br> |
− | - <code>toTransform(Frame, LOFType)</code> : Transform from specified [{{JavaDoc4. | + | - <code>toTransform(Frame, LOFType)</code> : Transform from specified [{{JavaDoc4.14}}/fr/cnes/sirius/patrius/frames/Frame.html Frame] to local orbital frame ([{{JavaDoc4.14}}/fr/cnes/sirius/patrius/frames/LOFType.html LOFType]).<br> |
== Getting Started == | == Getting Started == | ||
Ligne 132 : | Ligne 132 : | ||
final Vector3D pos = transform.transformPosition(sun.getPVCoordinates().getPosition()); | final Vector3D pos = transform.transformPosition(sun.getPVCoordinates().getPosition()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | If an [{{JavaDoc4. | + | If an [{{JavaDoc4.14}}//fr/cnes/sirius/patrius/assembly/Assembly.html Assembly] is used, this is not necessary to use these methods because the conversion methods are included in Assembly functionalities (see [SPC_VBU_Home dedicated User Manual]). |
== Contents == | == Contents == | ||
Ligne 145 : | Ligne 145 : | ||
|'''MassProvider''' | |'''MassProvider''' | ||
|Interface providing the mass for spacecraft models. | |Interface providing the mass for spacecraft models. | ||
− | |[{{JavaDoc4. | + | |[{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/MassProvider.html ...] |
|} | |} | ||
Ligne 158 : | Ligne 158 : | ||
|'''SpacecraftState''' | |'''SpacecraftState''' | ||
|This class is the representation of a complete state holding orbit, attitude for forces and for events computation and additional states at a given date. | |This class is the representation of a complete state holding orbit, attitude for forces and for events computation and additional states at a given date. | ||
− | |[{{JavaDoc4. | + | |[{{JavaDoc4.14}}/fr/cnes/sirius/patrius/propagation/SpacecraftState.html ...] |
|- | |- | ||
|'''Attitude''' | |'''Attitude''' | ||
|Object representing the attitude of the spacecraft for a specific date and in a specific frame. | |Object representing the attitude of the spacecraft for a specific date and in a specific frame. | ||
− | |[{{JavaDoc4. | + | |[{{JavaDoc4.14}}/fr/cnes/sirius/patrius/attitudes/Attitude.html ...] |
|} | |} | ||
[[Category:User_Manual_4.14_Flight_Dynamics]] | [[Category:User_Manual_4.14_Flight_Dynamics]] |
Version actuelle en date du 5 septembre 2024 à 14:55
Introduction
Scope
This section describes the SpacecraftState object.
Javadoc
The object SpacecraftState is available in the package fr.cnes.sirius.patrius.propagation
.
Links
Here is only described the SpacecraftState structure. Please refer to [ORB_PRO_Home propagation chapter].
Useful Documents
None as of now.
Overview
The SpacecraftState is composed of :
- an orbit
- an attitude for forces computation
- an attitude for events computation
- a map of additional states (including mass states added from MassProvider).
Two attitudes are stored in order to apply (if needed) a different treatment to each attitude.
Features Description
One orbit
The SpacecraftState is composed of one Orbit.
It is possible to simply declare a SpacecraftState with an orbit :
final SpacecraftState state = new SpacecraftState(orbit);
The orbit could be updated using the following method :
final SpacecraftState newState = state.updateOrbit(newOrbit);
The attitude and additional states will remain the same and a new SpacecraftState will be created.
Two attitudes
The user can use one single
Attitude or two different Attitude objects : one for forces computation and one for events computation. The following constructor can be used :
final SpacecraftState state = new SpacecraftState(orbit, attitudeForces, attitudeEvents);
It is possible to get the attitude for forces or events computation using the following methods:
final Attitude attForces = state.getAttitudeForces(); final Attitude attEvents = state.getAttitudeEvents();
The user can deals with a single attitude in the SpacecraftState using the following constructor:
final SpacecraftState state = new SpacecraftState(orbit, attitude); final Attitude att = state.getAttitude();
If the following constructor is used, both attitudes are set to null value:
final SpacecraftState state = new SpacecraftState(orbit);
Then calling getAttitude
or getAttitudeForces
or getAttitudeEvents
will return null attitude.
Additional states
The additional states are stored in the SpacecraftState using a Map with the additional states names as keys. The additional states are in the type double[]
.
The additional states map could be given directly to the constructor as follow :
Map<String, double[]> addStates = new HashMap<String, double[]>(); addStates.put("name", new double[]{1.0}); SpacecraftState state = new SpacecraftState(orbit, attitudeForces, attitudeEvents, addStates);
It is possible to add an additional state to a SpacecraftState usingaddAdditionalState:
state2 = state.addAdditionalState("name2", new double[]{0.1, 0.1});
Note :addAdditionalState returns a new SpacecraftState with the added additional state. It is necessary to store the returned object. The additional state is not added to the current state.
Mass
A MassProvider can be provided to the SpacecraftState. In that case, the mass information are automaticaly stored as additional states. Be careful, the mass values can never be negative:
final SpacecraftState state = new SpacecraftState(orbit, massProvider); final SpacecraftState state = new SpacecraftState(orbit, attitudeForces, attitudeEvents, massProvider, addStates);
The mass provider can be added to the SpacecraftState after its initilisation with the method addMassProvider
:
final SpacecraftState state = new SpacecraftState(orbit); final SpacecraftState newState = state.addMassProvider(massProvider);
The mass parts from MassProvider are added to additional states map with the key : "MASS_<partName>".
The total mass of the SpacecraftState could not be obtained.
It is possible to obtain the mass of a given part :
state.getMass("part1");
and to update the mass of a given part :
state.updateMass("part1", 1000.0);
State vector
The SpacecraftState object could be created from a state vector :
final SpacecraftState state = new SpacecraftState(stateVector, OrbitType.CARTESIAN, PositionAngle.MEAN, date, mu, frame, addStatesInfo, attProviderForces, attProviderEvents);
To build the SpacecraftState, it is necessary to know the size and the index of all additional states in the state vector. This information could be obtained from an old state using the following method :
final Map<String, AdditionalStateInfo> addStatesInfos = state.getAdditionalStatesInfos();
The state vector could be obtained from a SpacecraftState :
final double[] stateVector = new double[]{}; state.mapStateToArray(OrbitType.CARTESIAN, PositionAngle.MEAN, stateVector);
Transform
The SpacecraftState class contains methods to compute the following transformations :
- toTransform()
or toTransformForces()
: Transform from orbit/attitude reference frame to spacecraft frame (attitude used for forces computation which is the default attitude).
- toTransformEvents()
: Transform from orbit/attitude reference frame to spacecraft frame attitude used for events computation (same as toTransform if there is no specific attitude for Events).
- toTransform(Frame)
or toTransformForces(Frame)
: Transform from specified Frame to spacecraft frame (attitude used for forces computation which is the default attitude).
- toTransformEvents(Frame)
: Transform from specified Frame to spacecraft frame attitude used for events computation (same as toTransform(Frame) if there is no attitude specific for Events).
- toTransform(LOFType)
: Transform from orbit/attitude reference frame to local orbital frame (LOFType).
- toTransform(Frame, LOFType)
: Transform from specified Frame to local orbital frame (LOFType).
Getting Started
Using Transform
Here after is presented the computation of a station position in spacecraft frame:
// Station position defined in GCRF final Vector3D station_InGCRF = new Vector3D(Constants.EGM96_EARTH_EQUATORIAL_RADIUS, 0, 0); final Frame gcrf = FramesFactory.getGCRF(); // Compute transform from GCRF to spacecraft frame final Transform transform = state.toTransform(gcrf); // Station position in spacecraft frame final Vector3D station_InSpacecraftFrame = transform.transformVector(station_InGCRF);
Here after is presented the computation of the Sun direction in spacecraft frame.
// Compute transform from orbit/attitude reference frame to local orbital frame TNW final Transform transform = state.toTransform(LOFType.TNW); // Position of Sun in local orbital frame TNW final Vector3D pos = transform.transformPosition(sun.getPVCoordinates().getPosition());
If an Assembly is used, this is not necessary to use these methods because the conversion methods are included in Assembly functionalities (see [SPC_VBU_Home dedicated User Manual]).
Contents
Interfaces
Interface | Summary | Javadoc |
---|---|---|
MassProvider | Interface providing the mass for spacecraft models. | ... |
Classes
Class | Summary | Javadoc |
---|---|---|
SpacecraftState | This class is the representation of a complete state holding orbit, attitude for forces and for events computation and additional states at a given date. | ... |
Attitude | Object representing the attitude of the spacecraft for a specific date and in a specific frame. | ... |