Opened 12 years ago
Closed 12 years ago
#1983 closed defect (fixed)
Parameter has neither value nor start value, and is fixed
Reported by: | Christian Schubert | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | Frontend | Version: | trunk |
Keywords: | parameter initialization | Cc: | Lennart Ochel |
Description
Hi,
I always wondered about those strange warnings and created a simple testmodel, which reproduces this error (see attachment)
Basically, if you have
model A parameter Integer n = 2; parameter Real a[n](each fixed = false); initial equation a = fill(1.0, n); end A;
you'll get the warning although (from my point of view) everything should be fine.
Morover, the warning is misleading.
Yes, the parameter doesn't have value nor start value. But where does it say it is fixed?
I think that case might even be handled correctly by Lennart's new initilization?
Attachments (1)
Change History (11)
by , 12 years ago
Attachment: | ParameterBug.mo added |
---|
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Is it only the warning that is wrong, or is there a chance of something worse caused by that?
comment:3 by , 12 years ago
I guess this task should have a higer prioriti. Because of final parameteres with no binding the backend get in trouble. For example if the final parameter is replaced with its default falue index reduktion will fail sometimes.
comment:4 by , 12 years ago
As far as I've seen only the warning is wrong.
The bindings do appear in the flat Modelica code.
Also, in some cases:
- we move the bindings from the parameters into the equation section
- we instantiate the component without the binding just to get its type
and these might trigger the wrong warning.
Cheers,
Adrian Pop/
comment:5 by , 12 years ago
Good to know
we move the bindings from the parameters into the equation section
I am sure this is not handled in the backend if the parameter keeps fixed=true.
comment:6 by , 12 years ago
For example the model Modelica.Electrical.Spice3.Examples.FourInverters has a binding for
mp1.c1
final parameter Mos1.Mos1Calc c1 = Mos.mosCalcInitEquations( p, C, vp, m) "Precalculated parameters";
but the binding is neither at the parameter (it is a record) nor in the equation section.
comment:8 by , 12 years ago
Cc: | added; removed |
---|
comment:9 by , 12 years ago
Ok. This seems a bit serious.
I'll have a look at it asap.
Cheers,
Adrian Pop/
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've seen this too in some cases. Is a bug.
In some cases even if you have a binding it seems it gives the message.
I'll look into this when time permits.
Cheers,
Adrian Pop/