Open Marvin-TMG opened 3 years ago
This would allow the FMU time to deviate from the simulation time. How about automatically resetting the Co-Simulation FMU upon re-enabling?
We need to treat the two options independently (reset/re-enable):
Just an update on this, the native Simulink implementation does not permit enabling/disabling in Co-Simulation, it allows this only for Model Exchange. None the less, I think it is a nice feature to have for Co-Simulation as well. We can indeed agree to either reset the model when re-enabling, or freeze time.
FYI: I could confirm that when using ME and pulsing the enable port with a 1s period 50% width pulse, both the native Simulink block and FMIKit produce the same result.
I just tested the new reset and model enable/disable functionality in the latest development branch, with Model Exchange it seems to work really well and the resetting/enabling happens pretty much as quick as you would expect. However, when running in Co-Simulation, the longer the simulation time has progressed, the longer it takes to initialize the model. I think the simulation time of the internal integrator should be offset to compensate for this.