LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::OdeOptions< T > Struct Template Reference

Integration controls. More...

#include <line/util/ode.h>

Public Attributes

rtol = num_traits<T>::from_double(1e-8)
 relative tolerance per component
atol = num_traits<T>::from_double(1e-10)
 absolute tolerance per component
h_init = num_traits<T>::from_int(0)
 initial step; 0 selects one automatically
h_min = num_traits<T>::from_int(0)
 smallest admissible step; 0 derives one
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.

Detailed Description

template<class T>
struct line::OdeOptions< T >

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.

Definition at line 118 of file ode.h.

Member Data Documentation

◆ atol

template<class T>
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().

◆ h_init

template<class T>
T line::OdeOptions< T >::h_init = num_traits<T>::from_int(0)

initial step; 0 selects one automatically

Definition at line 121 of file ode.h.

◆ h_max

template<class T>
T line::OdeOptions< T >::h_max = num_traits<T>::from_int(0)

largest admissible step; 0 means |t1 - t0|

Definition at line 123 of file ode.h.

◆ h_min

template<class T>
T line::OdeOptions< T >::h_min = num_traits<T>::from_int(0)

smallest admissible step; 0 derives one

Definition at line 122 of file ode.h.

◆ max_steps

template<class T>
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().

◆ rtol

template<class T>
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().

◆ step_stop

template<class T>
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().

◆ store_trajectory

template<class T>
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().


The documentation for this struct was generated from the following file:
  • include/line/util/ode.h