#*
* EMSO template file for new equation flowsheets.
*
* The user should edit the contents of this file in order
* to develop a new flowsheet.
*
* $Id: flowsheet_eqs.mso 14 2006-08-26 20:15:39Z rafael $
*#
#*
* The using command makes available entities declared in another files.
*
* With this command the user can make use of the EML types
*#
using "types";
#*
* A new model is declared with the Model keyword and a name.
* A model can have several sections presented above:
*#
FlowSheet BB_react
#*
* In the PARAMETERS section we can define the constants of the
* model.
* A parameter will never be the result of the simulation its value
* need to be specified by the user.
*#
PARAMETERS
nz as Integer(Brief="Nnmber of differential component", Default=2);
ny as Integer(Brief="Number of algebraic", Default=1);
nu as Integer(Brief="number of control", Default=1);
ak01 as Real(Brief="reaction rate constant",Default=65.5 );
ak02 as Real(Brief="reaction rate constant",Default=1970 );
e1 as Real(Brief="reaction rate constant",Default=5027.7 );
e2 as Real(Brief="reaction rate constant",Default=8044.31 );
#*
* In the VARIABLE section we declare the variables of the model.
* The values of the variables will be calculated by the system
* in order to respect the model equations.
*#
VARIABLES
z as Real(Brief="concentration of component");
y as Real(Brief="Algebraic, the third component");
u as Real(Brief="Control", Default=700);
k as Real(Brief="reaction rate");
f as Real(Brief="residuals of constraint");
#*
* In the EQUATIONS section we declare equality expressions involving
* the any previously declared parameter or variable.
* The equations will be used to determine the value of the variables.
*#
EQUATIONS
k(1) = ak01*exp(-e1/u(1));
k(2) = ak02*exp(-e2/u(1));
f(1) = -k(1)*z(1) - diff(z(1));
f(2) = (k(1)*z(1)-k(2)*z(2)) - diff(z(2));
f(3) = z(1) + z(2) + y(1) - 1;
#*
* Additionally, in the case of dynamic models we can declare initial
* conditions exactly as in the EQUATIONS section.
* Equations declared on the INITIAL section will be used to determine
* the initial condition of dynamic models.
*#
INITIAL
z=[1,0];
OPTIONS
time = [0:100:180*60];
end