Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#4764 closed defect (worksforme)

Reducing variability from variable to parameter causes underdetermined equation system

Reported by: christopher.schoelzel@… Owned by: Lennart Ochel
Priority: normal Milestone: Future
Component: Backend Version: v1.12.0
Keywords: Cc:

Description

According to the Modelica Spec 3.3 it should be possible to restrict the variability of a variable with a redeclare statement. However, it does not seem that the OpenModelica compiler respects such a change correctly if it transforms a variable into a parameter. According to my understanding the following model should be correct:

model RedeclareVariability
  model A
    Real a;
  end A;
  model B
    extends A(redeclare parameter Real a = 3);
  end B;
  B foo;
end RedeclareVariability;

The component foo is of type B and therefore only has one parameter and no variables, so no equation should be needed.

In OpenModelica, however, I get the error message that "foo.a does not have any remaining equations to be solved in".

Change History (2)

comment:1 by Francesco Casella, 7 years ago

Resolution: worksforme
Status: newclosed

I just ran this with OMEdit v1.13.0-dev-100-g1d1f811 (64-bit)
Connected to v1.13.0-dev-407-gc4493da (64-bit) and it worked fine. Which version of OMC are you using?

comment:2 by christopher.schoelzel@…, 7 years ago

Thanks for looking into this.

I just tried OMEdit v1.13.0-dev-101-ga45068d (64-bit)
Connected to v1.13.0-dev-449-g30a4db0 (64-bit) and it also worked fine for me, so it seems that the issue is already fixed in the latest build.

Originally I used the current stable version of v1.12 (64-bit, Windows).

Note: See TracTickets for help on using tickets.