#1529 closed defect (fixed)
It should be possible to use non-fixed parameters as array indices
Reported by: | Martin Sjölund | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.4 |
Component: | Run-time | Version: | |
Keywords: | Cc: | Martin Sjölund, Per Östlund |
Description
model M parameter Integer p(fixed=false,min=1,max=1); Real r[1]; initial equation p = 1; equation r[p] = 2.0; end M;
[a.mo:7:3-7:13:writable] Error: Illegal subscript [p] for dimensions 1 in component <NO COMPONENT>
Also, have fun with:
model M parameter Integer p(fixed=false,min=1,max=1,start=1); Real r[1]; initial equation p = 15; equation r[p] = 2.0; end M;
Change History (5)
comment:1 by , 14 years ago
comment:2 by , 11 years ago
Component: | → Run-time |
---|---|
Milestone: | → Future |
Owner: | changed from | to
Status: | new → assigned |
These examples now fail initialization. The first one because p.start is used as an initial guess despite being outside the min/max interval. The second because it should :)
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Both models work as expected.
comment:4 by , 9 years ago
Milestone: | Future → pre1.9.4 |
---|
It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.
comment:5 by , 7 years ago
Milestone: | pre1.9.4 → 1.9.4 |
---|
Removing the pre1.9.4 milestone in favor of 1.9.4.
Note:
See TracTickets
for help on using tickets.
Non-fixed parameter subscripts are now no longer evaluated in r9075. It's still not possible to compile the model though, since it does not pass the backend.