|
bitsim
Model, simulate, estimate and control robots in C++
|
A part of a coupled system that a co-simulation steps on its own: a robot, a trailer, a motor, each with its own solver, coupled to the others only through its inputs and outputs. More...
#include <cosim_subsystem.h>

Public Member Functions | |
| virtual | ~CoSimSubsystem ()=default |
| virtual uint_t | n_inputs () const =0 |
| virtual uint_t | n_outputs () const =0 |
| virtual std::vector< real_t > | outputs (const std::vector< real_t > &inputs) const =0 |
| The outputs at the present time, with the inputs at the present time. | |
| virtual void | do_step (real_t t, real_t H, const std::vector< real_t > &u_begin, const std::vector< real_t > &u_end)=0 |
| Advance from t to t + H, the inputs moving linearly from u_begin to u_end. | |
| virtual void | save ()=0 |
| Remember the present state. | |
| virtual void | restore ()=0 |
| Go back to the state save() remembered. | |
A part of a coupled system that a co-simulation steps on its own: a robot, a trailer, a motor, each with its own solver, coupled to the others only through its inputs and outputs.
The interface follows that of a co-simulation unit of the Functional Mock-up Interface: the master gives the inputs, asks the subsystem to advance by a macro step, and reads the outputs. Over a step from t to t + H the inputs move linearly from u_begin to u_end, so a subsystem can interpolate them within its own smaller steps; a master that does not know u_end yet passes a guess.
To couple tightly, the master repeats a macro step until the inputs and the outputs agree. It calls save() before the first try and restore() before every other, so the subsystem must be able to go back to the state it saved.
|
virtualdefault |
|
pure virtual |
Advance from t to t + H, the inputs moving linearly from u_begin to u_end.
Implemented in bitsim::cosim::OdeSubsystem.
|
pure virtual |
Implemented in bitsim::cosim::OdeSubsystem.
|
pure virtual |
Implemented in bitsim::cosim::OdeSubsystem.
|
pure virtual |
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.
Implemented in bitsim::cosim::OdeSubsystem.
|
pure virtual |
Go back to the state save() remembered.
Implemented in bitsim::cosim::OdeSubsystem.
|
pure virtual |
Remember the present state.
Implemented in bitsim::cosim::OdeSubsystem.