Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'P controller' topicStudent Support Forum > General > "P controller"

Help | Reply To Topic
Author Comment/Response
Phoenix
06/25/12 11:44am

Hi there! I need to write a program that evaluate the output flow from a tank when i change my setpoint value with a proportional controller. I wrote the following script but it doesn't work! Could u help me?

Clear["Global`*"];
A = 5;
cD = 0.8;
do = 0.15;
Ao = Pi*do^2/4;
Fi = 0.1;
Kc = -1;
hSS = (Fi/(Ao + cD))^2/(2*9.81);
FoSS = Fi;
tCambioSP = 10;
h = hSS;
Fo = FoSS;

F[t_] := {
If[t < 10, hSP = hSS, hSP = 2*hSS];
epsi = hSP - h;
Fo = FoSS + Kc*epsi;
h = h + (Fi - Fo)/A;
Fo}

Plot[F[c], {c, 0, 20}]

URL: ,
Help | Reply To Topic