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§
Sourcefn estimation_index(&self) -> Option<usize>
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.
Sourcefn eom(
&self,
ctx: &Spacecraft,
almanac: &Almanac,
) -> Result<Vector3<f64>, DynamicsError>
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).
Sourcefn gradient(
&self,
osc_ctx: &Spacecraft,
almanac: &Almanac,
) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>
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:
- The nominal force vector $\mathbf{F}$.
- 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".