Base type for all model simulators.
More...
#include <Models.h>
|
| | Model () |
| | Initialize a model with no parameters.
|
| |
| void | setParams (const ParamsType ¶ms) |
| | Initialize the model with any required parameters.
|
| |
| bool | hasParams () |
| | Verify that the model has parameters explicity set by setParams().
|
| |
| void | reset () |
| | Zero out the model state and derivative variables and reset simulation time to zero.
|
| |
| double | t () const |
| | Get the current simulation time.
|
| |
| template<typename IntegratorType> |
| bool | simulate (const InputSignalType &u, const double &tf, const bool &insertIntoHistory=false, const bool &calculateXddot=false) |
| | Simulate the system response to an input over a specified time interval.
|
| |
| template<typename IntegratorType> |
| bool | simulate (const InputSignalType &u, const double &tf, const double &dt, const bool &insertIntoHistory=false, const bool &calculateXddot=false) |
| | Simulate the system response to an input over a specified time interval, chunked up into smaller integration increments.
|
| |
template<typename DynamicsType>
class Model< DynamicsType >
Base type for all model simulators.
Provides methods for initialization, reset, and simulation of dynamic models.
Derived types:
◆ InputSignalType
template<typename DynamicsType>
| using Model< DynamicsType >::InputSignalType = typename DynamicsType::InputSignalType |
◆ ParamsType
template<typename DynamicsType>
| using Model< DynamicsType >::ParamsType = typename DynamicsType::ParamsType |
◆ StateDotSignalType
template<typename DynamicsType>
| using Model< DynamicsType >::StateDotSignalType = typename DynamicsType::StateDotSignalType |
◆ StateSignalType
template<typename DynamicsType>
| using Model< DynamicsType >::StateSignalType = typename DynamicsType::StateSignalType |
◆ Model()
template<typename DynamicsType>
Initialize a model with no parameters.
◆ hasParams()
template<typename DynamicsType>
| bool Model< DynamicsType >::hasParams |
( |
| ) |
|
|
inline |
Verify that the model has parameters explicity set by setParams().
◆ reset()
template<typename DynamicsType>
| void Model< DynamicsType >::reset |
( |
| ) |
|
|
inline |
Zero out the model state and derivative variables and reset simulation time to zero.
◆ setParams()
template<typename DynamicsType>
Initialize the model with any required parameters.
The required parameters are determined by the model / dynamics specialization.
◆ simulate() [1/2]
template<typename DynamicsType>
template<typename IntegratorType>
| bool Model< DynamicsType >::simulate |
( |
const InputSignalType & | u, |
|
|
const double & | tf, |
|
|
const bool & | insertIntoHistory = false, |
|
|
const bool & | calculateXddot = false ) |
|
inline |
Simulate the system response to an input over a specified time interval.
- Parameters
-
| u | The input signal, which should be defined up to tf. |
| tf | The time to simulate to. Ideally the delta from the current time is small. |
| insertIntoHistory | Whether to store the result in state memory. |
| calculateXddot | Whether to use finite differencing to calculate the second time derivative of the state. |
- Returns
- Whether the simulation was successful.
◆ simulate() [2/2]
template<typename DynamicsType>
template<typename IntegratorType>
| bool Model< DynamicsType >::simulate |
( |
const InputSignalType & | u, |
|
|
const double & | tf, |
|
|
const double & | dt, |
|
|
const bool & | insertIntoHistory = false, |
|
|
const bool & | calculateXddot = false ) |
|
inline |
Simulate the system response to an input over a specified time interval, chunked up into smaller integration increments.
- Parameters
-
| u | The input signal, which should be defined up to tf. |
| tf | The time to simulate to. |
| dt | Time delta length by which to chunk up the integrations. Ideally this is small. |
| insertIntoHistory | Whether to store the result in state memory. |
| calculateXddot | Whether to use finite differencing to calculate the second time derivative of the state. |
- Returns
- Whether the simulation was successful.
◆ t()
template<typename DynamicsType>
| double Model< DynamicsType >::t |
( |
| ) |
const |
|
inline |
Get the current simulation time.
template<typename DynamicsType>
◆ xdot
template<typename DynamicsType>
Time derivative of the model state signal.
The documentation for this class was generated from the following file: