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.
#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 | |
IntegrationStep & | operator= (const IntegrationStep &)=default |
IntegrationStep (IntegrationStep &&)=default | |
IntegrationStep & | operator= (IntegrationStep &&)=default |
|
default |
|
default |
|
default |
Constructs an empty step.
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.
initial_time | Initial time t₀ where the step starts. |
initial_state | Initial state vector 𝐱₀ at initial_time as a column matrix. |
initial_state_derivative | Initial state derivative vector d𝐱/dt₀ at initial_time as a column matrix. |
std::exception | if 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. |
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).
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.
time | Time tᵢ to extend the step to. |
state | State vector 𝐱ᵢ at time tᵢ as a column matrix. |
state_derivative | State derivative vector d𝐱/dtᵢ at time tᵢ as a column matrix. |
std::exception | if 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. |
const std::vector<MatrixX<T> >& get_state_derivatives | ( | ) | const |
Gets step state derivatives {d𝐱/dt₀, ..., d𝐱/dtᵢ₋₁, d𝐱/dtᵢ} as column matrices.
const std::vector<MatrixX<T> >& get_states | ( | ) | const |
Returns step states {𝐱₀, ..., 𝐱ᵢ₋₁, 𝐱ᵢ} as column matrices.
const std::vector<T>& get_times | ( | ) | const |
Returns step times {t₀, ..., tᵢ₋₁, tᵢ}.
|
default |
|
default |
int size | ( | ) | const |
Returns the step state 𝐱 size (i.e. dimension).
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).