Skip to main content

ForceModel

Trait ForceModel 

Source
pub trait ForceModel:
    Send
    + Sync
    + Display {
    // Required methods
    fn estimation_index(&self) -> Option<usize>;
    fn eom(
        &self,
        ctx: &Spacecraft,
        almanac: &Almanac,
    ) -> Result<Vector3<f64>, DynamicsError>;
    fn gradient(
        &self,
        osc_ctx: &Spacecraft,
        almanac: &Almanac,
    ) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>;
}
Expand description

Evaluates mass-dependent forces acting on a spacecraft.

Implementations of ForceModel operate on a full Spacecraft context to account for physical properties such as mass, cross-sectional area, and surface coefficients (e.g., aerodynamic drag, solar radiation pressure). The evaluated force vector $\mathbf{F}$ is scaled by the inverse spacecraft mass ($1/m$) and unit conversions during numerical integration to yield acceleration in $\text{km/s}^2$.

Required Methods§

Source

fn estimation_index(&self) -> Option<usize>

Returns the state-vector index of an estimable parameter associated with this model, if configured.

For example, if a drag coefficient ($C_D$) or radiation pressure coefficient ($C_R$) is actively estimated in the filter state, this returns its corresponding index in the state vector.

Source

fn eom( &self, ctx: &Spacecraft, almanac: &Almanac, ) -> Result<Vector3<f64>, DynamicsError>

Evaluates the force vector $\mathbf{F}$ at the provided state and epoch. Must be in kg*km/s^2 (or kN).

Source

fn gradient( &self, osc_ctx: &Spacecraft, almanac: &Almanac, ) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>

Evaluates the nominal force vector $\mathbf{F}$ and its partial derivatives for State Transition Matrix (STM) propagation.

Returns a tuple containing:

  1. The nominal force vector $\mathbf{F}$.
  2. The $4 \times 3$ Jacobian matrix containing spatial partial derivatives ($\partial \mathbf{F}/\partial \mathbf{r}$) in the first three rows, and parameter partial derivatives ($\partial \mathbf{F}/\partial p$) in the fourth row.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§