Spacecraft Models Package 2.0
Spacecraft Models for DSim
Public Member Functions | Protected Attributes | List of all members
rigid_body_no_rate_dynamics Class Reference

Rigid body dynamical model applying force and body rae to the spacecraft. More...

#include <rigid_body_no_rate_dynamics.h>

Inherits dsim_model.

Public Member Functions

 rigid_body_no_rate_dynamics (dsim_model_setup *setup)
 Constructor.
 
 ~rigid_body_no_rate_dynamics ()
 Destructor.
 
void initialize_data ()
 Initialize outlets and output variables.
 
void initialization_complete ()
 Finish initialization.
 
void initialize_timestep ()
 Computation done prior to numerical integration.
 
void complete_timestep ()
 Computation done after numerical integration.
 
void rhs (double t, double jd)
 Computation done during numerical integration. More...
 
dsim_value handle_message (const std::string &sender_path, const std::string &message_name, const dsim_value &argument)
 Handle force and torque messages. More...
 

Protected Attributes

dsim_variable spacecraft_name_dsim
 Spacecraft name.
 
dsim_variable spacecraft_type_dsim
 Spacecraft type.
 
dsim_variable position_dsim
 object position
 
dsim_variable velocity_dsim
 object velocity
 
dsim_variable quaternion_dsim
 attitude quaternion ([scalar;x;y;z])
 
dsim_variable bodyRate_dsim
 body rotational rates (rad/s)
 
dsim_variable mass_base
 dry mass (kg)
 
dsim_variable totalMass_dsim
 total mass, including mass of children
 
dsim_variable centerOfMass_dsim
 object center of mass, including children
 
dsim_variable centerOfMass_base
 object center of mass
 
dsim_variable frame_dsim
 frame for initial conditions
 
dsim_variable ang_momentum_dsim
 Angular momentum.
 
dsim_variable acceleration_dsim
 object linear acceleration in body frame
 
dsim_variable angular_acceleration_dsim
 Angular acceleration.
 
ml_matrix force
 The external force on the spacecraft.
 
ml_matrix torque
 The external torque on the spacecraft.
 
double m_to_km
 Convert meters to kilometers.
 
double baseMass
 Base mass to be added to children.
 

Detailed Description

Rigid body dynamical model applying force and body rae to the spacecraft.

Integrates the position, velocity and quaternion. Body rates are an input. Children can use the apply_force messages.

Member Function Documentation

◆ rhs()

void rigid_body_no_rate_dynamics::rhs ( double  t,
double  jd 
)

Computation done during numerical integration.

Quaternion kinematics and orbit derivative.

Uses qi_to_b_dot from the SCControl framework.

References acceleration_dsim, angular_acceleration_dsim, baseMass, bodyRate_dsim, force, m_to_km, position_dsim, quaternion_dsim, torque, totalMass_dsim, and velocity_dsim.

◆ handle_message()

dsim_value rigid_body_no_rate_dynamics::handle_message ( const std::string &  sender_path,
const std::string &  message_name,
const dsim_value &  argument 
)

Handle force and torque messages.

Handle the apply_force and apply_torque messages.

The units should be N and Nm. Force should be in the ECI frame and torque should be in the body frame.

References force.


The documentation for this class was generated from the following files: