![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
One internal step at a time: ODEPACK's itask = 2. More...
#include <line/util/lsoda.h>
Public Member Functions | |
| LsodaStepper (const LsodaRhs &f, const std::vector< double > &y0, double t0, double t1, const LsodaOptions &opt=LsodaOptions()) | |
| bool | step () |
| Advance one accepted step. | |
| void | settle_at_end () |
| Interpolate the state back onto t1 after itask = 2 stepped past it. | |
| double | t () const |
| double | t_end () const |
| const std::vector< double > & | y () const |
| int | istate () const |
| bool | failed () const |
| bool | finished () const |
| std::size_t | steps () const |
| std::size_t | f_evals () const |
One internal step at a time: ODEPACK's itask = 2.
WHY THIS EXISTS. lsoda_integrate above reports the state only at the output times it was handed, and the integrator is free to do whatever it likes in between. MATLAB's odeset('NonNegative') is not a property of the output grid, it is a rule the STEP CONTROLLER applies to every accepted step – it charges a negative excursion as error, and it clips the accepted state and resets the divided-difference table. Reproducing that needs the trajectory one accepted step at a time, which is what this exposes; it is the analogue of scipy's LSODA.step(), which the native-Python port drives for the same reason.
THE RESTART IS THE HISTORY RESET. There is no way to reach into the vendored solver's Nordsieck array and rewrite it, and no need to: constructing a fresh stepper from a modified state is exactly what resetting the difference table accomplishes, because a first call (istate = 1) rebuilds the history from the initial state alone. The caller therefore expresses "clip and reset" by discarding the stepper and building another one.
step() may carry t() PAST t1, as itask = 2 always may; settle_at_end interpolates back onto t1 through the same history, which is what itask = 1 does on a continuation call.
|
inline |
Definition at line 288 of file lsoda.h.
References line::InputError::InputError().
|
inline |
Definition at line 335 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 332 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 331 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Interpolate the state back onto t1 after itask = 2 stepped past it.
Definition at line 323 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Advance one accepted step.
False once the horizon is reached or LSODA gave up.
Definition at line 314 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 334 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 328 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 329 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().
|
inline |
Definition at line 330 of file lsoda.h.
Referenced by line::lsoda_integrate_stepwise().