| 1 | // name: strange_bug.mo
|
|---|
| 2 | // keywords: mixed nonlinear problem
|
|---|
| 3 | // status: incorrect
|
|---|
| 4 | //
|
|---|
| 5 | //
|
|---|
| 6 | function f
|
|---|
| 7 | input Real t;
|
|---|
| 8 | input Boolean i[2];
|
|---|
| 9 | output Boolean o[2];
|
|---|
| 10 | algorithm
|
|---|
| 11 | o := if t > 0.5 then {not i[1],not i[2]} else {true,true};
|
|---|
| 12 | end f;
|
|---|
| 13 |
|
|---|
| 14 | function fR
|
|---|
| 15 | input Real t;
|
|---|
| 16 | input Real i[2];
|
|---|
| 17 | output Real o[2];
|
|---|
| 18 | algorithm
|
|---|
| 19 | o := if t > 0.5 then {sin(t)*i[1],sin(t)*i[2]} else {1.0,2.0};
|
|---|
| 20 | end fR;
|
|---|
| 21 |
|
|---|
| 22 | model 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);
|
|---|
| 29 | end lastrange;
|
|---|