% This file contain the data for the case
clear all
global coldata dyndata
coldata.Nt=8; % Number of trays in each section
coldata.alfa=[9 3 1]; % Relative volality
coldata.M0=1; % Holdup reboil and condense
coldata.yset=[0.97;0.97;0.97];
coldata.d0=[1;1/3;1/3;1.0;coldata.yset]; % Nominal disturbance
coldata.Tboil=[300;342.85;400];
coldata.P=1;%Pressure
% Genererer indeksmatrisen til reg.var.
[coldata.R,coldata.Rx]=genc_var(1);
% Data for the dynamic simulations
load Xineq
xnom=xineq;
unom=u_ineq; %u=[L,V,S,Rl,Rv,F,z(1),z(2),q,D,B]
unom(10)=unom(2)-unom(1);
unom(11)=unom(6)-unom(3)-unom(10);
clear xineq u_ineq
% States + holdup
M0=coldata.M0;
M0W=0.5*coldata.M0;		%main column, along wall
M0P=0.5*coldata.M0;		%prefractionator
M0R=20*coldata.M0;		%reboiler holdup
M0T=20*coldata.M0;		%Top accumulator holdup
M0L=coldata.M0;			%liquid split accumulator
M0S=coldata.M0;			%side product accumulator
holdup=[ones(coldata.Nt,1)*M0P;ones(coldata.Nt,1)*M0P;ones(coldata.Nt,1)*M0;ones(coldata.Nt,1)*M0W;ones(coldata.Nt,1)*M0W;ones(coldata.Nt,1)*M0;M0R;M0T;M0L;M0S];
xnom=[xnom;holdup];
dyndata.L0=unom(1);
dyndata.V0=unom(2);
dyndata.S0=unom(3);
dyndata.Rl0=unom(4);
dyndata.Rv0=unom(5);
dyndata.F0=unom(6);
dyndata.zF=unom(7:8);
dyndata.q=unom(9);
dyndata.D=unom(10);
dyndata.B=unom(11);
dyndata.yset=[0.97 0.97 0.97];
dyndata.yselect=3; % States
%Get states, and calculate Antoine coeff.
[xp]=genpet([],xnom,unom,3,coldata.Nt,coldata.alfa,coldata.M0,dyndata.yselect,[]); %ynom=[xA,xB,xC,T1..T48]
[Temp,coeff]=temp_antoine(xp);%Based on Antoines eq.
coldata.A=coeff(1);
coldata.B=coeff(2);
coldata.C=coeff(3);
% Get all nominal measruements
dyndata.yselect=2; % Compositions and temperatures
[ynom]=genpet([],xnom,unom,3,coldata.Nt,coldata.alfa,coldata.M0,dyndata.yselect,[]); %ynom=[xA,xB,xC,T1..T48]
clear unom xnom Temp coeff M0 M0W M0P M0R M0T M0L M0S holdup %xp
% Tuningsparametre
tauct=10*1;
taucm=10*1;
