An interface for dense output of ODE solutions, to efficiently approximate them at arbitrarily many points when solving them numerically (see IntegratorBase class documentation).
Multiple definitions of dense output may be found in literature. For some authors, it refers to the process of repeatedly adjusting the integration step size so that all points to be approximated are directly provided by the integrator (see [Engquist, 2015]). For others, it stands for any numerical approximation technique used to determine the solution in between steps (see [Hairer, 1993]). Despite this caveat, it is common terminology in IVP literature and thus its imparted functionality is immediately clear.
Herein, the concept in use may be formally stated as follows: given a solution 𝐱(t) ∈ ℝⁿ to an ODE system that is approximated at a discrete set of points 𝐲(tₖ) ∈ ℝⁿ where tₖ ∈ {t₁, ..., tᵢ} with tᵢ ∈ ℝ (e.g. as a result of numerical integration), a dense output of 𝐱(t) is another function 𝐳(t) ∈ ℝⁿ defined for t ∈ [t₁, tᵢ] such that 𝐳(tⱼ) = 𝐲(tⱼ) for all tⱼ ∈ {t₁, ..., tᵢ} and that approximates 𝐱(t) for every value in the closed interval [t₁, tᵢ].
T | The scalar type, which must be one of the default scalars. |
#include <drake/systems/analysis/dense_output.h>
Public Member Functions | |
virtual | ~DenseOutput ()=default |
VectorX< T > | Evaluate (const T &t) const |
Evaluates the output at the given time t . More... | |
T | EvaluateNth (const T &t, int n) const |
Evaluates the output value's n th scalar element (0-indexed) at the given time t . More... | |
int | size () const |
Returns the output size (i.e. More... | |
bool | is_empty () const |
Checks whether the output is empty or not. More... | |
const T & | start_time () const |
Returns output's start time, or in other words, the oldest time t that it can be evaluated at e.g. More... | |
const T & | end_time () const |
Returns output's end time, or in other words, the newest time t that it can be evaluated at e.g. More... | |
Does not allow copy, move, or assignment | |
DenseOutput (const DenseOutput &)=delete | |
DenseOutput & | operator= (const DenseOutput &)=delete |
DenseOutput (DenseOutput &&)=delete | |
DenseOutput & | operator= (DenseOutput &&)=delete |
Protected Member Functions | |
DenseOutput ()=default | |
virtual VectorX< T > | DoEvaluate (const T &t) const =0 |
virtual T | DoEvaluateNth (const T &t, int n) const |
virtual bool | do_is_empty () const =0 |
virtual int | do_size () const =0 |
virtual const T & | do_start_time () const =0 |
virtual const T & | do_end_time () const =0 |
void | ThrowIfOutputIsEmpty (const char *func_name) const |
void | ThrowIfNthElementIsInvalid (const char *func_name, int n) const |
void | ThrowIfTimeIsInvalid (const char *func_name, const T &t) const |
|
delete |
|
delete |
|
virtualdefault |
|
protecteddefault |
|
protectedpure virtual |
Implemented in HermitianDenseOutput< T >, and ScalarViewDenseOutput< T >.
|
protectedpure virtual |
Implemented in HermitianDenseOutput< T >, and ScalarViewDenseOutput< T >.
|
protectedpure virtual |
Implemented in HermitianDenseOutput< T >, and ScalarDenseOutput< T >.
|
protectedpure virtual |
Implemented in HermitianDenseOutput< T >, and ScalarViewDenseOutput< T >.
|
protectedpure virtual |
Implemented in HermitianDenseOutput< T >, and ScalarDenseOutput< T >.
|
protectedvirtual |
Reimplemented in HermitianDenseOutput< T >.
const T& end_time | ( | ) | const |
Returns output's end time, or in other words, the newest time t
that it can be evaluated at e.g.
via Evaluate().
std::exception | if any of the preconditions is not met. |
VectorX<T> Evaluate | ( | const T & | t | ) | const |
Evaluates the output at the given time t
.
t | Time at which to evaluate output. |
std::exception | if any of the preconditions are not met. |
std::exception | if given t is not within output's domain i.e. t ∉ [start_time(), end_time()]. |
T EvaluateNth | ( | const T & | t, |
int | n | ||
) | const |
Evaluates the output value's n
th scalar element (0-indexed) at the given time t
.
t | Time at which to evaluate output. |
n | The nth scalar element (0-indexed) of the output value to evaluate. |
n
th scalar element (0-indexed). std::exception | if any of the preconditions are not met. |
std::exception | if given t is not within output's domain i.e. t ∉ [start_time(), end_time()]. |
std::exception | if given n does not refer to a valid output dimension i.e. n ∉ [0, size()). |
bool is_empty | ( | ) | const |
Checks whether the output is empty or not.
|
delete |
|
delete |
int size | ( | ) | const |
Returns the output size (i.e.
the number of elements in an output value).
std::exception | if any of the preconditions is not met. |
const T& start_time | ( | ) | const |
Returns output's start time, or in other words, the oldest time t
that it can be evaluated at e.g.
via Evaluate().
std::exception | if any of the preconditions is not met. |
|
protected |
|
protected |
|
protected |