Class Integrator¶
Defined in File integrator.h
Inheritance Relationships¶
Derived Types¶
public lupnt::IRKF(Class IRKF)public lupnt::PD45(Class PD45)public lupnt::RK4(Class RK4)public lupnt::RK8(Class RK8)
Class Documentation¶
-
class Integrator¶
Abstract base class for fixed- and adaptive-step ODE integrators used to propagate
State/VecXdynamics in time.Concrete subclasses (
RK4,RK8,RKF45,PD45) implementStep; numerical dynamics models (e.g.NumericalOrbitDynamics,ClockDynamics,JointOrbitClockDynamics) own anIntegratorinstance (selected viaSetIntegrator/IntegratorType) and callPropagate/PropagateExonce perDynamics::Propagatecall to advance the state fromt0totf.Subclassed by lupnt::IRKF, lupnt::PD45, lupnt::RK4, lupnt::RK8
Public Functions
-
inline virtual ~Integrator()¶
-
State Propagate(const ODE &odefunc, Real t0, Real tf, const State &x0, Real dt)¶
Propagate a
Statefromt0totfunder ODEodefunc, taking fixed/limited steps of (at most) sizedt.Called by numerical dynamics models (e.g.
NumericalOrbitDynamics::Propagate/ClockDynamics::Propagate) to advance the propagated state by oneDynamics::Propagateinterval.- Parameters:
odefunc – Right-hand side
dx/dt = f(t, x)t0 – Initial time [s]
tf – Final time [s] (must be >=
t0; steps are clamped so the last step lands exactly ontf)x0 – Initial state
dt – Nominal step size [s] (must be positive)
- Returns:
Propagated state at
tf
-
State Propagate(const ODE &odefunc, Real t0, Real tf, const State &x0, Real dt, MatXd *J)¶
Same as
Propagate(odefunc, t0, tf, x0, dt), additionally computing the state-transition (sensitivity) matrixd(xf)/d(x0)via parallel finite-difference Jacobians (JacobianParallel) ifJis non-null.- Parameters:
J – Output state-transition matrix (size n x n, where n =
x0.size()); passnullptrto skip the Jacobian computation
-
VecX Propagate(const ODE &odefunc, Real t0, Real tf, const VecX &x0, Real dt)¶
VecXoverload ofPropagate(odefunc, t0, tf, x0, dt); internally delegates toPropagateExand returns just the final state vector.
-
VecX Propagate(const ODE &odefunc, Real t0, Real tf, const VecX &x0, Real dt, MatXd *J)¶
VecXoverload of the Jacobian-computingPropagateabove.
-
IntegratorResult PropagateEx(const ODE &odefunc, Real t0, Real tf, const VecX &x0, Real dt)¶
Propagate
x0fromt0totfunderodefunc, stepping by (the magnitude of)dtin the direction implied bysign(tf - t0), and report how/when propagation stopped.Steps are clamped so the last step lands exactly on
tf. Ifparams_.terminate_if(t, x)is set and returns true (checked once before stepping and again after each step), propagation stops early withTerminationReason::UserCondition. Used byNumericalOrbitDynamics::PropagateEx/PropagateWithSTM-style callers that need the actual stop time/step count, not just the final state.- Parameters:
odefunc – Right-hand side
dx/dt = f(t, x)t0 – Initial time [s]
tf – Target final time [s] (may be less than
t0for backward propagation)x0 – Initial state vector
dt – Step size magnitude [s] (must be positive; direction is inferred from
tf - t0)
- Returns:
Final state, time, termination reason, and step count
-
IntegratorResult PropagateEx(const ODE &odefunc, Real t0, Real tf, const VecX &x0, Real dt, MatXd *J)¶
Same as
PropagateEx(odefunc, t0, tf, x0, dt), additionally computing the state-transition matrixd(xf)/d(x0)viaJacobianParallelifJis non-null.- Parameters:
J – Output state-transition matrix (size n x n, where n =
x0.size()); passnullptrto skip the Jacobian computation
-
inline void SetPrintProgress(bool print)¶
Enable/disable a progress bar (via
Logger::GetProgressBar) duringPropagate/PropagateExcalls — useful for long-running propagations in interactive/scripted runs.
-
virtual State Step(const ODE &f, Real t, const State &x, Real dt) = 0¶
Advance
xby one integration step of sizedtunder ODEfat timet.Implemented by each concrete integrator (
RK4,RK8,IRKF/RKF45,PD45) and called repeatedly byPropagate/PropagateExto march the state fromt0totf.- Parameters:
f – Right-hand side
dx/dt = f(t, x)t – Current time [s]
x – Current state
dt – Step size [s] (signed; adaptive integrators may modify it in-place to reflect the step actually taken)
- Returns:
State after stepping by
dt
-
inline void SetParams(IntegratorParams params)¶
Set the tolerances/iteration-limit/termination predicate used by
Propagate/PropagateExand adaptiveStepimplementations.
-
inline void SetTerminateIf(std::function<bool(Real, const VecX&)> pred)¶
Install (or clear, with
nullptr) an early-termination predicate evaluated duringPropagateEx; propagation stops withTerminationReason::UserConditiononcepred(t, x)returns true.
-
inline virtual ~Integrator()¶