| 1 | package TestInit
|
|---|
| 2 | model Example1_1
|
|---|
| 3 | Real x;
|
|---|
| 4 | equation
|
|---|
| 5 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 6 | end Example1_1;
|
|---|
| 7 |
|
|---|
| 8 | model Example1_2
|
|---|
| 9 | Real x(start = 2);
|
|---|
| 10 | equation
|
|---|
| 11 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 12 | end Example1_2;
|
|---|
| 13 |
|
|---|
| 14 | model Example1_3
|
|---|
| 15 | Real x;
|
|---|
| 16 | equation
|
|---|
| 17 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 18 | initial equation
|
|---|
| 19 | x = 3;
|
|---|
| 20 | end Example1_3;
|
|---|
| 21 |
|
|---|
| 22 | model Example1_4
|
|---|
| 23 | Real x(start = 6);
|
|---|
| 24 | equation
|
|---|
| 25 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 26 | initial equation
|
|---|
| 27 | x = 3;
|
|---|
| 28 | end Example1_4;
|
|---|
| 29 |
|
|---|
| 30 | model Example2_1
|
|---|
| 31 | Real x;
|
|---|
| 32 | equation
|
|---|
| 33 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 34 | initial equation
|
|---|
| 35 | der(x) = 0;
|
|---|
| 36 | end Example2_1;
|
|---|
| 37 |
|
|---|
| 38 | model Example2_2
|
|---|
| 39 | Real x(start = 3);
|
|---|
| 40 | equation
|
|---|
| 41 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 42 | initial equation
|
|---|
| 43 | der(x) = 0;
|
|---|
| 44 | end Example2_2;
|
|---|
| 45 |
|
|---|
| 46 | model Example2_3
|
|---|
| 47 | Real x(fixed = false);
|
|---|
| 48 | equation
|
|---|
| 49 | der(x) = -x +1 + (if time > 5 then 1 else 0);
|
|---|
| 50 | initial equation
|
|---|
| 51 | der(x) = 0;
|
|---|
| 52 | end Example2_3;
|
|---|
| 53 |
|
|---|
| 54 | model Example3_1
|
|---|
| 55 | Real x(start = 0.5);
|
|---|
| 56 | equation
|
|---|
| 57 | der(x) = -sin(x) + 0.8;
|
|---|
| 58 | initial equation
|
|---|
| 59 | der(x) = 0;
|
|---|
| 60 | end Example3_1;
|
|---|
| 61 |
|
|---|
| 62 | model Example3_2
|
|---|
| 63 | Real x(start = 0.5, fixed = false);
|
|---|
| 64 | equation
|
|---|
| 65 | der(x) = -sin(x) + 0.8;
|
|---|
| 66 | initial equation
|
|---|
| 67 | der(x) = 0;
|
|---|
| 68 | end Example3_2;
|
|---|
| 69 |
|
|---|
| 70 | model Example4
|
|---|
| 71 | Real x(start = 3);
|
|---|
| 72 | Real y;
|
|---|
| 73 | Real z;
|
|---|
| 74 | equation
|
|---|
| 75 | der(x) = -x - y - z +1;
|
|---|
| 76 | y = x;
|
|---|
| 77 | z = x;
|
|---|
| 78 | end Example4;
|
|---|
| 79 |
|
|---|
| 80 | end TestInit;
|
|---|