Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Translation Warning when comparing two Real numbers

Translation Warning when comparing two Real numbers

When i tried to compared two Real variable for if/when condition a Translation Warning is given by OM

Code:


[2] 08:17:44 Translation Warning
[KS_modelica.Blocks.Electrical.Load.Internal.DefaultLoadProfile: 82:3-82:67]: In relation A <> B,  <>  on Real numbers is only allowed inside functions.

[3] 08:17:44 Translation Warning
[Load.Internal.DefaultLoadProfile: 92:3-92:66]: In relation A <> B  <>  on Real numbers is only allowed inside functions.

[4] 08:17:44 Translation Warning
[Load.Internal.FaultProfilesUnit: 30:3-42:9]: In relation C== 1.0,  ==  on Real numbers is only allowed inside functions.

[5] 08:17:44 Translation Warning
[Load.Internal.FaultProfilesUnit: 30:3-42:9]: In relation C == 2.0,  ==  on Real numbers is only allowed inside functions.


With Real A,B,C;

If i recall correctly, using Integer would not trigger the warning message. Using floor(C) still resulting in translation warning.

How is the best way to compare two real values w/o triggering the translation warninig?

P.S. simulation runss with out problem

There are 0 guests and 0 other users also viewing this topic
You are here: