using "types";
FlowSheet cstr_dae
PARAMETERS
esc as Real;
fi as Real;
beta as Real;
delta as Real;
q as Real;
alfa as Real;
S as Real;
csi as Real;
delta1 as Real;
delta2 as Real;
gama as Real;
x1f as Real;
x2f as Real;
x3f as Real;
x4f as Real;
qc as Real;
VARIABLES
u1 as Real;
u2 as Real;
u3 as Real;
u4 as Real;
u5 as Real;
u6 as Real;
SET
fi = 0.133;
beta = 8;
delta = 1;
q = 1;
alfa = 1;
S = 0.01;
csi = 1;
delta1 = 10;
delta2 = 1;
gama = 1000;
x1f = 1;
x2f = 0;
x3f = 0;
x4f = -1;
qc = 0;
esc = 1e6;
EQUATIONS
q*(x1f-u1)-u1*u5*esc*fi - diff(u1)*'s' = 0;
q*(x2f-u2)-u2*fi*S*u6*esc+u1*fi*u5*esc - diff(u2)*'s' = 0;
q*(x3f-u3)+delta*(u4-u3)+beta*fi*(u1*u5*esc+alfa*u2*u6*esc*S) - diff(u3)*'s' = 0;
delta1*(qc*(x4f-u4)+delta*delta2*(u3-u4)) - diff(u4)*'s' = 0;
-u5*esc + exp(u3/(1+(u3/gama))) = 0;
-u6*esc + exp(csi*u3/(1+(u3/gama))) = 0;
GUESS
u1 = 0;
u2 = 0;
u3 = 16;
u4 = 16;
u5 = 3;
u6 = 3;
INITIAL
u1 = 0.6;
u2 = 0.3;
u3 = 3;
u4 = 3;
OPTIONS
TimeEnd = 10;
TimeStep = 0.2;
Dynamic = false;
end