Skip to content

SpacecraftState

Defined in: state.rs:16

pub struct SpacecraftState\<F: [Eci](../../../../arika/api/traits/eci/) = [arika::frame::SimpleEci](../../../../arika/api/type-aliases/simpleeci/)\> {
pub orbit: OrbitalState<F>,
pub attitude: AttitudeState,
pub mass: f64,
}

Combined spacecraft state: orbital (6D) + attitude (7D) + mass (1D).

Parameterized by the inertial frame F (default SimpleEci). Used as the ODE state vector for coupled orbit-attitude propagation. Mass is included for thrust modeling (mass depletion).

orbit: OrbitalState<F>


attitude: AttitudeState


mass: f64


fn from_derivative(velocity: Vector3<f64>, acceleration: Vector3<f64>, q_dot: Vector4<f64>, angular_acceleration: Vector3<f64>, mass_rate: f64) -> Self

Create a derivative state for the ODE formulation.

In the ODE y = (orbit, attitude, mass), dy/dt = (velocity+accel, q_dot+alpha, mass_rate):

  • orbit part: velocity in position slot, acceleration in velocity slot
  • attitude part: q_dot in quaternion slot, angular_acceleration in angular_velocity slot
  • mass_rate in mass slot (Phase A: always 0)

fn from_orbit(orbit: OrbitalState, mass: f64) -> Self

Create from orbital state only (identity attitude, zero angular velocity).