Class IRKF¶
Defined in File integrator.h
Inheritance Relationships¶
Base Type¶
public lupnt::Integrator(Class Integrator)
Derived Type¶
public lupnt::RKF45(Class RKF45)
Class Documentation¶
-
class IRKF : public lupnt::Integrator¶
Abstract base for embedded Runge-Kutta-Fehlberg-type integrators with adaptive step-size control.
Steprepeatedly calls the subclass-providedUpdateto compute a low- and high-order solution pair, checks the relative error viaComputeRelError, and shrinksdtand retries (up toIntegratorParams::max_itertimes) until the error is within tolerance.RKF45is the concrete 4(5)-order instantiation used byNumericalOrbitDynamicswhenIntegratorType::RKF45is selected.Subclassed by lupnt::RKF45
Public Functions
-
inline IRKF(int order)¶
Construct an embedded RKF-type integrator of the given low-order accuracy
order(used byComputeRelError’s step-size-control exponent).
-
virtual State Step(const ODE &f, Real t, const State &x, Real dt) override¶
One adaptive step: repeatedly calls
UpdateandComputeRelError, shrinking/growingdtuntil the embedded low/high-order solutions agree to withinIntegratorParams::abstol/reltol, ormax_iteris exceeded (throws viaLUPNT_CHECKin that case).- Parameters:
f – Right-hand side
dx/dt = f(t, x)t – Current time [s]
x – Current state
dt – Step size [s]; updated in-place by
ComputeRelError
- Returns:
Low-order solution after stepping by (the final)
dt
-
bool ComputeRelError(const State &x_new_low, const State &x_new_high, Real &dt)¶
Compute the relative error norm between the embedded low- and high-order solutions and adjust
dtaccordingly (PI-type step-size controller).Called once per iteration inside
StepafterUpdateproducesx_new_lowandx_new_high.- Parameters:
x_new_low – Lower-order embedded solution
x_new_high – Higher-order embedded solution
dt – Step size [s]; rescaled in-place by the step-size controller (clamped to [0.5, 2.0] times its input value) for the next attempt
- Returns:
True if the error is within
IntegratorParams::abstol/reltolfor every component (step accepted); false otherwise (caller should retry with the rescaleddt)
-
virtual void Update(const ODE &f, Real t, const State &x, Real dt, State &x_new_low, State &x_new_high) = 0¶
Compute the embedded low- and high-order solution pair for one step of size
dt, using the subclass’s Butcher tableau.- Parameters:
f – Right-hand side
dx/dt = f(t, x)t – Current time [s]
x – Current state
dt – Step size [s]
x_new_low – Output: lower-order solution at
t + dtx_new_high – Output: higher-order solution at
t + dt
-
virtual ~IRKF() = default¶
-
inline IRKF(int order)¶