When simulating a strongly coupled model, the RHS function that is provided to CVODE calls fmi2SetTime with the wrong time value before reading the state derivative values.
All evaluations performed by CVODE are made using the end of the previous time step as the time value, which creates strange effects when state derivatives have a direct dependence on the simulation time, for example via an input from a signal source.
Steps to reproduce the behavior
Create a model with state derivatives that depend directly on time
Log FMI calls
Observe that fmi2SetTime is always called with time value that matches one used before previous call to fmi2CompletedIntegratorStep
Expected behavior
The time value provided to oms::cvode_rhs should be passed to the FMUs using fmi2SetTime before the calls to fmi2GetDerivatives, but the fmi2SetTime calls performed by oms::SystemSC::updateInputs are made using the field oms::System::time, which still has the value of the last completed integrator step.
Description
When simulating a strongly coupled model, the RHS function that is provided to CVODE calls
fmi2SetTime
with the wrong time value before reading the state derivative values.All evaluations performed by CVODE are made using the end of the previous time step as the time value, which creates strange effects when state derivatives have a direct dependence on the simulation time, for example via an input from a signal source.
Steps to reproduce the behavior
fmi2SetTime
is always called with time value that matches one used before previous call tofmi2CompletedIntegratorStep
Expected behavior
The time value provided to
oms::cvode_rhs
should be passed to the FMUs usingfmi2SetTime
before the calls tofmi2GetDerivatives
, but thefmi2SetTime
calls performed byoms::SystemSC::updateInputs
are made using the fieldoms::System::time
, which still has the value of the last completed integrator step.Version and OS