Drake
Drake C++ Documentation
HermitianDenseOutput< T > Class Template Referencefinal

Detailed Description

template<typename T>
class drake::systems::HermitianDenseOutput< T >

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.

  • [Engquist, 2105] B. Engquist. Encyclopedia of Applied and Computational Mathematics, p. 339, Springer, 2015.
  • [Hairer, 1993] E. Hairer, S. Nørsett and G. Wanner. Solving Ordinary Differential Equations I (Nonstiff Problems), p.190, Springer, 1993.
    Template Parameters
    TThe 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
 
HermitianDenseOutputoperator= (const HermitianDenseOutput &)=delete
 
 HermitianDenseOutput (HermitianDenseOutput &&)=delete
 
HermitianDenseOutputoperator= (HermitianDenseOutput &&)=delete
 
- Public Member Functions inherited from StepwiseDenseOutput< T >
 ~StepwiseDenseOutput () override=default
 
 StepwiseDenseOutput (const StepwiseDenseOutput &)=delete
 
StepwiseDenseOutputoperator= (const StepwiseDenseOutput &)=delete
 
 StepwiseDenseOutput (StepwiseDenseOutput &&)=delete
 
StepwiseDenseOutputoperator= (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...
 
EvaluateNth (const T &t, int n) const
 Evaluates the output value's nth 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
 
DenseOutputoperator= (const DenseOutput &)=delete
 
 DenseOutput (DenseOutput &&)=delete
 
DenseOutputoperator= (DenseOutput &&)=delete
 

Protected Member Functions

VectorX< T > DoEvaluate (const T &t) const override
 
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
 

Constructor & Destructor Documentation

◆ HermitianDenseOutput() [1/4]

HermitianDenseOutput ( const HermitianDenseOutput< T > &  )
delete

◆ HermitianDenseOutput() [2/4]

◆ HermitianDenseOutput() [3/4]

HermitianDenseOutput ( )
default

◆ HermitianDenseOutput() [4/4]

HermitianDenseOutput ( const trajectories::PiecewisePolynomial< T > &  trajectory)
explicit

Initialize the DenseOutput with an existing trajectory.

Member Function Documentation

◆ Consolidate()

void Consolidate ( )
overridevirtual

Consolidates latest updates.

All updates since last call or construction are put into a form that is suitable for evaluation.

Remarks
This process is irreversible.
Precondition
Updates have taken place since instantiation or last consolidation.
Postcondition
The extents covered by updates since instantiation or last consolidation can be evaluated (via Evaluate()).
Time extents covered by updates can be evaluated (via start_time()/end_time()).
Exceptions
std::exceptionif any of the preconditions is not met.

Implements StepwiseDenseOutput< T >.

◆ do_end_time()

const T& do_end_time ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_is_empty()

bool do_is_empty ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_size()

int do_size ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_start_time()

const T& do_start_time ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ DoEvaluate()

VectorX<T> DoEvaluate ( const T &  t) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ DoEvaluateNth()

T DoEvaluateNth ( const T &  t,
const int  n 
) const
overrideprotectedvirtual

Reimplemented from DenseOutput< T >.

◆ operator=() [1/2]

HermitianDenseOutput& operator= ( const HermitianDenseOutput< T > &  )
delete

◆ operator=() [2/2]

HermitianDenseOutput& operator= ( HermitianDenseOutput< T > &&  )
delete

◆ Rollback()

void Rollback ( )
overridevirtual

Rolls back (drops) the last update.

Remarks
This process is irreversible.
Precondition
Updates have taken place since instantiation or last consolidation (via Consolidate()).
Exceptions
std::exceptionif any of the preconditions is not met.

Implements StepwiseDenseOutput< T >.

◆ Update()

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).

Parameters
stepIntegration step to update this output with.
Exceptions
std::exceptionif 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.

The documentation for this class was generated from the following file: