Ticket #1991: StateSelectCheck.mo

File StateSelectCheck.mo, 673 bytes (added by Jens Frenkel, 12 years ago)
Line 
1model StateSelectCheck
2 parameter Boolean preferredStates=true;
3 parameter Boolean preferredStatesUnfixed(fixed=false);
4 parameter Boolean preferredStatesUnfixedStart(fixed=false,start=true);
5 Real x(stateSelect = if preferredStates then StateSelect.prefer else StateSelect.avoid);
6 Real y(stateSelect = if preferredStatesUnfixed then StateSelect.prefer else StateSelect.avoid);
7 Real z(stateSelect = if preferredStatesUnfixedStart then StateSelect.prefer else StateSelect.avoid);
8initial equation
9 preferredStatesUnfixed = true;
10 preferredStatesUnfixedStart = false;
11equation
12 der(z) = time;
13 0 = x^2 + y^2 + z^2;
14 y = x + z;
15end StateSelectCheck;