stateEffector#
Base class for an effector that attaches to a dynamicObject and holds states for the integrator. Examples are reaction wheels, flexible solar panels and fuel slosh.
-
class StateEffector#
Base class for an effector that attaches to a dynamicObject and holds states for the integrator.
Examples are reaction wheels, flexible solar panels and fuel slosh.
Subclassed by DualHingedRigidBodyStateEffector, FuelTank, HingedRigidBodyStateEffector, HubEffector, LinearSpringMassDamper, NHingedRigidBodyStateEffector, PrescribedMotionStateEffector, ReactionWheelStateEffector, SphericalPendulum, SpinningBodyOneDOFStateEffector, SpinningBodyTwoDOFStateEffector, StateSpaceStateEffector, ThrusterStateEffector, VSCMGStateEffector, linearTranslationOneDOFStateEffector
Public Functions
-
inline virtual void updateEffectorMassProps(double integTime)#
Gives the mass and the mass rate contributions of the effector to the dynamicObject.
The dynamicObject uses these contributions to get the total mass, the total inertia, and the time derivatives of both.
- Parameters:
integTime – [s] Integration time
-
inline virtual void updateContributions(double integTime, BackSubMatrices &backSubContr, Eigen::Vector3d sigma_BN, Eigen::Vector3d omega_BN_B, Eigen::Vector3d g_N)#
Gives the back-substitution contributions of the effector.
The back-substitution method first calculates rDDot_BN_N and omegaDot_BN_B for the spacecraft from these contributions. computeDerivatives() then uses rDDot_BN_N and omegaDot_BN_B to calculate the state derivatives of the effector.
- Parameters:
integTime – [s] Integration time
backSubContr – [inout] Back-substitution contributions that the effector adds to
sigma_BN – [-] MRP attitude of body frame B relative to inertial frame N
omega_BN_B – [rad/s] Angular velocity of frame B relative to frame N, in B frame components
g_N – [m/s^2] Gravitational acceleration, in N frame components
-
inline virtual void updateEnergyMomContributions(double integTime, Eigen::Vector3d &rotAngMomPntCContr_B, double &rotEnergyContr, Eigen::Vector3d omega_BN_B)#
Adds the energy and the momentum contributions of the effector.
- Parameters:
integTime – [s] Integration time
rotAngMomPntCContr_B – [inout] [kg m^2/s] Angular momentum about point C, in B frame components
rotEnergyContr – [inout] [J] Rotational energy contribution
omega_BN_B – [rad/s] Angular velocity of frame B relative to frame N, in B frame components
-
inline virtual void modifyStates(double integTime)#
Changes the states of the effector after integration.
- Parameters:
integTime – [s] Integration time
-
inline virtual void calcForceTorqueOnBody(double integTime, Eigen::Vector3d omega_BN_B)#
Calculates the force and the torque that the effector applies to the body.
The effector writes the results to forceOnBody_B, torqueOnBodyPntB_B and torqueOnBodyPntC_B.
- Parameters:
integTime – [s] Integration time
omega_BN_B – [rad/s] Angular velocity of frame B relative to frame N, in B frame components
-
inline virtual void writeOutputStateMessages(uint64_t integTimeNanos)#
Writes the output messages of the effector after integration.
- Parameters:
integTimeNanos – [ns] Integration time
-
virtual void registerStates(DynParamManager &states) = 0#
Adds the states of the effector to the state manager.
- Parameters:
states – [inout] State manager of the dynamicObject
-
virtual void linkInStates(DynParamManager &states) = 0#
Gets the states that the effector needs from the state manager.
- Parameters:
states – [in] State manager of the dynamicObject
-
virtual void computeDerivatives(double integTime, Eigen::Vector3d rDDot_BN_N, Eigen::Vector3d omegaDot_BN_B, Eigen::Vector3d sigma_BN) = 0#
Calculates the state derivatives of the effector.
- Parameters:
integTime – [s] Integration time
rDDot_BN_N – [m/s^2] Acceleration of point B relative to frame N, in N frame components
omegaDot_BN_B – [rad/s^2] Angular acceleration of frame B relative to frame N, in B frame components
sigma_BN – [-] MRP attitude of body frame B relative to inertial frame N
-
inline virtual void prependSpacecraftNameToStates()#
Adds the name of the parent spacecraft in front of the names of the effector states.
Each spacecraft needs its own state names when more than one spacecraft is in the simulation.
Public Members
-
std::string nameOfSpacecraftAttachedTo#
[-] Name prefix of the parent spacecraft. The effector adds it in front of its own state and property names.
-
std::string parentSpacecraftName#
[-] Name of the spacecraft that the effector attaches to
-
EffectorMassProps effProps#
Mass properties that this effector gives to the spacecraft.
-
Eigen::VectorXd stateDerivContribution#
Contribution of this effector to another effector, which prevents double-counting
-
Eigen::Vector3d forceOnBody_B = Eigen::Vector3d::Zero()#
[N] Force that the effector applies to the spacecraft
-
Eigen::Vector3d torqueOnBodyPntB_B = Eigen::Vector3d::Zero()#
[N-m] Torque that the effector applies to the body about point B
-
Eigen::Vector3d torqueOnBodyPntC_B = Eigen::Vector3d::Zero()#
[N-m] Torque that the effector applies to the body about point C
-
Eigen::Vector3d r_BP_P = Eigen::Vector3d::Zero()#
[m] Position of body frame origin B relative to primary body frame origin P, in P frame components
-
Eigen::Matrix3d dcm_BP = Eigen::Matrix3d::Identity()#
[-] DCM of body frame B relative to primary body frame P
-
inline virtual void updateEffectorMassProps(double integTime)#