Opened 8 years ago
Closed 8 years ago
#4116 closed defect (fixed)
Start values of states are hardly changeable
Reported by: | Rüdiger Franke | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.11.0 |
Component: | Backend | Version: | |
Keywords: | Cc: | Patrick Täuber |
Description (last modified by )
The attribute isValueChangeable
is true for state variables, even though Modelica insists in initial values, like in the following example:
model IsValueChangeable parameter Real x_start = 0; Real x(start = x_start, fixed = true); Real y; Real z; initial equation y = 0; equation der(x) = 1; der(y) = 1; der(z) = 1; end IsValueChangeable;
Doesn't this mean that start values of state variables are hardly ever changeable?
See also the level
states in Modelica.Fluid.Examples.Tanks.ThreeTanks
.
Change History (7)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
Cc: | added |
---|
comment:4 by , 8 years ago
That's certainly better than before. IsValueChangeable.x
is not changeable anymore, as well as the tank?.level states of the MSL ThreeTanks example!
Please have a look into IsValueChangeable_init.xml
though:
x
has isValueChangeable=false, useStart=true and no start valuey
andz
have isValueChangeable=true, useStart=false and no start value
How should this be interpreted?
comment:5 by , 8 years ago
There is always a start attribute according to the specification. So we should just ignore and probably remove the useStart
attribute from the xml file.
If I remember correctly, I have added the useStart
attribute for the old initialization a long time ago and it isn't used anymore. I will have a look.
comment:6 by , 8 years ago
I remembered correctly, and useStart
isn't used at all. I will remove it with OMCompiler#1187.
comment:7 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Looks good. OMEdit PR50 reverts the "hot fix" of the Variables Browser.
Here is the result of a naive test, setting isValueChangeable to false for states:
How can one detect if a state is iteration variable during initialization, i.e. really changeable?