Opened 10 years ago
Last modified 10 years ago
#3165 new defect
Cyclically dependent parameters due to min/max attribute
Reported by: | Lennart Ochel | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: | Adrian Pop |
Description
model test parameter Real a(min=0, max=b) = 2; parameter Real b(min=a) = 3; end test;
OpenModelica throws following error message for this model:
Translation Error Cyclically dependent constants or parameters found in scope test: {b,a}.
Is that intended? Dymola does not complain about cyclically dependent parameters in this case.
Change History (3)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
- Results of polls are not part of the specification :)
- The min/max cycle above does not use Evaluate=true
However, the constraint is only for the binding equation. I don't think the min/max should be checked there. However, min and max are defined by structural parameters, so if we fail to evaluate them that should be a warning (or an error). Thus, a and b should be evaluated and replaced anyway.
comment:3 by , 10 years ago
Component: | Unknown → Frontend |
---|
This is caught in the front end.
Version 0, edited 10 years ago by (next)
Note:
See TracTickets
for help on using tickets.
Modelica.Fluid goes one step further. In order to solve a long standing ticket (https://trac.modelica.org/Modelica/ticket/736), we introduced things like:
Then Modelica tools became more pedantic. At the 81st Modelica Design Meeting a poll concluded with a majority of 90% (10% abstaining):
Cycles are allowed if the cycles disappear when evaluating parameters having annotation Evaluate=true that are not part of the cycle.
Doesn't this mean that the above min/max cycle should be accepted as well?