I tried a simple example with OpenModelica v1.20.0, but I find a confusing results.
The code is as follows:
model test
Boolean state1;
Boolean state2;
Real f;
equation
f = if time<1 then 0.5 else if time<3 then 0.4 else if time<5 then 0.3 else if time<7 then 0.4 else 0.5;
state1 = f<=0.4;
state2 = f<0.4 or f==0.4;
end test;
And the corresponding result is as follows:

Obviously, the result of state1(<=) is not equal state2(< or ==), and state1 is not a desired result.
Why?
There are some things to consider in Modelica:
state1 should ideally still be true from 1 to 7s where f<=0.4, and false otherwise; https://specification.modelica.org/maint/3.5/equations.html#events-and-synchronization So simulating that in Dymola generates 
state2 cannot be defined like that https://specification.modelica.org/maint/3.5/operators-and-expressions.html#equality-relational-and-logical-operatorsThe reason I write ideally is that it is not always possible to guarantee that relations are handled literally at events. That was specified in Modelica up to version 3.2; but did not work in all cases in practice and has thus later been removed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With