Opened 14 years ago
Last modified 14 years ago
#1354 closed defect (fixed)
Wrong number of equations reported
Reported by: | Jan Brugård | Owned by: | Jan Brugård |
---|---|---|---|
Priority: | blocker | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Jan Brugård, |
Description
Consider the following model:
model WrongNumberofEquations type Transparency= Modelica.Icons.TypeReal(min=0, max=1); type Shininess= Modelica.Icons.TypeReal(min=0, max=1); input Transparency transparency=0 ; Shininess shininess=0 ; end WrongNumberofEquations;
The model reports that it has 3 equations and 1 variable, which is clearly incorrect. Both types are aliases of type Real. If the model is changed to use reals instead it reports 1 equation and 1 variable (i.e. it works, but it should probably report to of each whereof one is input):
model WrongNumberofEquations2 input Real transparency=0 ; Real shininess=0 ; end WrongNumberofEquations2;
Change History (6)
comment:1 by , 14 years ago
comment:3 by , 14 years ago
Adrian, for my education, is it always? I thought that it could depend on where it all goes wrong (Peter is not here to ask)?
comment:4 by , 14 years ago
It's not always the backend, because it can't count correctly that which is not correct. This is therefore fixed in revision 6960 of trunk, see test case mosfiles/ComplexTypeEquationCount. I'll add it to the 1.5.1-Maintenance branch too.
comment:5 by , 14 years ago
The problem is indeed in the frontend:
instantiateModel(WrongNumberofEquations) =>
"class WrongNumberofQuations
input Real transparency(min = 0.0, max = 1.0) = 0.0;
Real shininess(min = 0.0, max = 1.0) = 0.0;
equation
transparency = 0.0;
shininess = 0.0;
end WrongNumberofQuations;
Note that equations should not be generated, since they are variable bindings.
MathCore ticket: http://intranet/trac/mathmodelica/ticket/2993