Opened 11 years ago

Last modified 11 years ago

#2566 closed defect

Parameters with fixed = false and binding equation should be reported — at Version 1

Reported by: Francesco Casella Owned by: Lennart Ochel
Priority: high Milestone: 1.9.1
Component: Frontend Version: trunk
Keywords: Cc: Jens Frenkel, Lennart Ochel

Description (last modified by Francesco Casella)

From the Modelica spec. 3.2 rev2, sect 8.6

In the case a parameter has both a binding equation and fixed = false, a diagnostics is recommended, but the parameter should be solved from the binding equation.

Try the following test case:

model TestParameterBinding
  parameter Real p(fixed = false) = 2;
initial equation
  p = 4;
end TestParameterBinding;

OMC complains about overdetermined initialization, but then gives p = 4 (instead of p = 2, as the specification requires) and does not issue any diagnostic message. I would recommend that a warning is issued, such as:

Warning: the parameter p has fixed = false and a binding equation p = 2, which is probably redundant.

In older versions of Dymola, the binding equation was silently ignored in this case. It is still ignored, even though a warning is now issued. This is a possible cause of hard-to-understand errors with models that work fine in Dymola.

Change History (1)

comment:1 by Francesco Casella, 11 years ago

Description: modified (diff)
Status: newassigned
Note: See TracTickets for help on using tickets.