Ticket #1583: array_bug.mo

File array_bug.mo, 628 bytes (added by jlettau, 13 years ago)
Line 
1// name: strange_bug.mo
2// keywords: mixed nonlinear problem
3// status: incorrect
4//
5//
6function f
7 input Real t;
8 input Boolean i[2];
9 output Boolean o[2];
10algorithm
11 o := if t > 0.5 then {not i[1],not i[2]} else {true,true};
12end f;
13
14function fR
15 input Real t;
16 input Real i[2];
17 output Real o[2];
18algorithm
19 o := if t > 0.5 then {sin(t)*i[1],sin(t)*i[2]} else {1.0,2.0};
20end fR;
21
22model lastrange
23 parameter Integer nIn = 2;
24 Real bh[nIn];
25 Real barr[nIn];
26 equation
27 barr = if sin(time)>0 then fR(0,bh) else fill(1.0,nIn);
28 bh = if sin(time)<0 then fR(time,barr) else fill(3.0,nIn);
29end lastrange;