- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Changing boolean during simulation
Changing boolean during simulation
Changing boolean during simulation
Hi,
I'm working on a model that utilizes a valve from Modelon. Using a controller it is open about 30-40%, and theres comes a point I need it be fully open and not be controlled anymore.
The valve has a boolean parameter fixedOpening, followed by a real paramter opening_fixed.
What I tried to do is implement a when statement
when (time>100) then
valve.fixedOpening:= true;
valve.opening_fixed=1;
end when;
as a result, I have 2 more equations than unknowns and also get the error:
Illegal left hand side in the when equation
when (time>100) then
true=false;
end when;
Is it possible to change a boolean during simulation? Or is there a different way to approach this?
Thanks for the help!
Re: Changing boolean during simulation
You can change Boolean variables during simulation, but not Boolean parameters.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Changing boolean during simulation