1 | model 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);
|
---|
8 | initial equation
|
---|
9 | preferredStatesUnfixed = true;
|
---|
10 | preferredStatesUnfixedStart = false;
|
---|
11 | equation
|
---|
12 | der(z) = time;
|
---|
13 | 0 = x^2 + y^2 + z^2;
|
---|
14 | y = x + z;
|
---|
15 | end StateSelectCheck;
|
---|