You are on page 1of 20

Laboratory Exercise No.

6
Steady-state Material Balances on a Separation Train

1. Objective:
The activity aims to solve a chemical engineering problem dealing with steady-state material balances
on a separation train using matlab.

2. Intended Learning Outcomes (ILOs):

The students shall be able to:


2.1 solve problem involving steady-state material balances on a separation train.

3. Discussion :
A mass balance, also called a material balance, is an application of conservation of mass to the analysis
of physical systems. By accounting for material entering and leaving a system, mass flows can be
identified which might have been unknown, or difficult to measure without this technique. The exact law
used in the analysis of the system depends on the context of the problem, but all revolve around mass
conservation, i.e. that matter cannot disappear or be created spontaneously.

Therefore, mass balances are used widely in engineering and environmental analyses. For example,
mass balance theory is used to design chemical reactors, to analyze alternative processes to produce
chemicals, as well as to model pollution dispersion and other processes of physical systems. Closely
related and complementary analysis techniques include the population balance, energy balance and the
somewhat more complex entropy balance. These techniques are required for thorough design and
analysis of systems such as the refrigeration cycle.

4. Resources:
Matlab

5. Procedure:
1. For the four equations four unknowns as shown below :
2w + 5x - 3y - 4z = 9
-3w - 2x +4y - 5z = 23
2w + 5x + 3y - 6z = 39
w + 5x + 4y - 2z = 29
a. Obtain the four by four matrix of the LHS of the system of equations and assign it to variable A.
Run it in the matlab command window. Show the results.
b. Obtain the one by four matrix of the RHS of the system of equations and assign it to variable
B. Run it in the matlab command window. Show the results.
c. Using the command A\B and assign to it to variable w, x, y and z values. Run it in the matlab
command window. Show the results.
d. Create an m-file for the solution of the system of equations. Run it and show the results.
e. Create an m-file using disp( ), input( ), and fprintf( ) commands. Run it and show the results.
2. Provide a unique system of equations, ten equations in ten unknowns and answer the following:
a. Obtain the ten by ten matrix of the LHS of the system of equations and assign it to variable A.
Run it in the matlab command window. Show the results.
b. Obtain the one by ten matrix of the RHS of the system of equations and assign it to variable B.
Run it in the maltlab command window. Show the results.
c. Using the command A\B and assign it to ten distinct variables. Run it in matlab command
window. Show the results.
d. Create an m-file for the solution of the system of equations. Run it and show the results.
e. Create an m-file using disp( ), input( ), and fprintf( ) commands. Run it and show the results.
3. In this problem, we are separating paraxylene, styrene, toluene and benzene via continuous
distillation in three columns.  Continuous distillation is typically a steady-state process as the
‘lighter’ components (lower boiling temperatures at the operating pressure) will collect overhead
and the ‘heavier’ will collect in the bottoms.  Depending on what your purity specifications are will
then determine how you want to operate your equipment.  A schematic with the problem details is
shown below:

a. Using 1 minute of operation, obtain the system of equations, four equations in four unknowns,
involving material balances of xylene, styrene, toluene, and benzene.
b. Obtain the four by four matrix of the resulting system of equations in 3a and assign it to variable A.
Run it in the matlab command window. Show the results.
c. Obtain the one by four matrix of the resulting system of equations in 3a and assign it to variable B.
Run it in the matlab command window. Show the results.
d. Using the command A\B, assign it to four distinct variables representing the molar flow rates of
D_1, B_1, D_2, and B_2. Run it in the matlab command window. Show the results.
e. Create an m-file for the solution of system of equations in 3a. Run it and show the results.
f. Create an m-file using disp( ), input( ) and fprintf( ) matlab commands. Run it and show the results.

4. For the illustration as shown below,

a. Using Column #2, provide for the matlab command that will determine the flowrate of stream D.
Run it in the matlab command window. Show the results.

b. Provide for matlab commands that will determine the mole fraction of xylene, styrene, toluene,
and benzene in stream D. Run them in the command window. Show the results.
c. Create an m-file that will provide solutions in 4a and 4b. Run it and show the results.
d. Create an m-file using disp( ), input( ) and fprint( ) matlab commands that will provide solutions
in 4a and 4b. Run it and show the results.
5. Using Figure1,
a. Using Column #2, provide for the matlab command that will determine the flowrate of stream B.
Run it in the matlab command window. Show the results
b. Provide matlab commands that will determine the mole fraction of xylene, styrene, toluene, and
benzene in stream B. Run them in the command window. Show the results.
c. Create an m-file that will provide solutions in 5a and 5b. Run it and show the results.
d. Create an m-file using disp( ), input( ), and fprint( ) matlab commands that will provide solutions
in 5a and 5b. Run it and show the results.

Course: CHE 508 Laboratory Exercise No.: 6


Group No.: Section: CH51FC2
Group Members: Date Performed: February 1, 2020
Montesa, Shania Angel M. Date Submitted: February 15, 2020
Instructor: Engr. Crispulo Maranan

6. Data and Results:

Procedure Results
1a >> A = [2 5 -3 -4; -3 -2 4 -5; 2 5 3 -6; 1 5 4 -2]

A=
2 5 -3 -4
-3 -2 4 -5
2 5 3 -6
1 5 4 -2

1b >> B = [9; 23; 39; 29]

B=

9
23
39
29

1c >> soln = A\B

soln =

2.0000
1.0000
4.0000
-3.0000

>> w = soln(1)

w=

2.0000

>> x = soln(2)

x=

1.0000

>> y = soln(3)

y=

>> z = soln(4)

z=
-3.0000

1d A = [2 5 -3 -4; -3 -2 4 -5; 2 5 3 -6; 1 5 4 -2];


B = [9; 23; 39; 29];
soln = A\B;
w = soln(1)
x = soln(2)
y = soln(3)
z = soln(4)

>> le06_p1d

w=

2.0000

x=

1.0000

y=

z=

-3.0000

1e disp('System of 4 Equations Solver');


A = input('Enter matrix of coefficients: ');
B = input('Enter matrix of constants: ');
soln = A\B;
fprintf('w = %f \n', soln(1))
fprintf('x = %f \n', soln(2))
fprintf('y = %f \n', soln(3))
fprintf('z = %f \n', soln(4))

>> le06_p1e
System of 4 Equations Solver
Enter matrix of coefficients: [2 5 -3 -4; -3 -2 4 -5; 2 5 3 -6; 1 5 4 -2]
Enter matrix of constants: [9; 23; 39; 29]
w = 2.000000
x = 1.000000
y = 4.000000
z = -3.000000

2a >> A = rand(10)

A=

Columns 1 through 8

0.8147 0.1576 0.6557 0.7060 0.4387 0.2760 0.7513 0.8407


0.9058 0.9706 0.0357 0.0318 0.3816 0.6797 0.2551 0.2543
0.1270 0.9572 0.8491 0.2769 0.7655 0.6551 0.5060 0.8143
0.9134 0.4854 0.9340 0.0462 0.7952 0.1626 0.6991 0.2435
0.6324 0.8003 0.6787 0.0971 0.1869 0.1190 0.8909 0.9293
0.0975 0.1419 0.7577 0.8235 0.4898 0.4984 0.9593 0.3500
0.2785 0.4218 0.7431 0.6948 0.4456 0.9597 0.5472 0.1966
0.5469 0.9157 0.3922 0.3171 0.6463 0.3404 0.1386 0.2511
0.9575 0.7922 0.6555 0.9502 0.7094 0.5853 0.1493 0.6160
0.9649 0.9595 0.1712 0.0344 0.7547 0.2238 0.2575 0.4733

Columns 9 through 10

0.3517 0.0759
0.8308 0.0540
0.5853 0.5308
0.5497 0.7792
0.9172 0.9340
0.2858 0.1299
0.7572 0.5688
0.7537 0.4694
0.3804 0.0119
0.5678 0.3371

2b >> B = rand(10,1)

B=

0.1622
0.7943
0.3112
0.5285
0.1656
0.6020
0.2630
0.6541
0.6892
0.7482

2c >> soln = A\B

soln =

0.1549
1.1242
-0.1112
0.3506
0.1600
-0.2884
0.7694
-0.8864
-0.3121
-0.3871

>> a = soln(1)

a=

0.1549

>> b = soln(2)

b=

1.1242

>> c = soln(3)

c=

-0.1112

>> d = soln(4)

d=

0.3506

>> e = soln(5)

e=

0.1600
>> f = soln(6)

f=

-0.2884

>> g = soln(7)

g=

0.7694

>> h = soln(8)

h=

-0.8864

>> i = soln(9)

i=

-0.3121

>> j = soln(10)

j=

-0.3871

2d A = [0.8147 0.1576 0.6557 0.7060 0.4387 0.2760 0.7513 0.8407


0.3517 0.0759
0.9058 0.9706 0.0357 0.0318 0.3816 0.6797 0.2551 0.2543
0.8308 0.0540
0.1270 0.9572 0.8491 0.2769 0.7655 0.6551 0.5060 0.8143
0.5853 0.5308
0.9134 0.4854 0.9340 0.0462 0.7952 0.1626 0.6991 0.2435
0.5497 0.7792
0.6324 0.8003 0.6787 0.0971 0.1869 0.1190 0.8909 0.9293
0.9172 0.9340
0.0975 0.1419 0.7577 0.8235 0.4898 0.4984 0.9593 0.3500
0.2858 0.1299
0.2785 0.4218 0.7431 0.6948 0.4456 0.9597 0.5472 0.1966
0.7572 0.5688
0.5469 0.9157 0.3922 0.3171 0.6463 0.3404 0.1386 0.2511
0.7537 0.4694
0.9575 0.7922 0.6555 0.9502 0.7094 0.5853 0.1493 0.6160
0.3804 0.0119
0.9649 0.9595 0.1712 0.0344 0.7547 0.2238 0.2575 0.4733
0.5678 0.3371];
B = [0.1622
0.7943
0.3112
0.5285
0.1656
0.6020
0.2630
0.6541
0.6892
0.7482];
soln = A\B;
a = soln(1)
b = soln(2)
c = soln(3)
d = soln(4)
e = soln(5)
f = soln(6)
g = soln(7)
h = soln(8)
i = soln(9)
j = soln(10)

>> le06_p2d

a=

0.1547

b=

1.1239

c=

-0.1115

d=
0.3507

e=

0.1603

f=

-0.2886

g=

0.7693

h=

-0.8863

i=

-0.3116

j=

-0.3872

2e disp('System of 10 Equations Solver');


A = input('Enter matrix of coefficients: ');
B = input('Enter matrix of constants: ');
soln = A\B;
fprintf('a = %f \n', soln(1))
fprintf('b = %f \n', soln(2))
fprintf('c = %f \n', soln(3))
fprintf('d = %f \n', soln(4))
fprintf('e = %f \n', soln(5))
fprintf('f = %f \n', soln(6))
fprintf('g = %f \n', soln(7))
fprintf('h = %f \n', soln(8))
fprintf('i = %f \n', soln(9))
fprintf('j = %f \n', soln(10))
>> le06_p2e
System of 10 Equations Solver
Enter matrix of coefficients: [0.8147 0.1576 0.6557 0.7060 0.4387 0.2760
0.7513 0.8407 0.3517 0.0759
0.9058 0.9706 0.0357 0.0318 0.3816 0.6797 0.2551 0.2543
0.8308 0.0540
0.1270 0.9572 0.8491 0.2769 0.7655 0.6551 0.5060 0.8143
0.5853 0.5308
0.9134 0.4854 0.9340 0.0462 0.7952 0.1626 0.6991 0.2435
0.5497 0.7792
0.6324 0.8003 0.6787 0.0971 0.1869 0.1190 0.8909 0.9293
0.9172 0.9340
0.0975 0.1419 0.7577 0.8235 0.4898 0.4984 0.9593 0.3500
0.2858 0.1299
0.2785 0.4218 0.7431 0.6948 0.4456 0.9597 0.5472 0.1966
0.7572 0.5688
0.5469 0.9157 0.3922 0.3171 0.6463 0.3404 0.1386 0.2511
0.7537 0.4694
0.9575 0.7922 0.6555 0.9502 0.7094 0.5853 0.1493 0.6160
0.3804 0.0119
0.9649 0.9595 0.1712 0.0344 0.7547 0.2238 0.2575 0.4733
0.5678 0.3371]
Enter matrix of constants: [0.1622
0.7943
0.3112
0.5285
0.1656
0.6020
0.2630
0.6541
0.6892
0.7482]
a = 0.154722
b = 1.123915
c = -0.111481
d = 0.350676
e = 0.160277
f = -0.288552
g = 0.769304
h = -0.886329
i = -0.311592
j = -0.387192

3a 0.07D1 + 0.18B1 + 0.15D2 + 0.24B2 = 10.5


0.04D1 + 0.24B1 + 0.10D2 + 0.65B2 = 17.5
0.54D1 + 0.42B1 + 0.54D2 + 0.10B2 = 28
0.35D1 + 0.16B1 + 0.21D2 + 0.01B2 = 14

3b >> 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]

A=

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

3c >> B = 70*[0.15; 0.25; 0.40; 0.20]

B=

10.5000
17.5000
28.0000
14.0000

3d >> soln = A\B

soln =

26.2500
17.5000
8.7500
17.5000

>> D1 = soln(1)

D1 =

26.2500

>> B1 = soln(2)

B1 =

17.5000

>> D2 = soln(3)

D2 =
8.7500

>> B2 = soln(4)

B2 =

17.5000

3e 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];
B = 70*[0.15; 0.25; 0.40; 0.20];
soln = A\B;
D1 = soln(1)
B1 = soln(2)
D2 = soln(3)
B2 = soln(4)

>> le06_p3e

D1 =

26.2500

B1 =

17.5000

D2 =

8.7500

B2 =

17.5000

3f disp('Separation Train Solver');


A = input('Enter matrix of coefficients: ');
B = input('Enter matrix of constants: ');
soln = A\B;
fprintf('D1 = %f \n', soln(1))
fprintf('B1 = %f \n', soln(2))
fprintf('D2 = %f \n', soln(3))
fprintf('B2 = %f \n', soln(4))

>> le06_p3f
Separation Train Solver
Enter matrix of coefficients: [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]
Enter matrix of constants: 70*[0.15; 0.25; 0.40; 0.20]
D1 = 26.250000
B1 = 17.500000
D2 = 8.750000
B2 = 17.500000

4a >> 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];
>> B = 70*[0.15; 0.25; 0.40; 0.20];
>> soln = A\B;
>> D1 = soln(1);
>> B1 = soln(2);
>> D2 = soln(3);
>> B2 = soln(4);
>> D = D1 + B1

D=

43.7500

4b >> 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];
>> B = 70*[0.15; 0.25; 0.40; 0.20];
>> soln = A\B;
>> D1 = soln(1);
>> B1 = soln(2);
>> D2 = soln(3);
>> B2 = soln(4);
>> D = D1 + B1;
>> x_xylene = (0.07*D1 + 0.18*B1)/D

x_xylene =

0.1140

>> x_styrene = (0.04*D1 + 0.24*B1)/D

x_styrene =

0.1200
>> x_toluene = (0.54*D1 + 0.42*B1)/D

x_toluene =

0.4920

>> x_benzene = (0.35*D1 + 0.16*B1)/D

x_benzene =

0.2740

4c 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];
B = 70*[0.15; 0.25; 0.40; 0.20];
soln = A\B;
D1 = soln(1);
B1 = soln(2);
D2 = soln(3);
B2 = soln(4);
D = D1 + B1
x_xylene = (0.07*D1 + 0.18*B1)/D
x_styrene = (0.04*D1 + 0.24*B1)/D
x_toluene = (0.54*D1 + 0.42*B1)/D
x_benzene = (0.35*D1 + 0.16*B1)/D

>> le06_p4c

D=

43.7500

x_xylene =

0.1140

x_styrene =

0.1200

x_toluene =
0.4920

x_benzene =

0.2740

4d disp('Separation Train Solver: Column 2');


A = input('Enter matrix of coefficients: ');
B = input('Enter matrix of constants: ');
soln = A\B;
D1 = soln(1);
B1 = soln(2);
D2 = soln(3);
B2 = soln(4);
D = D1 + B1;
x_xylene = (A(1,1)*D1 + A(1,2)*B1)/D;
x_styrene = (A(2,1)*D1 + A(2,2)*B1)/D;
x_toluene = (A(3,1)*D1 + A(3,2)*B1)/D;
x_benzene = (A(4,1)*D1 + A(4,2)*B1)/D;
fprintf('D = %f \n',D)
fprintf('x_xylene = %f \n', x_xylene)
fprintf('x_styrene = %f \n', x_styrene)
fprintf('x_toluene = %f \n', x_toluene)
fprintf('x_benzene = %f \n', x_benzene)

>> le06_p4d
Separation Train Solver: Column 2
Enter matrix of coefficients: [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]
Enter matrix of constants: 70*[0.15; 0.25; 0.40; 0.20]
D = 43.750000
x_xylene = 0.114000
x_styrene = 0.120000
x_toluene = 0.492000
x_benzene = 0.274000

5a >> 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];
>> B = 70*[0.15; 0.25; 0.40; 0.20];
>> soln = A\B;
>> D1 = soln(1);
>> B1 = soln(2);
>> D2 = soln(3);
>> B2 = soln(4);
>> D = D1 + B1
>> B = D2 + B2

B=

26.2500

5b >> x_xylene = (0.15*D1 + 0.24*B1)/D

x_xylene =

0.1860

>> x_styrene = (0.10*D1 + 0.65*B1)/D

x_styrene =

0.3200

>> x_toluene = (0.54*D1 + 0.10*B1)/D

x_toluene =

0.3640

>> x_benzene = (0.21*D1 + 0.01*B1)/D

x_benzene =

0.1300

5c 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];
B = 70*[0.15; 0.25; 0.40; 0.20];
soln = A\B;
D1 = soln(1);
B1 = soln(2);
D2 = soln(3);
B2 = soln(4);
B = D2 + B2
x_xylene = (0.15*D1 + 0.24*B1)/D
x_styrene = (0.10*D1 + 0.65*B1)/D
x_toluene = (0.54*D1 + 0.42*B1)/D
x_benzene = (0.21*D1 + 0.01*B1)/D

>> le06_p5c
B=

26.2500

x_xylene =

0.1860

x_styrene =

0.3200

x_toluene =

0.4920

x_benzene =

0.1300

5d disp('Separation Train Solver: Column 3');


A = input('Enter matrix of coefficients: ');
B = input('Enter matrix of constants: ');
soln = A\B;
D1 = soln(1);
B1 = soln(2);
D2 = soln(3);
B2 = soln(4);
B = D2 + B2;
x_xylene = (A(1,3)*D1 + A(1,4)*B1)/D;
x_styrene = (A(2,3)*D1 + A(2,4)*B1)/D;
x_toluene = (A(3,3)*D1 + A(3,4)*B1)/D;
x_benzene = (A(4,3)*D1 + A(4,4)*B1)/D;
fprintf('B = %f \n',B)
fprintf('x_xylene = %f \n', x_xylene)
fprintf('x_styrene = %f \n', x_styrene)
fprintf('x_toluene = %f \n', x_toluene)
fprintf('x_benzene = %f \n', x_benzene)

>> le06_p5d
Separation Train Solver: Column 3
Enter matrix of coefficients: [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]
Enter matrix of constants: 70*[0.15; 0.25; 0.40; 0.20]
B = 26.250000
x_xylene = 0.186000
x_styrene = 0.320000
x_toluene = 0.364000
x_benzene = 0.130000

7. Conclusion:

I therefore conclude that steady-state material balances can be solved in MATLAB. This can be done by
formulating a system of n linear equations with n unknowns, converting the system of equations into an
augmented matrix, entering the matrix of coefficients A and the matrix of constants B, and using the
command or operation A\B.

You might also like