Write a function PI_Cont that models the PI Controller. The function should take as input the current state of the system , calculate a control signal s, and return it as output.
Test your function at the initial conditions.
function s=PI_Cont(y)
% implement the PI controller function
Kb=0.0;
Kc=9.0;
KI=0.18;
Cb_SP=0.32;
Cb=y(2);
Ierr=y(4);
s=Kb+Kc*(Cb_SP-Cb)+KI*Ierr;
end
Part (b)
Write a function getf that evaluates the right-hand side function of this ODE-IVP system at the current state and control signal s.
Test your funciton at the initial conditions.