open-simulation-platform / libcosim

OSP C++ co-simulation library
https://open-simulation-platform.github.io/libcosim
Mozilla Public License 2.0
61 stars 10 forks source link

Oscillations when simulating the quarter-truck model. #609

Closed markaren closed 5 months ago

markaren commented 4 years ago

When simulating the quarter-truck system, FMPy and libcosim shows some oscillations at the beginning of the simulation, which does not manifest (to such degree) in either Vico, FMIGo! or OMSimulator. All using some kind of fixed-step-master and a 100hz step-size.

image

The difference between FMPy and libcosim is due to FMPy reporting output one time-step early. The issue is not floating point precision as e.g. FMIGo! exports values in scientific notation and Vico uses 8 decimal points.

markaren commented 2 years ago

Issue is fixed by transferring variables after start_simulation. Not sure if this issue affects the accuracy of non-20sim based simulations.