![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Integration controls. More...
#include <line/util/ode.h>
Public Attributes | |
| T | rtol = num_traits<T>::from_double(1e-8) |
| relative tolerance per component | |
| T | atol = num_traits<T>::from_double(1e-10) |
| absolute tolerance per component | |
| T | h_init = num_traits<T>::from_int(0) |
| initial step; 0 selects one automatically | |
| T | h_min = num_traits<T>::from_int(0) |
| smallest admissible step; 0 derives one | |
| T | h_max = num_traits<T>::from_int(0) |
| largest admissible step; 0 means |t1 - t0| | |
| std::size_t | max_steps = 100000 |
| abort after this many accepted steps | |
| bool | store_trajectory = true |
| keep every accepted point, not just the last | |
| std::function< bool(const T &, const std::vector< T > &)> | step_stop |
| A test consulted after every ACCEPTED STEP; true ends the integration there, holding that state as the solution for the rest of the span. | |
Integration controls.
All fields are caller-supplied; the defaults match the odeset('RelTol',1e-8,'AbsTol',1e-10) that the MATLAB callers of ode15s in this tree use. A note on how tight rtol can usefully be. The step is chosen so that the ORDER-TWO embedded estimate meets the tolerance, so h scales as rtol^(1/3) while the order-four solution is far more accurate than asked. Asking for 1e-8 costs a few hundred steps on the problems in this tree; asking for 1e-14 costs a few million and will hit max_steps. When the goal is accuracy rather than error control, pin h_init = h_min = h_max and run a fixed step: the solution error is O(h^4) and nothing is spent on the estimate.
| T line::OdeOptions< T >::atol = num_traits<T>::from_double(1e-10) |
absolute tolerance per component
Definition at line 120 of file ode.h.
Referenced by line::fluid::fluid_ode_solve_stiff(), and line::fluid::petri::solver_fluid_petri().
| T line::OdeOptions< T >::h_init = num_traits<T>::from_int(0) |
| T line::OdeOptions< T >::h_max = num_traits<T>::from_int(0) |
| T line::OdeOptions< T >::h_min = num_traits<T>::from_int(0) |
| std::size_t line::OdeOptions< T >::max_steps = 100000 |
abort after this many accepted steps
Definition at line 124 of file ode.h.
Referenced by line::fluid::fluid_ode_solve_stiff(), and line::fluid::petri::solver_fluid_petri().
| T line::OdeOptions< T >::rtol = num_traits<T>::from_double(1e-8) |
relative tolerance per component
Definition at line 119 of file ode.h.
Referenced by line::fluid::fluid_ode_solve_stiff(), and line::fluid::petri::solver_fluid_petri().
| std::function<bool(const T&, const std::vector<T>&)> line::OdeOptions< T >::step_stop |
A test consulted after every ACCEPTED STEP; true ends the integration there, holding that state as the solution for the rest of the span.
WHY IT EXISTS. A drift that has reached a fixed point cannot move again: f(y*) = 0 means y is y* for every later t, so the remaining span is known and stepping it is waste – and worse than waste, because a stiff step controller handed a state it is already at cannot pick a step and the integration stops advancing. Empty by default, and the loop then runs exactly as it always has. See LsodaOptions::step_stop for the twin on the other arm, and solver_fluid.h for the caller.
Definition at line 138 of file ode.h.
Referenced by line::fluid::fluid_ode_solve_stiff().
| bool line::OdeOptions< T >::store_trajectory = true |
keep every accepted point, not just the last
Definition at line 125 of file ode.h.
Referenced by line::fluid::fluid_ode_solve_stiff(), and line::fluid::petri::solver_fluid_petri().