Drake
Drake C++ Documentation
HermitianDenseOutput< T >::IntegrationStep Class Reference

Detailed Description

template<typename T>
class drake::systems::HermitianDenseOutput< T >::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ᵢ ∈ ℝⁿ.

This step definition allows for intermediate time, state and state derivative triplets (e.g. the integrator internal stages) to improve interpolation.

Note
The use of column matrices instead of plain vectors helps reduce HermitianDenseOutput construction overhead, as this type of dense output leverages a PiecewisePolynomial instance that takes matrices.

#include <drake/systems/analysis/hermitian_dense_output.h>

Public Member Functions

 IntegrationStep ()=default
 Constructs an empty step. More...
 
 IntegrationStep (const T &initial_time, MatrixX< T > initial_state, MatrixX< T > initial_state_derivative)
 Constructs a zero length step (i.e. More...
 
void Extend (const T &time, MatrixX< T > state, MatrixX< T > state_derivative)
 Extends the step forward in time from column matrices. More...
 
const T & start_time () const
 Returns step start time t₀ (that of the first time, state and state derivative triplet), which may coincide with its end time tᵢ (that of the last time, state and state derivative triplet) if the step has zero length (that is, it contains a single triplet). More...
 
const T & end_time () const
 Returns step end time tᵢ (that of the first time, state and state derivative triplet), which may coincide with its start time t₀ (that of the last time, state and state derivative triplet) if the step has zero length (that is, it contains a single triplet). More...
 
int size () const
 Returns the step state 𝐱 size (i.e. dimension). More...
 
const std::vector< T > & get_times () const
 Returns step times {t₀, ..., tᵢ₋₁, tᵢ}. More...
 
const std::vector< MatrixX< T > > & get_states () const
 Returns step states {𝐱₀, ..., 𝐱ᵢ₋₁, 𝐱ᵢ} as column matrices. More...
 
const std::vector< MatrixX< T > > & get_state_derivatives () const
 Gets step state derivatives {d𝐱/dt₀, ..., d𝐱/dtᵢ₋₁, d𝐱/dtᵢ} as column matrices. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 IntegrationStep (const IntegrationStep &)=default
 
IntegrationStepoperator= (const IntegrationStep &)=default
 
 IntegrationStep (IntegrationStep &&)=default
 
IntegrationStepoperator= (IntegrationStep &&)=default
 

Constructor & Destructor Documentation

◆ IntegrationStep() [1/4]

IntegrationStep ( const IntegrationStep )
default

◆ IntegrationStep() [2/4]

IntegrationStep ( IntegrationStep &&  )
default

◆ IntegrationStep() [3/4]

IntegrationStep ( )
default

Constructs an empty step.

◆ IntegrationStep() [4/4]

IntegrationStep ( const T &  initial_time,
MatrixX< T >  initial_state,
MatrixX< T >  initial_state_derivative 
)

Constructs a zero length step (i.e.

a step containing a single time, state and state derivative triplet) from column matrices.

Parameters
initial_timeInitial time t₀ where the step starts.
initial_stateInitial state vector 𝐱₀ at initial_time as a column matrix.
initial_state_derivativeInitial state derivative vector d𝐱/dt₀ at initial_time as a column matrix.
Exceptions
std::exceptionif given initial_state 𝐱₀ is not a column matrix.
if given initial_state_derivative d𝐱/t₀ is not a column matrix.
if given initial_state 𝐱₀ and initial_state_derivative d𝐱/dt₀ do not match each other's dimension.

Member Function Documentation

◆ end_time()

const T& end_time ( ) const

Returns step end time tᵢ (that of the first time, state and state derivative triplet), which may coincide with its start time t₀ (that of the last time, state and state derivative triplet) if the step has zero length (that is, it contains a single triplet).

◆ Extend()

void Extend ( const T &  time,
MatrixX< T >  state,
MatrixX< T >  state_derivative 
)

Extends the step forward in time from column matrices.

Provided time, state and state_derivative are appended to the current step, effectively increasing its time length.

Parameters
timeTime tᵢ to extend the step to.
stateState vector 𝐱ᵢ at time tᵢ as a column matrix.
state_derivativeState derivative vector d𝐱/dtᵢ at time tᵢ as a column matrix.
Exceptions
std::exceptionif given state 𝐱ᵢ is not a column matrix.
if given state_derivative d𝐱/dtᵢ is not a column matrix.
if given time tᵢ is not greater than the previous time tᵢ₋₁ in the step.
if given state 𝐱ᵢ dimension does not match the dimension of the previous state 𝐱ᵢ₋₁.
if given state 𝐱ᵢ and state_derivative d𝐱/dtᵢ do not match each other's dimension.

◆ get_state_derivatives()

const std::vector<MatrixX<T> >& get_state_derivatives ( ) const

Gets step state derivatives {d𝐱/dt₀, ..., d𝐱/dtᵢ₋₁, d𝐱/dtᵢ} as column matrices.

◆ get_states()

const std::vector<MatrixX<T> >& get_states ( ) const

Returns step states {𝐱₀, ..., 𝐱ᵢ₋₁, 𝐱ᵢ} as column matrices.

◆ get_times()

const std::vector<T>& get_times ( ) const

Returns step times {t₀, ..., tᵢ₋₁, tᵢ}.

◆ operator=() [1/2]

IntegrationStep& operator= ( IntegrationStep &&  )
default

◆ operator=() [2/2]

IntegrationStep& operator= ( const IntegrationStep )
default

◆ size()

int size ( ) const

Returns the step state 𝐱 size (i.e. dimension).

◆ start_time()

const T& start_time ( ) const

Returns step start time t₀ (that of the first time, state and state derivative triplet), which may coincide with its end time tᵢ (that of the last time, state and state derivative triplet) if the step has zero length (that is, it contains a single triplet).


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