pub trait ForceModel:
Send
+ Sync
+ Display {
// Required methods
fn estimation_index(&self) -> Option<usize>;
fn eom(
&self,
ctx: &Spacecraft,
almanac: Arc<Almanac>,
) -> Result<Vector3<f64>, DynamicsError>;
fn dual_eom(
&self,
osc_ctx: &Spacecraft,
almanac: Arc<Almanac>,
) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>;
}
Expand description
The ForceModel
trait handles immutable dynamics which return a force. Those will be divided by the mass of the spacecraft to compute the acceleration (F = ma).
Examples include Solar Radiation Pressure, drag, etc., i.e. forces which do not need to save the current state, only act on it.
Required Methods§
Sourcefn estimation_index(&self) -> Option<usize>
fn estimation_index(&self) -> Option<usize>
If a parameter of this force model is stored in the spacecraft state, then this function should return the index where this parameter is being affected
Sourcefn eom(
&self,
ctx: &Spacecraft,
almanac: Arc<Almanac>,
) -> Result<Vector3<f64>, DynamicsError>
fn eom( &self, ctx: &Spacecraft, almanac: Arc<Almanac>, ) -> Result<Vector3<f64>, DynamicsError>
Defines the equations of motion for this force model from the provided osculating state.
Sourcefn dual_eom(
&self,
osc_ctx: &Spacecraft,
almanac: Arc<Almanac>,
) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>
fn dual_eom( &self, osc_ctx: &Spacecraft, almanac: Arc<Almanac>, ) -> Result<(Vector3<f64>, Matrix4x3<f64>), DynamicsError>
Force models must implement their partials, although those will only be called if the propagation requires the
computation of the STM. The osc_ctx
is the osculating context, i.e. it changes for each sub-step of the integrator.
The last row corresponds to the partials of the parameter of this force model wrt the position, i.e. this only applies to conservative forces.