OpenModelica / OMSimulator

The OpenModelica FMI & SSP-based co-simulation environment.
Other
71 stars 51 forks source link

SystemSC calls fmi2EndIntegratorStep before updating inputs and simulation time to the end of the step #1326

Open rruusu opened 3 days ago

rruusu commented 3 days ago

Description

With strongly coupled model, the EM FMUs receive an fmi2EndIntegratorStep before setting final input values and simulation time.

Expected behavior

FMI components will assume that the simulation time (via fmi2SetTime) and input variables have been set to the values that match the actual integrator result when fmi2EndIntegratorStep is called.

Instead, the time is the end of the previous step, and inputs are at whatever values the solver used for its last residual evaluation, which doesn't always match the actual state achieved after the call to fmi2EndIntegratorStep.

Version and OS

rruusu commented 3 days ago

I will post a fix to this to my fork shortly.