- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Discrete event simulation with FMU...
Discrete event simulation with FMU Model exchange
Discrete event simulation with FMU Model exchange
I'm using the FMU SDK to test the generated FMU on OM.
I test this example :
model DiscreteTimeObj
parameter Real sample_interval = 0.1;
Real x(start=5.0);
Real y;
equation
der(x) = -x;
when sample(0, sample_interval) then
y = x;
end when;
end DiscreteTimeObj;
using the command (binary of the FMU sdk to test the fmu) :
fmusim_me.exe DiscreteTimeObj.fmu 1.0 0.01
that is to say with startTime = 0.0 stopTime=1.0 with a time step imposed to 0.01.
When I plot y, it remains constant to 5.0. This example works on OM : y decreases and has constant values
in the intervals of length 0.1.
Is it a limitation of the generated FMU that doesn't support the directive sample or is it the code of
the fmu testing program work ?
Thank you for the help.
Re: Discrete event simulation with FMU Model exchange
You mean it works in OM and not in FMU SDK?
Adeel.
- adeas
- 454 Posts
Re: Discrete event simulation with FMU Model exchange
Hello Fnoel
FMU SDK includes a sample with a simple Euler solver. You can run your model in OpenModelica and choose "euler" solver to know if it is enough for you. It it does not work in OpenModelica you can see this post (https://www.openmodelica.org/index.php/ … c?id=1173)
Best regards
Koldo
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Discrete event simulation with FMU...