Opened 12 years ago
Closed 7 years ago
#1853 closed defect (fixed)
reinit does not handle arrays
Reported by: | Adeel Asghar | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | critical | Milestone: | 1.13.0 |
Component: | Frontend | Version: | trunk |
Keywords: | Cc: | Per Östlund, Martin Sjölund |
Description (last modified by )
Passing an array to reinit
(or change
) raises the "wrong arguments error".
Change History (17)
comment:1 by , 12 years ago
Summary: | reinit does not handle arrays → reinit and change does not handle arrays |
---|
comment:2 by , 12 years ago
Description: | modified (diff) |
---|
comment:3 by , 12 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
follow-up: 6 comment:4 by , 12 years ago
comment:5 by , 12 years ago
Description: | modified (diff) |
---|---|
Summary: | reinit and change does not handle arrays → reinit does not handle arrays |
comment:6 by , 12 years ago
Replying to sjoelund.se:
I'm pretty sure you cannot vectorize
change
, because<>
does not work on vectors.
reinit
I guess should be allowed. What models uses this?
reinit
is used in,
Modelica.Mechanics.Translational.Components.MassWithStopAndFriction
Modelica.Blocks.Math.Mean
However, the above models are not using arrays with it.
Dymola allows arrays with change
. Perhaps instead of using vectors in the code behind we can expand it something like this,
Code highlighting:
change(arr) => (change(arr[1]) or change(arr[2]) or change(arr[3]))
Upto whatever the length of the array!!!!
comment:7 by , 11 years ago
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:8 by , 10 years ago
Milestone: | 2.0.0 → 1.9.1 |
---|---|
Version: | → trunk |
comment:9 by , 10 years ago
Milestone: | 1.9.1 → 1.9.2 |
---|
This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).
comment:10 by , 10 years ago
Milestone: | 1.9.2 → 1.9.3 |
---|
Milestone changed to 1.9.3 since 1.9.2 was released.
comment:12 by , 9 years ago
Priority: | blocker → critical |
---|
comment:16 by , 8 years ago
Milestone: | 1.11.0 → 1.12.0 |
---|
Milestone moved to 1.12.0 due to 1.11.0 already being released.
comment:17 by , 7 years ago
Milestone: | 1.12.0 → 1.13.0 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
The following model
model M Real x[2]; equation der(x[1]) = 1; der(x[2]) = 2; when (x[1]>0.2) then reinit(x, {0,0}); end when; end M;
works fine in v1.13.0-dev-155-g68350e9, both with old and new front-end
I'm pretty sure you cannot vectorize
change
, because<>
does not work on vectors.reinit
I guess should be allowed. What models uses this?