Drake
HermitianDenseOutput< T > Class Template Referencefinal

A StepwiseDenseOutput class implementation using Hermitian interpolators, and therefore a continuous extension of the solution 𝐱(t) (see [Engquist, 2105]). More...

#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
 
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...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 HermitianDenseOutput (const HermitianDenseOutput &)=default
 
HermitianDenseOutputoperator= (const HermitianDenseOutput &)=default
 
 HermitianDenseOutput (HermitianDenseOutput &&)=default
 
HermitianDenseOutputoperator= (HermitianDenseOutput &&)=default
 
- 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
 

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
    TA valid Eigen scalar type.

Constructor & Destructor Documentation

◆ HermitianDenseOutput() [1/3]

HermitianDenseOutput ( const HermitianDenseOutput< T > &  )
default

◆ HermitianDenseOutput() [2/3]

◆ HermitianDenseOutput() [3/3]

HermitianDenseOutput ( )
default

Member Function Documentation

◆ Consolidate()

void Consolidate ( )
inlineoverridevirtual

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::logic_errorif any of the preconditions is not met.

Implements StepwiseDenseOutput< T >.

◆ do_end_time()

const T& do_end_time ( ) const
inlineoverrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_is_empty()

bool do_is_empty ( ) const
inlineoverrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_size()

int do_size ( ) const
inlineoverrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_start_time()

const T& do_start_time ( ) const
inlineoverrideprotectedvirtual

Implements DenseOutput< T >.

◆ DoEvaluate()

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

Implements DenseOutput< T >.

◆ DoEvaluateNth()

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

Reimplemented from DenseOutput< T >.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Rollback()

void Rollback ( )
inlineoverridevirtual

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::logic_errorif any of the preconditions is not met.

Implements StepwiseDenseOutput< T >.

◆ Update()

void Update ( IntegrationStep  step)
inline

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::runtime_errorif 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: