Torque Model Setup
Torque models can be created through the factory function
create_torque_models()
.
How to select torques
In Tudat, a torque acting on a body is defined by:
the body upon which the torque is acting;
the body exerting the torque;
the type and settings of the torque.
These settings are defined via factory functions for each torque in the simulation.
See also
A comprehensive list of all available torque models in Tudat and the manner in which to define them is given in Available Torque Models.
These settings are organized in nested key-value containers (std::map<>
in C++, dict
in Python). In general:
key
: body undergoing torquevalue
: dictionary with:key
: body exerting the torquevalue
:TorqueSettings
object.
This container will be supplied to the
create_torque_models()
function to create the
torque models. This is illustrated in the example below.
Example
In this example, the following torques are exerted on the vehicle:
by the Earth:
spherical-harmonic gravitational torque (up to order 4 and degree 4)
aerodynamic torque
by the Sun:
second-degree gravitational torque
by the Moon:
second-degree gravitational torque
The variable torques_settings_vehicle
denotes the list of bodies exerting torques and the types of
torques, while the variable torque_settings
associates this list with the body undergoing the
torque.
The function create_torque_models()
creates the list of
models that compute the torques during the propagation.
Required Show/Hide
from tudatpy.kernel.numerical_simulation import propagation_setup# Define bodies that are propagated bodies_to_propagate = ["Vehicle"] # Define torques per each exerting body torque_settings_vehicle = dict( Sun= [ propagation_setup.torque.second_degree_gravitational() ], Moon= [ propagation_setup.torque.second_degree_gravitational() ], Earth= [ propagation_setup.torque.spherical_harmonic_gravitational(4, 4), propagation_setup.torque.aerodynamic() ] ) # Create global torque settings dictionary torque_settings = {"Vehicle": torque_settings_vehicle} # Create torque models torque_models = propagation_setup.create_torque_models( bodies, torque_settings, bodies_to_propagate )
- language
cpp
When propagating multiple bodies (see Multi-body dynamics), the same list of settings may be re-used for
multiple bodies. Below, an example is given for the definition of torque_settings
for multiple bodies
(Vehicle1
and Vehicle2
) which are undergoing identical torques:
Required Show/Hide
from tudatpy.kernel.numerical_simulation import propagation_setup# Define torques per each exerting body torque_settings_vehicle = dict( Sun= [ propagation_setup.torque.second_degree_gravitational() ], Moon= [ propagation_setup.torque.second_degree_gravitational() ], Earth= [ propagation_setup.torque.spherical_harmonic_gravitational(4, 4), propagation_setup.torque.aerodynamic() ] ) # Create global torque settings dictionary. torque_settings = { "Vehicle1": torque_settings_vehicle, "Vehicle2": torque_settings_vehicle }
- language
cpp
Or separate torque settings may be defined for separate bodies, and then combined into a torque_settings
variable.
Below, an example for such a case is given when propagating the Earth and Moon:
Required Show/Hide
from tudatpy.kernel.numerical_simulation import propagation_setup# Define selected torques per each exerting body torque_settings_moon = dict( Sun= [ propagation_setup.torque.second_degree_gravitational() ], Earth= [ propagation_setup.torque.spherical_harmonic_gravitational(4, 4) ] ) # Define selected torques per each exerting body torque_settings_earth = dict( Sun= [ propagation_setup.torque.second_degree_gravitational() ], Moon= [ propagation_setup.torque.second_degree_gravitational() ] ) # Create global torque settings dictionary and assign the torque selections to respective bodies that act upon torque_settings = { "Moon": torque_settings_moon, "Earth": torque_settings_earth }
- language
cpp