- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Initializing issues in a control problem
Page Start Prev 1 Next End
Initializing issues in a control problem
Initializing issues in a control problem
Jul-25-17 11:02:56
I want to simulate a connected-tanks system where the level in tanks is controlled by PI controllers. The system starts off in a steady state which is not the set point. This is leading to initialization problems because at initialization, we want the inputs have arbitrary values not corresponding to the control law. Below is a minimal example of one tank.
Code:
model controlTest
parameter Real mu = 0.5;
parameter Real sp = 0.5;
parameter Real Kp = 0.01;
parameter Real Ti = 10;
parameter Real g = 9.81;
Real x(start = 1.0, fixed = true);
Real u(start = 2.215);
Real e;
Real eI(start = 0, fixed = true);
equation
der(x) = u - mu*sqrt(2*g*x);
e = -(x - sp);
der(eI) = e;
u = max(0, Kp*(e + eI/Ti));
annotation(
experiment(StartTime = 0, StopTime = 1000, Tolerance = 1e-06, Interval = 0.002));
end controlTest;
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Initializing issues in a control problem
There are 0 guests and 0 other users also viewing this topic