|
bitsim
Model, simulate, estimate and control robots in C++
|
A subsystem given by its equations: the state x moves with dx/dt = f(t, x, u), and the outputs are y = h(x, u). More...
#include <cosim_subsystem.h>


Public Types | |
| using | rhs_type |
| using | output_type |
Public Member Functions | |
| OdeSubsystem (std::vector< real_t > x0, uint_t n_inputs, uint_t n_outputs, rhs_type f, output_type h, uint_t n_substeps=10) | |
| uint_t | n_inputs () const override |
| uint_t | n_outputs () const override |
| std::vector< real_t > | outputs (const std::vector< real_t > &inputs) const override |
| The outputs at the present time, with the inputs at the present time. | |
| void | do_step (real_t t, real_t H, const std::vector< real_t > &u_begin, const std::vector< real_t > &u_end) override |
| Advance from t to t + H, the inputs moving linearly from u_begin to u_end. | |
| void | save () override |
| Remember the present state. | |
| void | restore () override |
| Go back to the state save() remembered. | |
| const std::vector< real_t > & | state () const noexcept |
| uint_t | n_substeps () const noexcept |
| Public Member Functions inherited from bitsim::cosim::CoSimSubsystem | |
| virtual | ~CoSimSubsystem ()=default |
A subsystem given by its equations: the state x moves with dx/dt = f(t, x, u), and the outputs are y = h(x, u).
do_step() takes n_substeps steps of fourth order Runge-Kutta per macro step, with the inputs interpolated linearly within the step.
| bitsim::cosim::OdeSubsystem::OdeSubsystem | ( | std::vector< real_t > | x0, |
| uint_t | n_inputs, | ||
| uint_t | n_outputs, | ||
| rhs_type | f, | ||
| output_type | h, | ||
| uint_t | n_substeps = 10 ) |
| x0 | the initial state |
| n_inputs | how many inputs f and h take |
| n_outputs | how many outputs h gives |
| f | the right-hand side, dx/dt = f(t, x, u) |
| h | the outputs, y = h(x, u) |
| n_substeps | the Runge-Kutta steps per macro step |
|
overridevirtual |
Advance from t to t + H, the inputs moving linearly from u_begin to u_end.
Implements bitsim::cosim::CoSimSubsystem.
|
inlineoverridevirtual |
Implements bitsim::cosim::CoSimSubsystem.
|
inlineoverridevirtual |
Implements bitsim::cosim::CoSimSubsystem.
|
inlinenoexcept |
|
overridevirtual |
The outputs at the present time, with the inputs at the present time.
Outputs that depend on the inputs directly, a force computed from a position that comes in, are called direct feedthrough; the master resolves them, see CoSimulation.
Implements bitsim::cosim::CoSimSubsystem.
|
inlineoverridevirtual |
Go back to the state save() remembered.
Implements bitsim::cosim::CoSimSubsystem.
|
inlineoverridevirtual |
Remember the present state.
Implements bitsim::cosim::CoSimSubsystem.
|
inlinenoexcept |