コンテンツにスキップ

SpacecraftDynamics

このコンテンツはまだ日本語訳がありません。

Defined in: dynamics.rs:32

pub struct SpacecraftDynamics\<G: [GravityField](../../traits/gravityfield/), F: [Eci](../../../../arika/api/traits/eci/) = [arika::frame::SimpleEci](../../../../arika/api/type-aliases/simpleeci/)\>

Coupled orbit-attitude dynamics for a rigid spacecraft.

Composes a gravitational field, inertia tensor, external load models, and state effectors (e.g. reaction wheels) into a DynamicalSystem for the augmented spacecraft state.

Parameterized by the inertial frame F (default SimpleEci), matching SpacecraftState<F>.

The state type is AugmentedState<SpacecraftState<F>> — the 14D plant state (orbit 6D + attitude 7D + mass 1D) plus concatenated auxiliary variables from registered StateEffectors (e.g. RW angular momentum). When no effectors are registered, aux is empty and the dynamics are equivalent to the pre-effector version.

Equations of motion:

  • Translation: dr/dt = v, dv/dt = a_gravity + Σ a_loads
  • Rotation: dq/dt = ½ q ⊗ (0,ω), dω/dt = I⁻¹(τ − ω × Iω)
  • Auxiliary: daux/dt from registered effectors

fn new(mu: f64, gravity: G, inertia: Matrix3<f64>) -> Self

Create with gravitational parameter, gravity model, and inertia tensor.

Panics if inertia is singular (not invertible).


fn with_model(self, model: impl [Model<SpacecraftState<F>, F>](../../traits/model/) + ‘static) -> Self

Add an external model (builder pattern).


fn with_effector(self, effector: impl [StateEffector<SpacecraftState<F>>](../../traits/stateeffector/) + ‘static) -> Self

Add a state effector (builder pattern).

Effectors have auxiliary state (e.g. RW angular momentum) that is integrated alongside the plant state.


fn with_epoch(self, epoch: Epoch) -> Self

Set the initial epoch corresponding to integration time t = 0.


fn with_body_radius(self, radius: f64) -> Self

Set the central body radius for event detection.


fn initial_augmented_state(&self, plant: SpacecraftState<F>) -> [AugmentedState<SpacecraftState<F>>](../augmentedstate/)

Create an initial augmented state with the given plant state.

Auxiliary state is initialized to zeros; bounds are collected from all registered effectors.


fn effector<T: [StateEffector<SpacecraftState<F>>](../../traits/stateeffector/) + ‘static>(&self, index: usize) -> Option<&T>

Downcast a state effector by index (immutable).


fn effector_mut<T: [StateEffector<SpacecraftState<F>>](../../traits/stateeffector/) + ‘static>(&mut self, index: usize) -> Option<&mut T>

Downcast a state effector by index (mutable).


fn effector_by_name<T: [StateEffector<SpacecraftState<F>>](../../traits/stateeffector/) + ‘static>(&self, name: &str) -> Option<&T>

Find and downcast a state effector by name (immutable).


fn effector_by_name_mut<T: [StateEffector<SpacecraftState<F>>](../../traits/stateeffector/) + ‘static>(&mut self, name: &str) -> Option<&mut T>

Find and downcast a state effector by name (mutable).


fn registry(&self) -> &AuxRegistry

Get the auxiliary state registry.


fn inertia(&self) -> &Matrix3<f64>

Get the inertia tensor.


fn body_radius(&self) -> Option<f64>

Get the central body radius (if set).


fn replace_model(&mut self, name: &str, new_model: [Box<dyn [Model<SpacecraftState<F>, F>](../../traits/model/)>](https://doc.rust-lang.org/std/boxed/struct.Box.html)) -> [Option<[Box<dyn [Model<SpacecraftState<F>, F>](../../traits/model/)>](https://doc.rust-lang.org/std/boxed/struct.Box.html)>](https://doc.rust-lang.org/std/option/enum.Option.html)

Replace a model by name, returning the old one (if found).

This is used to swap in a model with updated commanded state between integration segments (e.g., MtqAssembly with new commanded_moments).


fn model_names(&self) -> Vec<&str>

Names of active models.


fn model_breakdown(&self, t: f64, state: &SpacecraftState<F>) -> [Vec<(&str, ExternalLoads<F>)>](https://doc.rust-lang.org/std/vec/struct.Vec.html)

Per-model load breakdown at the given state.


fn acceleration_breakdown(&self, t: f64, state: &SpacecraftState<F>) -> Vec<(&str, f64)>

Acceleration breakdown for telemetry.