A constrained step class for the steppers.
This class is symmetrical for forward and backward propagation. The sign of the propagation direction should not enter here but rather be applied the step is actually taken.
As simple as this class looks it hides a few very important details:
Overstepping handling. The step size sign will flip if we happened to pass our target.
Convergence handling. Smaller and smaller step sizes have to be used in order to converge on a target.
Because of the points mentioned above, the update function will always prefer negative step sizes. A side effect of this is that we will propagate in the opposite direction if the target is “behind us”.
The hierarchy is:
Overstepping resolution / backpropagation
Step into the void with
the types of constraints from accuracy - this can vary up and down given a good step estimator from actor - this would be a typical navigation step from aborter - this would be a target condition from user - this is user given for what reason ever
- enumerator accuracy
constexpr ConstrainedStep() = default
inline explicit constexpr ConstrainedStep(Scalar value)
constructor from Scalar
value – is the user given initial value
inline constexpr void release(Type type)
release a certain constraint value
type – is the constraint type to be released
inline constexpr void setValue(Scalar value)
set accuracy by one Scalar
this will set only the accuracy, as this is the most exposed to the Propagator
value – is the new accuracy value
inline std::ostream &toStream(std::ostream &os) const
inline std::string toString() const
inline constexpr void update(Scalar value, Type type, bool releaseStep = false)
Update the step size of a certain type.
Only navigation and target abortion step size updates may change the sign due to overstepping
value – is the new value to be updated
type – is the constraint type
releaseStep – Allow step size to increase again
size_t nStepTrials = std::numeric_limits<size_t>::max()
Number of iterations needed by the stepsize finder (e.g.
Runge-Kutta) of the stepper.