pub trait ForceModel: Clone {
// Required methods
fn accel_rv(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [f64; 3];
fn cr(&self) -> f64;
fn set_cr(&mut self, cr: f64);
fn set_empirical(&mut self, empirical: Option<EmpiricalAccel>);
// Provided method
fn dynamics_matrix(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [[f64; 6]; 6] { ... }
}Expand description
The dynamics interface the batch estimator (fit) and the STM propagators are generic over:
anything that returns its inertial acceleration and 6×6 dynamics matrix at a state, exposes its
SRP coefficient, and accepts the estimator’s C_R/empirical updates. PreciseForceModel
(Earth-centric) and crate::lunar_od::LunarForceModel (Moon-centric) both implement it, so
the one precise Gauss–Newton estimator fits orbits about either body.
Required Methods§
Sourcefn accel_rv(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [f64; 3]
fn accel_rv(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [f64; 3]
The full inertial acceleration (m/s²) at integration time t (s past the epoch), position
r and velocity v.
Sourcefn set_empirical(&mut self, empirical: Option<EmpiricalAccel>)
fn set_empirical(&mut self, empirical: Option<EmpiricalAccel>)
Attach (or clear) the empirical-acceleration tier.
Provided Methods§
Sourcefn dynamics_matrix(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [[f64; 6]; 6]
fn dynamics_matrix(&self, t: f64, r: [f64; 3], v: [f64; 3]) -> [[f64; 6]; 6]
The 6×6 dynamics matrix A = ∂f/∂x (x = [r; v], f = [v; a]) at time t, state
(r, v). The upper-right block is the identity (ṙ = v); the lower blocks ∂a/∂r,
∂a/∂v are central differences of accel_rv. The default re-evaluates
the acceleration twelve times; an implementor with a cacheable per-epoch context (frame,
ephemeris) may override to share it across the perturbed evaluations.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".