- The
RelativeOrbit
class calculates the position of a satellite with respect to a reference satellite. This class calculates the position both in the LVLH frame and inertial frame. Users can choose the update method between:- relative dynamics propagation using RK4
- update using STM(State Transition Matrix)
src/dynamics/orbit/orbit.hpp, cpp
- Definition of
Orbit
base class
- Definition of
src/dynamics/orbit/initialize_orbit.hpp, .cpp
- Make an instance of orbit class.
src/dynamics/orbit/relative_orbit.hpp, .cpp
- Definition of the class
- Libraries
src/library/orbit/relative_orbit_models.hpp, .cpp
- Library to store equations for various relative dynamics
-
Relative orbit propagation is available only when multiple satellites are simulated.
- The sample case in S2E_CORE simulates a single satellite. For an example of simulating multiple satellites, please refer to the tutorial.
-
Confirm the instance of
RelativeInformation
is the member of each satellite. -
Set up the configuration of the
[ORBIT]
section in thesample_spacecraft.ini
.- Set
propagate_mode = RELATIVE
to use the relative orbit propagation - Choose
relative_orbit_update_method
.-
relative_orbit_update_method = 0
means the orbit is updated with the propagation of the relative dynamics equation($\dot{\boldsymbol{x}}=\boldsymbol{Ax}+\boldsymbol{Bu}$ , i.e., Hill equation). -
relative_orbit_update_method = 1
means the orbit is updated with the STM($\boldsymbol{x}(t)=\boldsymbol{\Phi}(t,t_0)\boldsymbol{x}(t_0)$ , i.e., Clohessy-Wiltshire solution).
-
- When you choose
relative_orbit_update_method = 0
, setrelative_dynamics_model_type
. - When you choose
relative_orbit_update_method = 1
, setstm_model_type
. - Set the initial relative position of the satellite in the LVLH frame. LVLH frame definition is:
-
$\boldsymbol{x}$ is a direction vector from the reference satellite ("chief" in the figure) radially outward. - The direction of
$\boldsymbol{z}$ corresponds to the angular momentum vector of the reference satellite orbit. - The direction of
$\boldsymbol{y}$ is determined by$\boldsymbol{z}\times\boldsymbol{x}$ .
-
- Set the ID and ini file name of the reference satellite.
- NOTE: Confirm the
propagate_mode
of the reference satellite is not 2. The orbit of the reference satellite must be propagated by the methods other than the relative orbit propagation.
- NOTE: Confirm the
- Set
- New Relative Dynamics equation
- Add the name of the dynamics model to the
RelativeOrbitModel
enum inrelative_orbit_models.hpp
. - Add the function to calculate the system matrix like
CalcHillSystemMatrix
inrelative_orbit_models.hpp
. - Edit the
CalculateSystemMatrix
function inrelative_orbit.hpp
.
- New STM
- Add the name of the dynamics model to
StmModel
enum inrelative_orbit_models.hpp
. - Add the function to calculate the system matrix as
CalcHcwStm
inrelative_orbit_models.hpp
. - Edit the
CalculateStm
function inrelative_orbit.hpp
.
- The
InitializeState
function initializes the orbit of the satellite.
- input
-
relative_position_lvlh_m
,relative_velocity_lvlh_m_s
- The initial state of the satellite
-
gravity_constant_m3_s2
- The gravity constant of the reference celestial body
$\mu$
- The gravity constant of the reference celestial body
-
initial_time_s
- Initial simulation time (default value is 0)
-
- output
- none
- The
CalculateSystemMatrix
function is used only inside theRelativeOrbit
class. This function calls the system matrix calculation function according torelative_dynamics_model_type
.
- input
-
relative_dynamics_model_type
- The type of relative dynamics model
-
reference_sat_orbit
- The orbit of the reference satellite
-
gravity_constant_m3_s2
- The gravity constant
$\mu$
- The gravity constant
-
- output
- none
- The
CalculateStm
function is used only inside theRelativeOrbit
class. This function calls the system matrix calculation function according tostm_model_type
.
- input
-
stm_model_type
- The type of relative dynamics model
-
reference_sat_orbit
- The orbit of the reference satellite
-
gravity_constant_m3_s2
- The gravity constant
$\mu$
- The gravity constant
-
elapsed_sec
- Elapsed simulation time
-
- output
- none
- The
CalculateHillSystemMatrix
function calculates the system matrix of the Hill equation. - This function is declared in
relative_orbit_models.hpp
and is used by the
- input
-
orbit_radius
- Radius of the reference satellite orbit
$R$
- Radius of the reference satellite orbit
-
gravity_constant_m3_s2
- The gravity constant
$\mu$
- The gravity constant
-
- output
-
system_matrix
- system matrix
-
- The mean motion of the reference orbit (
$n$ ) is calculated as follows:
- Then, the system matrix (
$\boldsymbol{A}$ ) is calculated as follows:
- The
CalculateHcwStm
function calculates the Hill-Clohessy-Wiltshire STM. - This function is declared in
relative_orbit_models.hpp
and is used by the
- input
-
orbit_radius
- Radius of the reference satellite orbit
$R$
- Radius of the reference satellite orbit
-
gravity_constant_m3_s2
- The gravity constant
$\mu$
- The gravity constant
-
elapsed_sec
- Elapsed simulation time
-
- output
-
system_matrix
- system matrix
-
- The mean motion of the reference orbit (
$n$ ) is calculated as follows:
- Then, the system matrix (
$\boldsymbol{A}$ ) is calculated as follows:
- Make sure the relative orbit is correctly propagated using a simple orbit
- input files
- Initialization files for the two satellites were prepared.
satellite0.ini
satellite1.ini
- Initialization files for the two satellites were prepared.
- initial values
-
The orbit of the reference satellite (satellite0) is GEO. The initial position of the satellite (satellite1) is
$(0\mathrm{m}, 100\mathrm{m}, 0\mathrm{m})^\mathrm{T}$ in LVLH frame. The orbit was propagated for 86400 sec (the period of GEO). -
satellite0.ini
propagate_mode = RK4 //Information used for orbital propagation by the Runge-Kutta method/////////// //initial satellite position[m] //*The coordinate system is defined in PlanetSelect.ini initial_position_i_m(0) = 4.2164140100E+07 //radius of GEO initial_position_i_m(1) = 0 initial_position_i_m(2) = 0 //initial satellite velocity[m/s] //*The coordinate system is defined in PlanetSelect.ini initial_velocity_i_m_s(0) = 0 initial_velocity_i_m_s(1) = 3.074661E+03 //Speed of a spacecraft in GEO initial_velocity_i_m_s(2) = 0 ///////////////////////////////////////////////////////////////////////////////
-
satellite1.ini
propagate_mode = RELATIVE //Information used for relative orbit propagation////////////////////////////// //Relative Orbit Update Method (0 means RK4, 1 means STM) relative_orbit_update_method = 0 // RK4 Relative Dynamics model type (only valid for RK4 update) // 0: Hill relative_dynamics_model_type = 0 // STM Relative Dynamics model type (only valid for STM update) // 0: HCW stm_model_type = 0 // Initial satellite position relative to the reference satellite in LVLH frame[m] // * The coordinate system is defined at [PLANET_SELECTION] in SampleSimBase.ini initial_relative_position_lvlh_m(0) = 0.0 initial_relative_position_lvlh_m(1) = 100.0 initial_relative_position_lvlh_m(2) = 0.0 // initial satellite velocity relative to the reference satellite in LVLH frame[m/s] initial_relative_velocity_lvlh_m_s(0) = 0.0 initial_relative_velocity_lvlh_m_s(1) = 0.0 initial_relative_velocity_lvlh_m_s(2) = 0.0 // information of reference satellite reference_satellite_id = 0 ///////////////////////////////////////////////////////////////////////////////
-
- The position of satellite1 seen from satellite0 in the inertia frame was calculated.
- They correctly move periodically.
- In this example of verification, the RK4 method is used to propagate relative orbits, but the results were the same when using STM.
- Kapila, V., Sparks, A. G., Buffington, J. M., & Yan, Q. (2000). Spacecraft formation flying: Dynamics and control. Journal of Guidance, Control, and Dynamics, 23(3), 561-564.