A StepwiseDenseOutput class implementation using Hermitian interpolators, and therefore a continuous extension of the solution 𝐱(t) (see [Engquist, 2105]).
This concept can be recast as a type of dense output that is continuous.
Updates take the form of integration steps, for which state 𝐱 and state time derivative d𝐱/dt are known at least at both ends of the step. Hermite cubic polynomials are then constructed upon consolidation, yielding a C1 extension of the solution 𝐱(t).
Hermitian continuous extensions exhibit the same truncation error as that of the integration scheme being used for up to 3rd order schemes (see [Hairer, 1993]).
From a performance standpoint, memory footprint and evaluation overhead (i.e. the computational cost of an evaluation) increase linearly and logarithmically with the amount of steps taken, respectively.
T | The scalar type, which must be one of the default scalars. |
#include <drake/systems/analysis/hermitian_dense_output.h>
Classes | |
class | IntegrationStep |
An integration step representation class, holding just enough for Hermitian interpolation: three (3) related sets containing step times {t₀, ..., tᵢ₋₁, tᵢ} where tᵢ ∈ ℝ, step states {𝐱₀, ..., 𝐱ᵢ₋₁, 𝐱ᵢ} where 𝐱ᵢ ∈ ℝⁿ, and state derivatives {d𝐱/dt₀, ..., d𝐱/dtᵢ₋₁, d𝐱/dtᵢ} where d𝐱/dtᵢ ∈ ℝⁿ. More... | |
Public Member Functions | |
HermitianDenseOutput ()=default | |
HermitianDenseOutput (const trajectories::PiecewisePolynomial< T > &trajectory) | |
Initialize the DenseOutput with an existing trajectory. More... | |
void | Update (IntegrationStep step) |
Update output with the given step . More... | |
void | Rollback () override |
Rolls back (drops) the last update. More... | |
void | Consolidate () override |
Consolidates latest updates. More... | |
Does not allow copy, move, or assignment | |
HermitianDenseOutput (const HermitianDenseOutput &)=delete | |
HermitianDenseOutput & | operator= (const HermitianDenseOutput &)=delete |
HermitianDenseOutput (HermitianDenseOutput &&)=delete | |
HermitianDenseOutput & | operator= (HermitianDenseOutput &&)=delete |
Public Member Functions inherited from StepwiseDenseOutput< T > | |
~StepwiseDenseOutput () override=default | |
StepwiseDenseOutput (const StepwiseDenseOutput &)=delete | |
StepwiseDenseOutput & | operator= (const StepwiseDenseOutput &)=delete |
StepwiseDenseOutput (StepwiseDenseOutput &&)=delete | |
StepwiseDenseOutput & | operator= (StepwiseDenseOutput &&)=delete |
Public Member Functions inherited from DenseOutput< T > | |
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... | |
DenseOutput (const DenseOutput &)=delete | |
DenseOutput & | operator= (const DenseOutput &)=delete |
DenseOutput (DenseOutput &&)=delete | |
DenseOutput & | operator= (DenseOutput &&)=delete |
Protected Member Functions | |
VectorX< T > | DoEvaluate (const T &t) const override |
T | DoEvaluateNth (const T &t, const int n) const override |
bool | do_is_empty () const override |
int | do_size () const override |
const T & | do_end_time () const override |
const T & | do_start_time () const override |
Protected Member Functions inherited from StepwiseDenseOutput< T > | |
StepwiseDenseOutput ()=default | |
Protected Member Functions inherited from DenseOutput< T > | |
DenseOutput ()=default | |
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 |
|
default |
|
explicit |
Initialize the DenseOutput with an existing trajectory.
|
overridevirtual |
Consolidates latest updates.
All updates since last call or construction are put into a form that is suitable for evaluation.
std::exception | if any of the preconditions is not met. |
Implements StepwiseDenseOutput< T >.
|
overrideprotectedvirtual |
Implements DenseOutput< T >.
|
overrideprotectedvirtual |
Implements DenseOutput< T >.
|
overrideprotectedvirtual |
Implements DenseOutput< T >.
|
overrideprotectedvirtual |
Implements DenseOutput< T >.
|
overrideprotectedvirtual |
Implements DenseOutput< T >.
|
overrideprotectedvirtual |
Reimplemented from DenseOutput< T >.
|
delete |
|
delete |
|
overridevirtual |
Rolls back (drops) the last update.
std::exception | if any of the preconditions is not met. |
Implements StepwiseDenseOutput< T >.
void Update | ( | IntegrationStep | step | ) |
Update output with the given step
.
Provided step
is queued for later consolidation. Note that the time the step
extends cannot be readily evaluated (see StepwiseDenseOutput class documentation).
step | Integration step to update this output with. |
std::exception | if given step has zero length.if given step does not ensure C1 continuity at the end of this dense output.if given step dimensions does not match this dense output dimensions. |