#include <Environment.h>
The Environment class is used to contain all the different aspects of the external environment of the spacecraft. This currently includes disturbance forces (gravity, drag, solar radiation pressure), disturbance torques (gravity gradient, magnetic dipole, fuel slosh), and central body (for constants).
To use the Environment class, the user should create (or include) and assign the desired force and torque disturbance functions (EnvFunction), and CentralBody. The integrator or propagator would then use the GetTorque() and GetForce() functions to modify the dynamics.
Environment* pEarthEnv = new Environment; EarthCentralBody *pCBEarth = new EarthCentralBody; pEarthEnv->SetCentralBody(pCBEarth); // Add Gravity force function EnvFunction TwoBodyGravity(&GravityForceFunction); double Mass = 100; \\kg TwoBodyGravity.AddParameter(reinterpret_cast<void*>(&Mass), 1); pEarthEnv->AddForceFunction(TwoBodyGravity); // Add Drag Force Function EnvFunction DragForce(&DragForceFunction); double BallisticCoefficient = 200; DragForce.AddParameter(reinterpret_cast<void*>(&BallisticCoefficient), 1); pEarthEnv->AddForceFunction(DragForce); // Add Magnetic Dipole EnvFunction MagDipole(&MagneticDipoleFunction); MagDiple.AddParameter(reinterpret_cast<void*>(&Spacecraft.GetDipole(), 1); pEarthEnv->AddTorqueFunction(MagDipole);
Definition at line 179 of file Environment.h.
Public Member Functions | |
Environment () | |
Create an instance of Environment. | |
virtual | ~Environment () |
Default Deconstructor. | |
Vector | GetTorques (const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState) |
Evaluate the current disturbance torques given a state. | |
Vector | GetForces (const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState) |
Evaluate the current disturbance forces given a state. | |
void | AddForceFunction (const EnvFunction &_forceFunc) |
Add a force disturbance function to the list of force functions. | |
void | AddTorqueFunction (const EnvFunction &_torqueFunc) |
Add a torque disturbance function to the list of force functions. | |
const Functor & | GetForceFunction () const |
Get the reference to the Environment::GetForces() function. | |
const Functor & | GetTorqueFunction () const |
Get the reference to the Environment::GetTorques() function. | |
void | SetCentralBody (CentralBody *_pCB) |
Set the pointer to the central body to use for modeling the environment. | |
const CentralBody * | GetCentralBody () const |
Get the pointer to the environment's central body. | |
Private Attributes | |
vector< EnvFunction > | m_ForceFunctions |
internal vector of the pointers to the force disturbance functions | |
vector< EnvFunction > | m_TorqueFunctions |
internal vector of the pointers to the torque disturbance functions | |
vector< EnvFunction >::iterator | m_funcIterator |
internal iterator for stepping through the disturbance function vectors | |
CentralBody * | m_pCB |
internal pointer to the environment central body | |
Vector | m_CalculatedForces |
internal Vector of the most recent calculated disturbance forces | |
Vector | m_CalculatedTorques |
internal Vector of the most recent calculated disturbance torques | |
ObjectFunctor< Environment > | m_ForcesFunctor |
internal pointer to the Environment::GetForces() function | |
ObjectFunctor< Environment > | m_TorquesFunctor |
internal pointer to the Environment::GetTorques() function |
|
Create an instance of Environment.
Definition at line 18 of file Environment.cpp. |
|
Default Deconstructor.
Definition at line 27 of file Environment.cpp. |
|
Evaluate the current disturbance torques given a state.
Definition at line 39 of file Environment.cpp. |
|
Evaluate the current disturbance forces given a state.
Definition at line 57 of file Environment.cpp. |
|
Add a force disturbance function to the list of force functions.
Definition at line 89 of file Environment.cpp. |
|
Add a torque disturbance function to the list of force functions.
Definition at line 105 of file Environment.cpp. |
|
Get the reference to the Environment::GetForces() function.
Definition at line 122 of file Environment.cpp. |
|
Get the reference to the Environment::GetTorques() function.
Definition at line 130 of file Environment.cpp. |
|
Set the pointer to the central body to use for modeling the environment.
Definition at line 72 of file Environment.cpp. |
|
Get the pointer to the environment's central body.
Definition at line 81 of file Environment.cpp. |
|
internal vector of the pointers to the force disturbance functions
Definition at line 204 of file Environment.h. |
|
internal vector of the pointers to the torque disturbance functions
Definition at line 206 of file Environment.h. |
|
internal iterator for stepping through the disturbance function vectors
Definition at line 208 of file Environment.h. |
|
internal pointer to the environment central body
Definition at line 210 of file Environment.h. |
|
internal Vector of the most recent calculated disturbance forces
Definition at line 213 of file Environment.h. |
|
internal Vector of the most recent calculated disturbance torques
Definition at line 215 of file Environment.h. |
|
internal pointer to the Environment::GetForces() function
Definition at line 217 of file Environment.h. |
|
internal pointer to the Environment::GetTorques() function
Definition at line 219 of file Environment.h. |