Chemical and Biochemical Engineering Homework Solutions
Problem
#9739

Matlab -- Developing 22 independent material balances and solving in Matlab

Please see the attached file for the fully formatted problem(s).
Find composition and flow rates from mass percent data.

Attached file(s):
Attachments
instructions.doc  View File
project1.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

project1.doc
Here’s what the 22 independent material balances should supposedly
look like:

W1 – W2 -W3=0

H1 – H2 – H3 = 0

S1 – S2 – S3 = 0

H2 – H4- H5 = 0

W2 – W5 = 0

S2-S5 = 0

W5-W7=0

S5-S7 = 0

H5-H7=0

G6-G7=0

W3+W7-W8=0

H3+H7-H8=0

G7-G8=0

S3-S8+S7=0

-0.685H2+H4=0

W1+H1+S1=7500

-0.42H5 + G6=0

0.38W1-0.62H1-0.62S1=0

-0.05W1-0.05H1+0.95S1=0

0.38W2-0.68H2-0.68S2=0

-0.05W2 -0.05H2+0.95S2 =0

0.021W8+0.021H8+0.021S8-0.979G8=0

And here are the answers (composition and flow rates? Which is which?)

x =

1.0e+003 *

4.6500

2.2759

2.3741

2.2759

2.2759

4.6500

2.4750

1.0945

1.3805

0.7497

0.3448

0.3448

1.7253

0.3750

0.1774

0.1976

0.1774

0.1774

0.3750

0.1448

0.1448

0.1448

And here are the variables set up in Excel. Matrix A will be all the
coefficients on the left-hand side of the material balances (columns
W1-G8) and Matrix B will be the right-hand side of the material balances
(the column called ‘Ans’). Then we solve for x by x=inv(a)*(b).

W1 W2 W3 W5 W7 W8 H1 H2 H3 H4 H5 H7 H8 S1 S2 S3 S5 S7 S8 G6 G7 G8 Ans

1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 0 0 0 0 0 0 0

0 0 0 0 0 0 0 1 0 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0

0 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 0 0 0 0 0 0

0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0

0 0 1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 1 0 0 1 -1 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 -1 0 0 0 0

0 0 0 0 0 0 0 -0.685 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 7500

0 0 0 0 0 0 0 0 0 0 -0.42 0 0 0 0 0 0 0 0 1 0 0 0

0.38 0 0 0 0 0 -0.62 0 0 0 0 0 0 -0.62 0 0 0 0 0 0 0 0 0

-0.05 0 0 0 0 0 -0.05 0 0 0 0 0 0 0.95 0 0 0 0 0 0 0 0 0

0 0.38 0 0 0 0 0 -0.68 0 0 0 0 0 0 -0.68 0 0 0 0 0 0 0 0

0 -0.05 0 0 0 0 0 -0.05 0 0 0 0 0 0 0.95 0 0 0 0 0 0 0 0

0 0 0 0 0 0.021 0 0 0 0 0 0 0.021 0 0 0 0 0 0.021 0 0 -0.979 0



























The Matlab Program

%Matrix-gotta love it

clear

clc

% variable portion of the matrix

a=[1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 -1 0 0 0 0 0 0

0 0 0 0 0 0 0 1 0 -1 -1 0 0 0 0 0 0 0 0 0 0 0

0 1 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 -1 0 0 0 0 0

0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0

0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0

0 0 1 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 1 0 0 1 -1 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 -1 0 0 0

0 0 0 0 0 0 0 -0.685 0 1 0 0 0 0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 -0.42 0 0 0 0 0 0 0 0 1 0 0

0.38 0 0 0 0 0 -0.62 0 0 0 0 0 0 -0.62 0 0 0 0 0 0 0 0

-0.05 0 0 0 0 0 -0.05 0 0 0 0 0 0 0.95 0 0 0 0 0 0 0 0

0 0.38 0 0 0 0 0 -0.68 0 0 0 0 0 0 -0.68 0 0 0 0 0 0 0

0 -0.05 0 0 0 0 0 -0.05 0 0 0 0 0 0 0.95 0 0 0 0 0 0 0

0 0 0 0 0 0.021 0 0 0 0 0 0 0.021 0 0 0 0 0 0.021 0 0 -0.979]

% answer portion of the matrix

b=[0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

7500

0

0

0

0

0

0

]

x=inv(a)*(b)

Test

a =

Columns 1 through 7

1.0000 -1.0000 -1.0000 0 0 0 0

0 0 0 0 0 0 1.0000

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 1.0000 0 -1.0000 0 0 0

0 0 0 0 0 0 0

0 0 0 1.0000 -1.0000 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 1.0000 0 1.0000 -1.0000 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

1.0000 0 0 0 0 0 1.0000

0 0 0 0 0 0 0

0.3800 0 0 0 0 0 -0.6200

-0.0500 0 0 0 0 0 -0.0500

0 0.3800 0 0 0 0 0

0 -0.0500 0 0 0 0 0

0 0 0 0 0 0.0210 0

Columns 8 through 14

0 0 0 0 0 0 0

-1.0000 -1.0000 0 0 0 0 0

0 0 0 0 0 0 1.0000

1.0000 0 -1.0000 -1.0000 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 1.0000 -1.0000 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 1.0000 0 0 1.0000 -1.0000 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

-0.6850 0 1.0000 0 0 0 0

0 0 0 0 0 0 1.0000

0 0 0 -0.4200 0 0 0

0 0 0 0 0 0 -0.6200

0 0 0 0 0 0 0.9500

-0.6800 0 0 0 0 0 0

-0.0500 0 0 0 0 0 0

0 0 0 0 0 0.0210 0

Columns 15 through 21

0 0 0 0 0 0 0

0 0 0 0 0 0 0

-1.0000 -1.0000 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

1.0000 0 -1.0000 0 0 0 0

0 0 0 0 0 0 0

0 0 1.0000 -1.0000 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 1.0000 -1.0000

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 1.0000

0 1.0000 0 1.0000 -1.0000 0 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

0 0 0 0 0 1.0000 0

0 0 0 0 0 0 0

0 0 0 0 0 0 0

-0.6800 0 0 0 0 0 0

0.9500 0 0 0 0 0 0

0 0 0 0 0.0210 0 0

Column 22

0

0

0

0

0

0

0

0

0

0

0

0

-1.0000

0

0

0

0

0

0

0

0

-0.9790

b =

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

7500

0

0

0

0

0

0

x =

1.0e+003 *

4.6500

2.2759

2.3741

2.2759

2.2759

4.6500

2.4750

1.0945

1.3805

0.7497

0.3448

0.3448

1.7253

0.3750

0.1774

0.1976

0.1774

0.1774

0.3750

0.1448

0.1448

0.1448

Solution Summary

The composition and flow rate of a feed stream is calculated using Matlab.

Solution
What is this?
By OTA - Overall OTA Rating
Claudiu Giurumescu, PhD (IP) - 5/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • Matlab.htm
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse