Opened 9 years ago

Last modified 3 years ago

#3966 new defect

zero detection or array index error

Reported by: rahul.dutta.bits@… 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)

Table_online_change_test.mo (1.5 KB ) - added by anonymous 9 years ago.
test_ctrl.mo (1.4 KB ) - added by anonymous 9 years ago.

Download all attachments as: .zip

Change History (10)

by anonymous, 9 years ago

Attachment: Table_online_change_test.mo added

by anonymous, 9 years ago

Attachment: test_ctrl.mo added

comment:1 by Per Östlund, 9 years ago

Cc: Lennart Ochel Willi Braun added
Component: *unknown*Run-time

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.

comment:2 by Francesco Casella, 7 years ago

Milestone: 1.9.x1.13.0

Moved to 1.13, no need to put this in a maintenance release.

comment:3 by Martin Sjölund, 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:4 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:5 by Francesco Casella, 5 years ago

Milestone: 1.14.01.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:6 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:7 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:8 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.