[−][src]Struct nyx_space::propagators::Propagator
Includes the options, the integrator details of the previous step, and the set of coefficients used for the monomorphic instance. WARNING: must be stored in a mutuable variable.
Fields
dynamics: &'a mut M
tx_chan: Option<&'a Sender<(f64, VectorN<f64, M::StateSize>)>>
Methods
impl<'a, M: Dynamics, E: ErrorCtrl> Propagator<'a, M, E> where
DefaultAllocator: Allocator<f64, M::StateSize>,
[src]
DefaultAllocator: Allocator<f64, M::StateSize>,
The Propagator
trait defines the functions of a propagator.
pub fn new<T: RK>(
dynamics: &'a mut M,
opts: &PropOpts<E>
) -> Propagator<'a, M, E>
[src]
dynamics: &'a mut M,
opts: &PropOpts<E>
) -> Propagator<'a, M, E>
Each propagator must be initialized with new
which stores propagator information.
pub fn set_step(&mut self, step_size: f64, fixed: bool)
[src]
pub fn time(&self) -> f64
[src]
Returns the time of the propagation
WARNING: Do not use the dynamics to get the time, it will be the initial value!
pub fn state(&self) -> VectorN<f64, M::StateSize>
[src]
Returns the state of the propagation
WARNING: Do not use the dynamics to get the state, it will be the initial value!
pub fn until_time_elapsed(
&mut self,
elapsed_time: f64
) -> (f64, VectorN<f64, M::StateSize>)
[src]
&mut self,
elapsed_time: f64
) -> (f64, VectorN<f64, M::StateSize>)
This method propagates the provided Dynamics dyn
for elapsed_time
seconds. WARNING: This function has many caveats (please read detailed docs).
IMPORTANT CAVEAT of until_time_elapsed
- It is assumed that
self.dynamics.time()
returns a time in the same units as elapsed_time.
pub fn derive(
&mut self,
t: f64,
state: &VectorN<f64, M::StateSize>
) -> (f64, VectorN<f64, M::StateSize>)
[src]
&mut self,
t: f64,
state: &VectorN<f64, M::StateSize>
) -> (f64, VectorN<f64, M::StateSize>)
This method integrates whichever function is provided as d_xdt
.
The derive
method is monomorphic to increase speed. This function takes a time t
and a current state state
then derives the dynamics at that time (i.e. propagates for one time step). The d_xdt
parameter is the derivative
function which take a time t of type f64 and a reference to a state of type VectorN<f64, N>, and returns the
result as VectorN<f64, N> of the derivative. The reference should preferrably only be borrowed.
This function returns the next time (i.e. the previous time incremented by the timestep used) and
the new state as y_{n+1} = y_n + \frac{dy_n}{dt}. To get the integration details, check Self.latest_details
.
Note: using VectorN<f64, N> instead of DVector implies that the function must always return a vector of the same
size. This static allocation allows for high execution speeds.
pub fn latest_details(&self) -> &IntegrationDetails
[src]
Borrow the details of the latest integration step.
Trait Implementations
impl<'a, M: Debug, E: Debug> Debug for Propagator<'a, M, E> where
M: Dynamics,
E: ErrorCtrl,
DefaultAllocator: Allocator<f64, M::StateSize>,
M::StateSize: Debug,
[src]
M: Dynamics,
E: ErrorCtrl,
DefaultAllocator: Allocator<f64, M::StateSize>,
M::StateSize: Debug,
Auto Trait Implementations
impl<'a, M, E> !Send for Propagator<'a, M, E>
impl<'a, M, E> Unpin for Propagator<'a, M, E> where
E: Unpin,
E: Unpin,
impl<'a, M, E> !Sync for Propagator<'a, M, E>
impl<'a, M, E> !UnwindSafe for Propagator<'a, M, E>
impl<'a, M, E> !RefUnwindSafe for Propagator<'a, M, E>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,