You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by clauss on 27 Apr 2010 12:45 UTC
The index expression ((j-2)*(j-1))*0.5. is not an Integer expression but a Real expression,because of the multiplication by 0.5. Dymola failed to recognize this,because it did not distinguish between integer 1 and real 1.0, respectively integer 2 and real 2.0.
However, Dymola distinguishes between 3 and 3.0, so it implies that this model has only been tested with small values for lines. Next version of Dymola will handle 1, 1.0, 2 and 2.0 appropriately.
Such index expressions have to be replaced by div((j-2)*(j-1),2).
Comment by dietmarw on 28 Apr 2010 06:46 UTC
Was fixed in f9cc3c1 (and 0e19975).
Note: In the future we should avoid such tool-specific "workarounds". Even if they are legal Modelica. If there is a problem with a specific tool then the tool should be fixed and not the perfectly correct Modelica code in the MSL.
Comment by HansOlsson on 28 Apr 2010 08:21 UTC
I agree with the change and the comment is in itself correct.
However, I don't see how the comment relates to this ticket, since the old code was incorrect Modelica (handled correctly for some cases by Dymola 7.4 (and earlier)) whereas the new code is correct Modelica.
And I can't understand how the old code would be a tool-specific workaround.
Comment by dietmarw on 28 Apr 2010 08:43 UTC
OK from reading the description I got the impression that the code itself was correct but was handled differently/incorrect by the tool. If this is however not the case and the old code was indeed incorrect to start with then my comment is not applicable in this case. (However there exist a ticket where perfectly legal Modelica was changed just so that it works in Dymola and that's something we should avoid, see #314).
Reported by clauss on 27 Apr 2010 12:45 UTC
The index expression ((j-2)*(j-1))*0.5. is not an Integer expression but a Real expression,because of the multiplication by 0.5. Dymola failed to recognize this,because it did not distinguish between integer 1 and real 1.0, respectively integer 2 and real 2.0.
However, Dymola distinguishes between 3 and 3.0, so it implies that this model has only been tested with small values for lines. Next version of Dymola will handle 1, 1.0, 2 and 2.0 appropriately.
Such index expressions have to be replaced by div((j-2)*(j-1),2).
Reported by Sven Erik Mattsson
Migrated-From: https://trac.modelica.org/Modelica/ticket/363
The text was updated successfully, but these errors were encountered: