Ticket #1983: ParameterBug.mo

File ParameterBug.mo, 626 bytes (added by Christian Schubert, 12 years ago)
Line 
1within ;
2model ParameterBug
3 parameter Integer mode = 1;
4 parameter Integer n = if mode == 1 then 0 else 1;
5 parameter Real c[n](each fixed = false);
6 parameter Real a[n](each fixed = false);
7 parameter Real r[2](each fixed = false);
8 Real x(start = 1, fixed = true);
9initial equation
10 if (mode == 1) then
11 c = fill(0.0, 0);
12 else
13 c = fill(0.0, n);
14 end if;
15
16 if (mode == 1) then
17 a = c;
18 r = fill(1.0, 2);
19 else
20 a = fill(0.0, 0);
21 r = {1,2};
22 end if;
23equation
24 der(x) = r[1]*x;
25 annotation (uses(Modelica(version="3.2")));
26end ParameterBug;