# Multi-body dynamics

The propagation framework in Tudat is implemented such that any number of bodies may be propagated numerically. Taking the translational dynamics as an example, propagating multiple bodies is achieved simply by extending the list of propagated bodies and central bodies:

Required

Show/Hide# Define bodies that are propagated. bodies_to_propagate = ["Earth","Mars","Sun","Moon"] # Define central bodies. central_bodies = ["SSB","SSB","SSB","SSB"] # Define settings for propagator termination_condition = propagation_setup.propagator.time_termination( simulation_end_epoch ) propagator_settings = propagation_setup.propagator.translational( central_bodies, acceleration_models, bodies_to_propagate, initial_state, simulation_start_epoch, integrator_settings, termination_condition )// required include statements #include <tudat/simulation/simulation.h> // required using-declarations using tudat::simulation_setup; using tudat;

Where the `acceleration_models`

should contain a set of acceleration models acting upon each propagated body (if one or more of the bodies is omitted from the `acceleration_models`

, no accelerations are assumed to act on this body, without warning or error).

When propagating multiple bodies, the initial states of the bodies need to be provided in a single vector through the `initial_state`

input (in the example above) to the `translational()`

function. This initial state vector should, in order, contain the initial states of the propagated bodies, w.r.t. their respecive central bodies. For the example above, entry 0-5 of the `initial_state`

should be the initial state of Earth w.r.t. SSB, entry 6-11 Mars w.r.t. SSB, entry 12-17 Sun w.r.t. SSB, and 18-23 Moon w.r.t. SSB.

The use of a ‘hierarchical’ system is also supported by Tudat. For instance, one can propagate the Earth and Mars w.r.t. the Sun, the Sun w.r.t. the barycenter, the Moon w.r.t the Earth:

Required

Show/Hide# Define bodies that are propagated. bodies_to_propagate = ["Earth","Mars","Sun","Moon"] # Define central bodies. central_bodies = ["Sun","Sun","SSB","Earth"] # Define settings for propagator termination_condition = propagation_setup.propagator.time_termination( simulation_end_epoch ) propagator_settings = propagation_setup.propagator.translational( central_bodies, acceleration_models, bodies_to_propagate, initial_state, simulation_start_epoch, integrator_settings, termination_condition )// required include statements #include <tudat/simulation/simulation.h> // required using-declarations using tudat::simulation_setup; using tudat;

In either case, any and all physical interactions are automatically formulated as required for the specific dynamical system under consideration. Specifically, the use of direct and third-body gravitational accelerations, and the definition of the correct effective gravitational parameter, are automatically handled when creating the acceleration models (see Available Acceleration Models)

When propagating multiple bodies simultaneously, acceleration models for each need to be defined (for the case of translational dynamics). See Acceleration Model Setup on details how to define this. The initial states that are to be provided to the propagator settings should be in the form of a single vector, with the states of the propagated bodies concatenated. In each of the above examples, for instance, the initial states should be provided as a column vector with 24 entries, with element 0-5 representing the state of the Earth, element 6-11 the state of Mars, 7-17 the state of the Sun, and element 18-23 the state of the Moon. Note that in the second example, where each propagated body has a different central body, the initial state of each body must be defined w.r.t. its own central body. To retrieve the definition of the full state vector, see Console Output.