📄 studenter%
字号:
From erikmi@stud.unit.no Wed Dec 03 17:47:35 1997Return-Path: <erikmi@stud.unit.no>Delivered-To: skoge@chembio.ntnu.noReceived: (qmail 22238 invoked by alias); 3 Dec 1997 17:47:34 -0000Delivered-To: Sigurd.Skogestad@chembio.ntnu.noReceived: (qmail 22226 invoked from network); 3 Dec 1997 17:47:32 -0000Received: from biff.stud.ntnu.no (129.241.56.18) by senja.chembio.ntnu.no with SMTP; 3 Dec 1997 17:47:32 -0000Received: from ild.stud.ntnu.no (ild.stud.ntnu.no [129.241.56.15]) by biff.stud.ntnu.no (8.8.8/8.8.8) with ESMTP id SAA01773; Wed, 3 Dec 1997 18:47:32 +0100 (MET)Received: from ild.stud.ntnu.no (localhost [127.0.0.1]) by ild.stud.ntnu.no (8.8.8/8.8.8) with SMTP id SAA26906; Wed, 3 Dec 1997 18:47:32 +0100 (MET)Sender: erikmi@stud.ntnu.noMessage-ID: <34859B34.1034@stud.unit.no>Date: Wed, 03 Dec 1997 18:47:32 +0100From: Erik Mikkelsen <erikmi@stud.ntnu.no>X-Mailer: Mozilla 3.04 (X11; I; SunOS 5.5.1 sun4u)MIME-Version: 1.0To: Sigurd.Skogestad@chembio.ntnu.noCC: truls.larsson@chembio.ntnu.noSubject: Prosjekt (kolonne A) Hoest 1997Content-Type: multipart/mixed; boundary="------------6A2B37CFBAA"Status: RContent-Length: 19366This is a multi-part message in MIME format.--------------6A2B37CFBAAContent-Type: text/plain; charset=us-asciiContent-Transfer-Encoding: 7bitHei!Sender deg filene til kjoering av destillasjonskolonnen.HilsenErik M m.fl.--------------6A2B37CFBAAContent-Type: text/plain; charset=us-ascii; name="cola4p.m"Content-Transfer-Encoding: 7bitContent-Disposition: inline; filename="cola4p.m"function xprime=cola4p(t,X) % sample usage: [t,x]=ode15s('cola4p',[0 5000],Xinit);%% cola4p - Subroutine for simulation using MATLAB integration routine% It calls the distillation model colamodp %% SYNTAX: [t,x]=ode15s('cola4p',tspan,Xinit);%% tspan - [t_start,t_stop]% Xinit - column vector containing initial liquid composition% for stages 1-NT and initial liquid hold up for stages% 1-NT.%% Disturbances are feedrate, feed composition and feed liquid fraction% These are set by directly altering 'cola4p.m'.% Number of stages in columnNT=41;% Feed F = 1.0; % Feedrate (kmol/min)zF = 0.5; % Feed composition light comp.qF = 1.0; % Feed liquid fraction% Termodynamic data TBL= 272.65; % Boilingpoint light comp.(K)TBH= 309.25; % Boilingpoint heavy comp.(K)CpL=96; % Heatcapasity light comp. (kJ/kmol*K)CpH=121; % Heatcapasity heavy comp. (kJ/kmol*K)HvapL=19575; % Hvap for light comp. (kJ/kmol)HvapH=28350; % Hvap for heavy comp. (kJ/kmol)p0L=1.013e5; % Vapor pressure of pure light liquid comp.(Pa)p0H=1.013e5; % Vapor pressure of pure heavy liquid comp.(Pa)R=8.314; % Universal gasconstant (kJ/kmol*K)% Get actual valuesxD=X(NT);xB=X(1); % Actual composition in reboiler and condenserMB=X(NT+1); MD=X(2*NT); % Actual reboiler and condenser holdupTD=X(3*NT); % Actual temperature in reboiler% Calculates the right top pressure for cooling controlpL= p0L*exp(-HvapL/R*(1/TD-1/TBL));pH= p0H*exp(-HvapH/R*(1/TD-1/TBH));p = xD*pL + (1-xD)*pH;% P-Controllers for control of reboiler, condenser hold up and condenser cooling% SetpointsxDs=0.99; % Composition topxBs=0.01; % Composition bottomps=1.013e5; % Pressure in condenser (Pa)% Bias values and controller gainsKcB=7;KcD=7; KcP=10;KcXB=50;KcXD=33; % Controller gainsMDs=0.7; MBs=0.7; % Holdups D0=0.5; B0=0.5; % Flow (kmol/min)LT0=2.70629; VB0=3.20629; % Reflux and boilupVD0 = VB0; % Condensation heat(kJ/min)% P-ControllersD=D0+(MD-MDs)/MDs*KcD; % Distillate flowB=B0+(MB-MBs)/MBs*KcB; % Bottoms flow VD=VD0+((p-ps)/ps)*KcP; % PressureLT=LT0-(xD-xDs)/xDs*KcXD; % DestillatVB=VB0+(xB-xBs)/xBs*KcXB; % Bottoms % Store all inputs and disturbancesU(1)=LT; U(2)=VB; U(3)=D; U(4)=B; U(5)=VD; U(6)=F; U(7)=zF; U(8)=qF; U(9)=TBL;U(10)=TBH; U(11)=CpL; U(12)=CpH; U(13)=HvapL; U(14)=HvapH; U(15)=p0L; U(16)=p0H;U=U(:);xprime=colamodp(t,X,U);--------------6A2B37CFBAAContent-Type: text/plain; charset=us-ascii; name="colamodp.m"Content-Transfer-Encoding: 7bitContent-Disposition: inline; filename="colamodp.m"function xprime=colamodp(t,X,U) %% Written by S. Skogestad, L. Westskogen, E. Mikkelsen and S. Helland% November 1997%% colamodp - included pressure variations% This is a nonlinear model of a distillation column with% NT-1 theoretical stages including a reboiler (stage 1) plus a% total condenser ("stage" NT). The liquid flow dynamics are% modelled by a simple linear relationship.% Model assumptions: Two components (binary separation); constant% relative volatility; no vapor holdup; one feed and two products;% constant molar flows (same vapor flow on all stages); % total condenser%% The model is based on column A in Skogestad and Postlethwaite% (1996). The model has 3x41 states.%% Inputs: t - time in [min].% X - State, the first 41 states are compositions of light% component A with reboiler/bottom stage as X(1) and % condenser as X(41). State X(42)is holdup in reboiler/% bottom stage and X(82) is hold-up in condenser. % states x(83) and on are temperatures% U(1) - reflux L,% U(2) - boilup V,% U(3) - top or distillate product flow D,% U(4) - bottom product flow B,% U(5) - flow condensated, VD, % U(6) - feed rate F,% U(7) - feed composition light comp., zF.% U(8) - feed liquid fraction, qF.% U(9) - boilingpoint light comp. ,THL,% U(10)- boilingpoint heavy comp. ,TBH,% U(11)- Cp light comp., CpL,% U(12)- Cp heavy comp., CpH,% U(13)- Hvap for light comp., HvapL,% U(14)- Hvap for heavy comp., HvapH,% U(15)- Vapor pressure of pure light liquid comp., p0L,% U(16)- Vapor pressure of pure heavy liquid comp., p0H,%%% Outputs: xprime - vector with time derivative of all the states %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%------------------------------------------------------------% The following data need to be changed for a new column.% These data are for "column A".% Hvap and Cp given in cola4p.m are also data for "column A", and need to be changed.NT=41; % Number of stages (including reboiler and total condenser)NF=21; % Location of feed stage (stages are counted from the bottom)alpha=1.5; % Relative volatilityM0(1)=0.5; % Nominal reboiler holdup (kmol)i=2:NT-1; M0(i)=0.5*ones(1,NT-2); % Nominal stage (tray) holdups (kmol)M0(NT)=0.5; % Nominal condenser holdup (kmol)% Data for linearized liquid flow dynamics (does not apply to reboiler and condenser):R=8.314; % Universal gasconstant (kJ/kmol*K)taul=0.063; % Time constant for liquid dynamics (min)F0=1.0; % Nominal feed rate (kmol/min) qF0 = 1.0; % Nominal fraction of liquid in feed L0=2.70629; % Nominal reflux flow (from steady-state data)L0b=L0 + qF0*F0; % Nominal liquid flow below feed (kmol/min)lambda=0; % Effect of vapor flow on liquid flow ("K2-effect")V0=3.20629;V0t=V0+(1-qF0)*F0; % Nominal vapor flows - only needed if lambda is nonzero k=2.4288e-4; % Valve equation constant% End data which need to be changed%------------------------------------------------------------% Splitting the statesx=X(1:NT)'; % Liquid composition from btm to topM=X(NT+1:2*NT)'; % Liquid hold up from btm to topT=X(2*NT+1:3*NT)'; % Temperatures% Inputs and disturbancesLT = U(1); % RefluxVB = U(2); % BoilupD = U(3); % DistillateB = U(4); % BottomsVD = U(5); % Condensation heat and cooling F = U(6); % FeedratezF = U(7); % Feed composition light comp.qF = U(8); % Feed liquid fractionTBL = U(9); % Boilingpoint light comp.TBH = U(10); % Boilingpoint heavy comp.CpL = U(11); % Cp for light compCpH = U(12); % Cp for heavy compHvapL = U(13); % Hvap for light comp.HvapH = U(14); % Hvap for heavy comp. p0L = U(15); % Vapor pressure of pure light liquid comp.(Pa)p0H = U(16); % Vapor pressure of pure heavy liquid comp.(Pa)% Assume linearity between Havp, Cp and compositionCp = zF*CpL + (1-zF)*CpH; % Heatcapasity for feedHvap = zF*HvapL + (1-zF)*HvapH; % Heat of vaporization for feed% THE MODEL% Vapor-liquid equilibriai=1:NT-1; y(i)=alpha*x(i)./(1+(alpha-1)*x(i));% Vapor pressures of the two components (Clausius-Clapeyron)i=1:NT;pL(i)= p0L*exp(-HvapL/R*(1./T(i)-1/TBL));pH(i)= p0H*exp(-HvapH/R*(1./T(i)-1/TBH));% Stage Pressure (Raoults law)i=1:NT; p(i) = x(i).*pL(i) + (1-x(i)).*pH(i);% Vapor flows (valve equation)i=1:NT-1;if (p(i+1)-p(i))<0 V(i) = k*sqrt(p(i).^2-p(i+1).^2);else; V(i) =0.1*VB;end; % Liquid flows assuming linearized tray hydraulics with time constant taul% Also includes coefficient lambda for effect of vapor flow ("K2-effect").i=2:NF; L(i) = L0b + (M(i)-M0(i))./taul + lambda.*(V(i-1)-V0);i=NF+1:NT-1; L(i) = L0 + (M(i)-M0(i))./taul + lambda.*(V(i-1)-V0t);L(NT)=LT;% Time derivatives from material balances for % 1) total holdup % 2) component holdup% 3) enrgy holdup (temperature)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -