The document describes a MATLAB program for modelling and simulation of a natural gas processing plant. It includes the code for solving a distillation column problem and generating 3D plots of the equipment in the plant layout for three different cases. Key equipment like heat exchangers, heaters, and coolers are represented in the 3D plots along with their coordinates and specifications are provided in the code.
62. Distillation column
% MATLAB Program for solving Distillation Program
A=[0.07 0.18 0.15 0.24
0.04 0.24 0.10 0.65
0.54 0.42 0.54 0.10
0.35 0.16 0.21 0.01]
f = [0.15*70 0.25*70 0.40*70 0.2*70]
disp('Solutions for D1 B1 D2 B2 is:')
X=Af'
D1=X(1)
B1=X(2)
D2=X(3)
B2=X(4)
disp {'Solve for column 2'}
D=D1+B1%43.75 MOL/MIN
XDx=(0.07*D1+0.18*B1)/D %0.114 mole fraction
XDs=(0.04*D1+0.24*B1)/D %0.120 mole fraction
XDt=(0.54*D1+0.42*B1)/D %0.492 mole fraction
XDb=(0.35*D1+0.16*B1)/D %0.274 mole fraction
%The mole fraction for column 3 are solved for directly
by evaluating
%Equation
D2=X(3)
B2=X(4)
disp('Solve for colum 3')
B=D2+B2 %26.25 mol/min
XBx=(0.15*D2+0.24*B2)/B %0.2100 mole fraction
XBs=(0.10*D2+0.65*B2)/B %0.4667 mole fraction
XBt=(0.54*D2+0.10*B2)/B %0.2467 mole fraction
XBb=(0.21*D2+0.01*B2)/B %0.0767 mole fraction
63. Result
dist
0.0700 0.1800 0.1500 0.2400
0.0400 0.2400 0.1000 0.6500
0.5400 0.4200 0.5400 0.1000
0.3500 0.1600 0.2100 0.0100
A =
f = 10.5000 17.5000 28.0000 14.0000
Solutions for D1 B1 D2 B2 is:
X = 26.2500, 17.5000, 8.7500, 17.5000
D1 = 26.2500; B1 = 17.5000; D2 = 8.7500; B2 = 17.5000
{'Solve for column 2'}
D = 43.7500; XDx = 0.1140; XDs = 0.1200; XDt = 0.4920; XDb = 0.2740; D2 = 8.7500
B2 = 17.5000
Solve for colum 3
B = 26.2500; XBx = 0.2100; XBs = 0.4667; XBt = 0.2467; XBb = 0.0767
64. HEAT EXCHANGER
% Figure(1) refers to Case 1
% Figure(2) refers to Case 2
% Figure(3) refers to Case 3
% Click "Run and Advance" to generate the Matlab 3D co-ordinates for all 3
% cases.
% Click "Run" wouldl only generate Figure(1).
% The utility source is taken to be in the middle of the plant.
% The values [0.5 0.5 0.5] and [0.9290 0.6940 0.1250] are RGB colours for
% grey (heat exchangers) and yellow-orange (other equipment) as Matlab does
% not have a pre-built value for them.
% The vectors are sometimes given a +0.2 or -0.2 to indicate the
% approximate suggested coordinates for the new heaters/heat exchangers to
% be installed (+0.2 or -0.2 from a nearby existing equipment in line with
% the stream).
%HE33E061
x1 = 2.9400;
y1 = 2.9620;
z1 = 0.1560;
%HE31E01
x2 = 4.2300;
y2 = 0.1500;
z2 = 1.1900;
%HE31E02
x3 = 5.3000;
y3 = 0.1600;
z3 = 0.4600;
%HE31E03 (G - heater)
x4 = 4.7800;
y4 = 1.4332;
z4 = 2.6200;
%HE31E04
x5 = 5.5300;
y5 = 0.3800;
z5 = 1.4450;
190. Hetran - (to simulate an heat exchanger), The B-JAC input file name that contains the heat exchanger specification., The Aerotran
block is the interface to the B-JAC Aerotran program for designing and simulating air-cooled heat exchangers