Opened 8 years ago
Last modified 3 years ago
#3966 new defect
zero detection or array index error
Reported by: | Owned by: | somebody | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Run-time | Version: | v1.9.4-v1.9.x |
Keywords: | Cc: | Lennart Ochel, Willi Braun |
Description
I needed a table which can be modified runtime. I have implemented the table with the x indices (x1) as parameters and the y indices (y1) as variables that can be changed during the simulation. The table is setup as a linear interpolation between index pair and 'hold' last value for out of range input. Input is variable u and output is y. Although the code in not very elegant, it runs correctly with a constant input for u but fails for a time varying input like a input form timetable or step input. I am not able to understand where the error (assert | error | <p>Dimension 1 has bounds 1..5, got array subscript 0</p>) is coming form. I am guessing it has to do with the index but not able to figure out from which one.
attaching the simulation files.
Attachments (2)
Change History (10)
by , 8 years ago
Attachment: | Table_online_change_test.mo added |
---|
by , 8 years ago
Attachment: | test_ctrl.mo added |
---|
comment:1 by , 8 years ago
Cc: | added |
---|---|
Component: | *unknown* → Run-time |
comment:2 by , 7 years ago
Milestone: | 1.9.x → 1.13.0 |
---|
Moved to 1.13, no need to put this in a maintenance release.
comment:3 by , 7 years ago
The problematic relation is:
table_online_change_test1.x1[-1 + 1] <= table_online_change_test1.u
Which will never be referenced in the code, but we do generate a zero-crossing for... I suppose we would need to have a try/catch block for these zero-crossings to be able to store a "failed" flag for them. The best work-around would probably be to mark the relations with noEvent.
We could also have a better analysis of which relations are actually possible to reach. It would be a bit slower since we would need to unroll each for-loop. Or a lot more complicated to analyze the if-conditions when we send in sets of iterator variables.
comment:5 by , 5 years ago
Milestone: | 1.14.0 → 1.16.0 |
---|
Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0
comment:7 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
The issue seems to be in the runtime, and I can't see any reason why the model shouldn't work. It would be good if the error message could be a bit more helpful.