Вы находитесь на странице: 1из 54

Page EX-1

Excel Solutions to the Chemical Engineering


Problem Set
Edward M. Rosen
EMR Technology Group
13022 Musket Ct. St. Louis, Mo. 63146
E-mail: EMRose@Compuserve.com
Tel: 314-434-5498
Introduction
These solutions are to the problems given in Reference (1) which were presented at the ASEE
Chemical Engineering Summer School held in Snowbird, Utah on August 13, 1997.
Excel version 7.0 (part of Microsofts Office 95) was used to solve all the problems.
Considerable use was made of Visual Basic for Applications which is part of Excel. User defined
function were written (in VBA) to carry a number of functions including the numerical integration
of differential equations (4th order Runge-Kutta method). Use was also made of the Solver and
Goal Seek programs routines that are supplied as add-ins with Excel 7.0.

Page EX-2

Excel Problem 1 Solution


(a)
Use was made of Goal Seek to find the value of V to force the difference between the right and
left sides of Ex_Eq (1-1) to zero.
(P + a/V2)(V-b) - RT = 0

Ex_Eq (1-1)

a = (27/64) (R2Tc2/Pc)

Ex_Eq (1-2)

b = (RTc)/(8Pc)

Ex_Eq (1-3)

where

(b) and (c)


Changing the value of Pr changes the value of P = Pr*Pc. The values of Z and
V determined at the solution were recorded on EX Spreadsheet (1-1).
EX Spreadsheet (1-1)
Problem 1
Molar Volar and Compressibility Factor from Van der Waals Equation

P = Pressure in atm=Pr*Pc
V = molar volume in liters/g-mol
T= temperature in K
R= gas constant atm-liter/gmolK
Tc= citical temp for ammonia
Pc=critcal pressure for
ammonia

55.9839
111.3
222.6

0.503
1
2

0.575084 0.871819
0.233516 0.703829
0.077266 0.465765

405.5
111.3

445.2
1113

4
10

0.060654 0.731259
0.050876 1.533418

2226

20

0.046175 2.783489

Preduced
20
Z=compressibilty factor=PV/RT 2.783489
a
b

4.196946
0.037371

Value of RT
Value of P+a/V^2
Value of V-b
LHS
f(V)=0

36.927
4194.415
0.008804
36.92738
0.00038

Preduced

Value
2226
0.046175
450
0.08206

Page EX-3

Excel Problem 2 Solution


(a)
Direct use was made of function MINVERSE to find the inverse of the matrix of linear equations.
Then function MMULT was used to multiply the inverse by the right side of the equations
yielding the flows of streams D1, B1, D2 and B2.
(b)
After calculation of the total flows of streams B and D their compositions were calculated from
the material balance on each component. See EX Spreadsheet (2-1).
To use both MINVERSE and MMULT the output area had to be selected first and
Ctrl+Shift+Enter used after specifying the name of the function and the input argument ranges.
EX Spreadsheet (2-1)
Problem 2
Steady State Material Balances on a Separation Train
Material balance Equation matrix
0.07
0.04
0.54
0.35

0.18
0.24
0.42
0.16

0.15
0.1
0.54
0.21

0.24
0.65
0.1
0.01

Inverse from Use of MINVERSE


-2.81048387
94.3629032
-66.0443548
-24.5080645

1.221774
-29.8306
20.24597
9.362903

Calculation from Results (Part b)


Molar Flows
26.25
B=D2+B2
D=D1+B1
43.75

Soln from Use of


MMULT
Molar Flows

RHS
-1.8024194 6.060484
-36.685484 41.1371
30.528226 -36.2056
8.9596774 -9.99194

Component
Xylene
Styrene
Toluene
Bemzene

10.5
17.5
28
14

Composition B Composition D
0.2100
0.1140
0.4667
0.1200
0.2467
0.4920
0.0767
0.2740

D1
B1
D2
B2

26.25
17.5
8.75
17.5

Page EX-4

Excel Problem 3 Solution


(a), (b) and (c)
The spreadsheet was set up with the data for temperature and pressure entered in the indicated
columns. Columns for Temp in Deg K, 1/Tk*1000 and Log P were developed
Columns were then added for each of the curve fits that were to be carried out along with the
parameters that would be manipulated to generate the calculated curves. These are shown above
the calculated columns as parameters.
Finally a row of sum of squares cells were added along the bottom. The contents were set up as
array formulas and entered with Crtl+Shift+Enter. For example for the Calculated ClasiusClapeyron column: in the sum of squares cell the following was entered:
SUM((F16:F25-E16:E25)^2)
followed by Crtl+Shift+Enter.
The Solver program was then utilized for each of the curve fits. For example for the Clausius
Clapeyron fit F5 and F6 (A and B) were manipulated until F28 (the sum of squares ) was
minimized. Forward differences were used to obtain the derivatives.
For curve fitting the polynomials, the starting values were taken as the lower polynomials ending
values. To gain greater accuracy, derivatives were taken as central differences.
EX Spreadsheet (3-1)
Problem 3
Vapor Pressure Data Representation By Polynomials and Equations
Parameters
A and ao
B and a1
C and a2
D and a3
E and a4
F and a5

8.75200927 5.76469991 64.4059872 -0.5819143 24.459324


24.6788 24.754264
2035.33113 676.233806 5.89071425 2.06714948 1.1981007
1.6062 1.6090165
153.786135
0.08615248 0.0394481 0.0360443 0.0356053
0.0007449 0.00041312 0.000413
3.96E-06 4.23E-06
-2.51E-09

Temp. Temp.
Deg C Deg K

Press, P Log P
mm Hg
1/Tk*1000

-36.7
-19.6
-11.5
-2.6
7.6
15.4
26.1

236.45
253.55
261.65
270.55
280.75
288.55
299.25

4.229223937
3.943995267
3.821899484
3.696174459
3.561887801
3.465603881
3.341687552

1
0
5 0.699
10
1
20 1.301
40 1.6021
60 1.7782
100
2

Calculated
Calculated
ClausiusAntoine
Clap
Log P
Log P
0.14414
-0.01082
0.72467
0.72518
0.97318
1.01207
1.22907
1.29184
1.50239
1.57454
1.69836
1.76772
1.95057
2.00547

Calculated Calculated Calculated Calculated Calculated


Polynomial Polynomial Polynomial Polynomial Polynomial
Power 1
Power 2
Power3
Power 4
Power 5
Pressure
Pressure
Pressure Pressure
Pressure
-151.78323
39.592
-3.200
1.048
1.079
-51.05201
-8.002
10.522
4.518
4.417
-3.33723
-12.960
14.765
10.415
10.406
49.09013
-5.374
21.598
20.739
20.804
109.17542
20.105
36.170
39.162
39.235
155.12299
51.684
54.986
59.694
59.721
218.15363
112.059
95.846
100.339
100.278

Page EX-5
42.2
60.6
80.1

315.35 3.171079753
333.75 2.996254682
353.25 2.830856334

200 2.301
400 2.6021
760 2.8808

Sum of Squares
Variance (sum of Squares/degrees of freedom)

2.29781
2.65364
2.99028

2.31428
2.61042
2.87340

312.99413
421.38327
536.25220

240.076
441.070
717.752

201.251
407.708
756.353

200.265
399.768
760.052

200.165
399.869
760.026

0.060732441 0.00223062 118590.556 8517.49512 204.73337 1.98960209 1.9436128


0.007591555 0.00031866 14823.8195 1216.78502 34.122228 0.39792042 0.4859032

Page EX-6

Excel Problem 4 Solution


EX Spreadsheet (4-1) was set up so that the problem could be solved using Solver. The objective
function was taken (arbitrarily) as the sum of squares of the three equilibrium equations:
KC1 * CA * CB - CC*CD = 0
KC2 * CB * CC - CX*CY = 0
KC3 * CA * CX - CZ
=0

EX Eq (4-1)
EX Eq (4-2)
EX Eq (4-3)

Values of CA, CB, CC and CY were computed from the three unknowns CD, CX and CZ as given in
Reference (1) - Eq (12).
(a) and (b)
Solver found a feasible solution in both cases i.e. starting the unknowns equal to zeros and one.
The solutions were copied (using paste special) into the solution matrix. Solution (b) however
having a negative composition is not physically real.
(c)
Solver could not find a feasible solution starting with unknowns = 10.
EX Spreadsheet (4-1)
Problem 4
Reaction Equilibrium for Multiple Gas Phase Reactions

Parameters and Unknowns


Value
0.420688
CA
CB
0.242896
CC
0.153566
CD
0.705335 Unk
0.177793 Unk
CX
0.551769
CY
CZ
0.373977 Unk

CAO
CBO
KC1
KC2
KC3

1.5
1.5
1.06
2.63
5

Obj

1.15E-12

Eq EX 4-1 -8.37E-07
Eq EX 4-2 -5.4E-07
Eq EX 4-3 3.91E-07

CD
CX
CZ
CA
CB
CC
CY

Solutions to the Chemical Equilibrium


Problem
Part (a)
Part (b)
Part (c)
0.705335 0.055556
0.177793 0.597219
Feasible
0.373977 1.082074
Solution
0.420688 0.362371
Could
0.242896 -0.234849
Not
0.153566 -1.623738
Be
0.551769 1.679293
Found

Page EX-7

Excel Problem 5 Solution


The spreadsheet was set up to use Goal Seek to find the value of vt that satisfies the following
equation:
vt2 * 3* CD* - 4*g*(p - ) * Dp = 0
(5-1)

EX Eq

A VBA user defined function CD value (EX Listing (5-1)) was written to evaluate CD as a
function of Re.
(a)
Goal Seek was used to find vt when g =9.80665 m/s2 (Factor = 1) in EX Eq (5-1).
(b)
Goal Seek was used to find vt when the acceleration is 30g (Factor = 30).
EX Spreadsheet (5-1)
Problem 5
Terminal Velocity of Falling Particles
Parameters/Variables
(b)

(a)

Factor
vt -m/s
rho kg/m3
g - m/s2
rhop - kg/m3
Dp - m
vls -kg/m-s
Re
CD

30
0.20602151
994.6
294.1995
1800
0.00020800
0.00089310
47.7226196
1.55661834

1
0.0157816
994.6
9.80665
1800
0.00020800
0.00089310
3.6556427
8.8426498

EX Equation (5-1)

5.4431E-05

9.071E-06

Page EX-8

Excel Problem 6 Solution


User defined functions rk4a and fff1..fff5 were written to carry out the integration of the three
ordinary differential equations as given in Reference (1) Eq 20-22. The user defined functions
are given in EX Listing (6-1) and EX Listing (6-2) and the way the user defined array functions
are called (entered after the output cells were selected) is given in EX Listing (6-3).
EX Spreadsheet (6-1) gives the steady state values of T1, T2 and T3 as approximately 30.95 C,
41.37 C and 51.27 C. A chart of the values is given in EX Figure (6-1). From the spreadsheet it
takes about 62 min to achieve 99% of the steady state value of T3 (the slowest changing
temperature).
EX Spreadsheet (6-1)
Problem 6
Heat Exchange in a Series of Tanks
Parameters
W kg/min
Cp KJ/kg
TO C
UA
KJ/min C
Tsteam
C
M kg
h min

Index

100
2
20
10
250
1000
0.5

Time
(min)
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5

T1 (C)
20
20.56017
21.09168
21.59602
22.07455
22.52862
22.95946
23.36826
23.75615
24.12421
24.47344
24.80481
25.11923
25.41757
25.70065
25.96926
26.22412
26.46595
26.69541
26.91314
27.11973
27.31575
27.50175
27.67824

T2 (C)
20
20.57405
21.14531
21.71258
22.27475
22.83088
23.38011
23.92168
24.45495
24.97935
25.49439
25.99966
26.4948
26.97954
27.45364
27.91692
28.36925
28.81054
29.24073
29.6598
30.06777
30.46468
30.85058
31.22557

T3 (C)
20
20.57428
21.14708
21.71833
22.28786
22.85551
23.42104
23.98422
24.54478
25.10242
25.65686
26.20779
26.7549
27.2979
27.83648
28.37034
28.89919
29.42276
29.94077
30.45297
30.95911
31.45896
31.95231
32.43896

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31
31.5
32
32.5
33

27.84569
28.00459
28.15535
28.29841
28.43415
28.56295
28.68516
28.80111
28.91114
29.01554
29.1146
29.2086
29.29778
29.38241
29.46271
29.5389
29.61119
29.67979
29.74488
29.80663
29.86523
29.92084
29.9736
30.02366
30.07116
30.11623
30.15899
30.19957
30.23807
30.27461
30.30927
30.34217
30.37338
30.40299
30.43109
30.45775
30.48305
30.50705
30.52983
30.55144
30.57195
30.5914
30.60987

31.58976
31.94326
32.28622
32.6188
32.94115
33.25345
33.55589
33.84866
34.13196
34.40599
34.67096
34.92707
35.17455
35.41359
35.64443
35.86727
36.08233
36.28982
36.48995
36.68293
36.86897
37.04828
37.22105
37.38749
37.5478
37.70215
37.85076
37.99379
38.13142
38.26385
38.39124
38.51375
38.63156
38.74483
38.85371
38.95835
39.05891
39.15552
39.24833
39.33747
39.42308
39.50528
39.58421

32.91872
33.39142
33.8569
34.31502
34.76566
35.20871
35.64406
36.07165
36.49139
36.90323
37.30713
37.70307
38.09101
38.47097
38.84293
39.20691
39.56294
39.91105
40.25127
40.58367
40.9083
41.22522
41.53451
41.83623
42.13048
42.41734
42.69691
42.96927
43.23455
43.49282
43.74422
43.98884
44.22681
44.45822
44.68321
44.9019
45.11439
45.32082
45.5213
45.71595
45.90491
46.08829
46.26621

Page EX-9
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

33.5
34
34.5
35
35.5
36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47
47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56
56.5
57
57.5
58
58.5
59
59.5
60
60.5
61
61.5
62
62.5

30.62739
30.64401
30.65978
30.67474
30.68894
30.70242
30.7152
30.72733
30.73884
30.74976
30.76013
30.76996
30.77929
30.78814
30.79654
30.80451
30.81208
30.81925
30.82606
30.83252
30.83865
30.84447
30.84999
30.85523
30.86019
30.86491
30.86938
30.87363
30.87766
30.88148
30.8851
30.88855
30.89181
30.89491
30.89785
30.90064
30.90328
30.90579
30.90818
30.91044
30.91258
30.91462
30.91655
30.91838
30.92012
30.92177
30.92334
30.92482
30.92623
30.92757
30.92884
30.93004
30.93118
30.93227
30.9333
30.93427
30.9352
30.93608
30.93691

39.65997
39.73269
39.80247
39.86944
39.93369
39.99533
40.05446
40.11116
40.16555
40.2177
40.26769
40.31563
40.36158
40.40562
40.44783
40.48827
40.52703
40.56416
40.59974
40.63382
40.66646
40.69772
40.72766
40.75634
40.78379
40.81007
40.83524
40.85933
40.88239
40.90446
40.92558
40.94579
40.96514
40.98365
41.00136
41.0183
41.03451
41.05002
41.06485
41.07903
41.0926
41.10558
41.11799
41.12985
41.1412
41.15204
41.16242
41.17233
41.18181
41.19087
41.19953
41.20781
41.21572
41.22328
41.23051
41.23741
41.24401
41.25032
41.25634

46.4388
46.60617
46.76846
46.92577
47.07824
47.22597
47.36908
47.5077
47.64193
47.77189
47.89769
48.01944
48.13724
48.25122
48.36146
48.46808
48.57117
48.67084
48.76718
48.86029
48.95027
49.03719
49.12116
49.20227
49.28059
49.35621
49.42922
49.49969
49.56771
49.63335
49.69668
49.75778
49.81672
49.87356
49.92838
49.98124
50.0322
50.08133
50.12868
50.17432
50.2183
50.26068
50.3015
50.34083
50.37872
50.4152
50.45034
50.48418
50.51675
50.54811
50.5783
50.60736
50.63532
50.66223
50.68813
50.71304
50.73701
50.76007
50.78225

126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184

63
63.5
64
64.5
65
65.5
66
66.5
67
67.5
68
68.5
69
69.5
70
70.5
71
71.5
72
72.5
73
73.5
74
74.5
75
75.5
76
76.5
77
77.5
78
78.5
79
79.5
80
80.5
81
81.5
82
82.5
83
83.5
84
84.5
85
85.5
86
86.5
87
87.5
88
88.5
89
89.5
90
90.5
91
91.5
92

30.9377
30.93845
30.93917
30.93984
30.94048
30.94109
30.94167
30.94222
30.94274
30.94323
30.9437
30.94414
30.94456
30.94496
30.94534
30.9457
30.94604
30.94637
30.94668
30.94697
30.94724
30.94751
30.94776
30.94799
30.94822
30.94843
30.94863
30.94882
30.94901
30.94918
30.94934
30.9495
30.94965
30.94979
30.94992
30.95004
30.95016
30.95028
30.95038
30.95049
30.95058
30.95068
30.95076
30.95085
30.95092
30.951
30.95107
30.95114
30.9512
30.95126
30.95132
30.95137
30.95142
30.95147
30.95152
30.95156
30.95161
30.95164
30.95168

41.2621
41.26759
41.27285
41.27787
41.28266
41.28724
41.29161
41.29579
41.29978
41.30359
41.30723
41.3107
41.31402
41.31719
41.32021
41.3231
41.32586
41.32849
41.33101
41.33341
41.3357
41.33788
41.33997
41.34196
41.34387
41.34568
41.34741
41.34907
41.35065
41.35215
41.35359
41.35496
41.35627
41.35752
41.35871
41.35985
41.36093
41.36197
41.36295
41.36389
41.36479
41.36565
41.36647
41.36725
41.36799
41.3687
41.36938
41.37002
41.37064
41.37123
41.37179
41.37232
41.37283
41.37332
41.37378
41.37422
41.37464
41.37505
41.37543

50.80358
50.82409
50.84382
50.86278
50.88102
50.89855
50.9154
50.9316
50.94717
50.96214
50.97651
50.99033
51.00361
51.01636
51.02861
51.04038
51.05169
51.06255
51.07298
51.08299
51.09261
51.10184
51.11071
51.11922
51.12739
51.13524
51.14276
51.14999
51.15693
51.16358
51.16997
51.1761
51.18198
51.18762
51.19303
51.19822
51.20321
51.20798
51.21257
51.21696
51.22118
51.22522
51.2291
51.23281
51.23638
51.2398
51.24307
51.24621
51.24922
51.25211
51.25488
51.25753
51.26007
51.26251
51.26484
51.26708
51.26922
51.27127
51.27324

Page EX-10
EX Listing (6-1) RHSs for rk4a
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering
'prm Array
'prm(1) = W
'prm(2) = Cp
'prm(3) = TO
'prm(4) = UA
'prm(5) = Tsteam
'prm(6) = M
'prm(7) = h

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


fff1 = (prm(1) * prm(2) * (prm(3) - y1) + prm(4) * (prm(5) - y1)) / (prm(6) * prm(2))
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
fff2 = (prm(1) * prm(2) * (y1 - y2) + prm(4) * (prm(5) - y2)) / (prm(6) * prm(2))
End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)
fff3 = (prm(1) * prm(2) * (y2 - y3) + prm(4) * (prm(5) - y3)) / (prm(6) * prm(2))
End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = 0
End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

EX Listing (6-2) rk4a Function


Public Function rk4a(h, x, y1, y2, y3, y4, y5, prm)
'Written by EMRosen 8/31/97
'Copyright (c) EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering
'h = step size
'x = independent variable
'y1, y2, y3, y4, y5 = dependent variables

Page EX-11
'prm a parameter vector of unspecified length
'kij : i is the k value, j is the equation number or dependent variable
'To implement: must preselect row cells and enter Shift+Ctrl+Enter
'Passes Entire Array to Spreadsheet
Dim DDD(1 To 5)
k11 = fff1(x, y1, y2, y3, y4, y5, prm)
k12 = fff2(x, y1, y2, y3, y4, y5, prm)
k13 = fff3(x, y1, y2, y3, y4, y5, prm)
k14 = fff4(x, y1, y2, y3, y4, y5, prm)
k15 = fff5(x, y1, y2, y3, y4, y5, prm)
k21 = fff1(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k22 = fff2(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k23 = fff3(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k24 = fff4(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k25 = fff5(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k31 = fff1(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k32 = fff2(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k33 = fff3(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k34 = fff4(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k35 = fff5(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k41 = fff1(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k42 = fff2(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k43 = fff3(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k44 = fff4(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k45 = fff5(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
'Set up Results Array
DDD(1) = y1 + (h / 6) * (k11 + 2 * k21 + 2 * k31 + k41)
DDD(2) = y2 + (h / 6) * (k12 + 2 * k22 + 2 * k32 + k42)
DDD(3) = y3 + (h / 6) * (k13 + 2 * k23 + 2 * k33 + k43)
DDD(4) = y4 + (h / 6) * (k14 + 2 * k24 + 2 * k34 + k44)
DDD(5) = y5 + (h / 6) * (k15 + 2 * k25 + 2 * k35 + k45)
rk4a = DDD
End Function

Page EX-12
EX Listing (6-3)
Cell:
Formula:
Value:

A17
1
1

Cell:
Formula:
Value:

B17
=$B$12*$A17
20.56017

Cell:
Formula:
Value:

C17
=rk4a($B$12,$B$16,$C16,$D16,$E16,0,0,$B$6)
20.56017

Cell:
Formula:
Value:

D17
=rk4a($B$12,$B$16,$C16,$D16,$E16,0,0,$B$6)
20.57405

Cell:
Formula:
Value:

E17
=rk4a($B$12,$B$16,$C16,$D16,$E16,0,0,$B$6)
20.57428

Page EX-13
EX Figure (6-1)
Dynamic Temperature Response in the Three Tanks
60

Temperature (Deg C)

50

40

30
T1 (C)
T2 (C)
T3 (C)

20

10
0

10

20

30

40

50
Time (min)

60

70

80

90

100

Page EX-14

Excel Problem 7 Solution


(a)
The second order ODE can be broken into two first order equations as follows:
dCA/dz= y

EX Eq (7-1)

dy/dz = k*CA/DAB

EX Eq (7-2)

EX Spreadsheet (7-10) is set up to use the 4th order Runge-Kutta routine rk4 (EX Listing (7-1).
The right hand sides of the equations are given in EX Listing (7-2)
Since the initial value of y is not known Goal Seek is used to search for the initial value such that
the y is zero at z = L. The thickness is arbitrarily divided into 50 increments. The search can be
thought of as the outer loop and the integration as the inner loop.
(b)
User defined function ConA [EX Listing (7-3)] was written in VBA to evaluate the theoretical
solution.
EX Spreadsheet (7-1)
Problem 7
Diffusion With Chemical Reaction in a One Dimensional Slab

Parameters
CAO kg mol/m3
k - 1/s
DAB - m2/s
L-m
h

Index
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

0.2
0.001
1.20E-09
0.001
0.00002

Thickness - z
0
0.00002
0.00004
0.00006
0.00008
0.0001
0.00012
0.00014
0.00016
0.00018
0.0002
0.00022
0.00024
0.00026
0.00028

CA
0.2
0.197394964
0.194855728
0.192381446
0.189971292
0.187624464
0.18534018
0.183117677
0.180956215
0.178855073
0.176813552
0.17483097
0.172906667
0.17104
0.169230349

y
-131.9111926
-128.5996599
-125.330995
-122.1041081
-118.9179238
-115.7713799
-112.6634276
-109.5930307
-106.5591659
-103.5608218
-100.5969989
-97.6667093
-94.76897616
-91.90283355
-89.06732608

CA - Theoretical Solution
0.2
0.197394964
0.194855728
0.192381446
0.189971292
0.187624464
0.18534018
0.183117677
0.180956215
0.178855073
0.176813552
0.17483097
0.172906666
0.17104
0.169230349

Page EX-15
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

0.0003
0.00032
0.00034
0.00036
0.00038
0.0004
0.00042
0.00044
0.00046
0.00048
0.0005
0.00052
0.00054
0.00056
0.00058
0.0006
0.00062
0.00064
0.00066
0.00068
0.0007
0.00072
0.00074
0.00076
0.00078
0.0008
0.00082
0.00084
0.00086
0.00088
0.0009
0.00092
0.00094
0.00096
0.00098
0.001

0.167477109
0.165779697
0.164137546
0.162550109
0.161016857
0.159537279
0.158110881
0.156737188
0.155415743
0.154146104
0.152927849
0.151760571
0.150643881
0.149577408
0.148560795
0.147593703
0.146675811
0.145806812
0.144986417
0.144214352
0.143490359
0.142814198
0.142185644
0.141604485
0.14107053
0.140583599
0.140143531
0.139750178
0.139403411
0.139103112
0.138849183
0.138641537
0.138480107
0.138364838
0.138295692
0.138272646

-86.26150853
-83.48444562
-80.73521164
-78.01289013
-75.31657365
-72.64536339
-69.99836892
-67.37470789
-64.77350572
-62.19389532
-59.63501679
-57.09601715
-54.57605005
-52.07427547
-49.58985946
-47.12197387
-44.66979604
-42.23250855
-39.80929896
-37.3993595
-35.00188684
-32.6160818
-30.24114909
-27.87629704
-25.52073735
-23.17368481
-20.83435704
-18.50197425
-16.17575896
-13.85493574
-11.53873096
-9.226372531
-6.917089643
-4.610112515
-2.304672135
9.19265E-14

EX Listing (7-1)
Public Function rk4(h, x, y1, y2, y3, y4, y5, nr, prm)
'Written by EM Rosen 6/19/97

'Copyright (c) EMR Technology Group


'Permission is granted for educational use by
'Departments of Chemical Engineering
'h = step size
'x = independent variable
'y1, y2, y3, y4, y5 = dependent variables
'nr = number of dependent variable to return =rk4
'prm a parameter vector of unspecified length
'kij : i is the k value, j is the equation number or dependent variable

0.167477109
0.165779697
0.164137546
0.162550109
0.161016857
0.159537279
0.158110881
0.156737188
0.155415743
0.154146104
0.152927849
0.151760571
0.150643881
0.149577408
0.148560795
0.147593703
0.146675811
0.145806812
0.144986417
0.144214352
0.143490359
0.142814198
0.142185643
0.141604485
0.14107053
0.140583599
0.140143531
0.139750178
0.139403411
0.139103112
0.138849182
0.138641537
0.138480107
0.138364838
0.138295692
0.138272646

Page EX-16

k11 = fff1(x, y1, y2, y3, y4, y5, prm)


k12 = fff2(x, y1, y2, y3, y4, y5, prm)
k13 = fff3(x, y1, y2, y3, y4, y5, prm)
k14 = fff4(x, y1, y2, y3, y4, y5, prm)
k15 = fff5(x, y1, y2, y3, y4, y5, prm)
k21 = fff1(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k22 = fff2(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k23 = fff3(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k24 = fff4(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k25 = fff5(x + 0.5 * h, y1 + 0.5 * h * k11, y2 + 0.5 * h * k12, y3 + 0.5 * h * k13, y4 + 0.5 * h * k14, y5 + 0.5 * h * k15, prm)
k31 = fff1(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k32 = fff2(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k33 = fff3(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k34 = fff4(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k35 = fff5(x + 0.5 * h, y1 + 0.5 * h * k21, y2 + 0.5 * h * k22, y3 + 0.5 * h * k23, y4 + 0.5 * h * k24, y5 + 0.5 * h * k25, prm)
k41 = fff1(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k42 = fff2(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k43 = fff3(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k44 = fff4(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)
k45 = fff5(x + h, y1 + h * k31, y2 + h * k32, y3 + h * k33, y4 + h * k34, y5 + h * k35, prm)

Select Case nr
Case 1
rk4 = y1 + (h / 6) * (k11 + 2 * k21 + 2 * k31 + k41)
Case 2
rk4 = y2 + (h / 6) * (k12 + 2 * k22 + 2 * k32 + k42)
Case 3
rk4 = y3 + (h / 6) * (k13 + 2 * k23 + 2 * k33 + k43)
Case 4
rk4 = y4 + (h / 6) * (k14 + 2 * k24 + 2 * k34 + k44)
Case 5
rk4 = y5 + (h / 6) * (k15 + 2 * k25 + 2 * k35 + k45)

End Select
End Function

Page EX-17
EX Listing (7-2)
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

'prm(1) = CAO
'prm(2) = k
'prm(3) = DAB
'prm(4) = L
'prm(5) = h

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


fff1 = y2
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
fff2 = prm(2) * y1 / prm(3)
End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)
fff3 = 0
End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = 0
End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

EX Listing (7-3)
Public Function ConA(z, prm)
'prm(1) = CAO
'prm(2) = k
'prm(3) = DAB
'prm(4) = L
'prm(5) = h
t1 = Sqr(prm(2) / prm(3))
t2 = 1 - z / prm(4)
arg = prm(4) * t1

Page EX-18
Bot = Application.Cosh(arg)
Top = Application.Cosh(arg * t2)
ConA = prm(1) * Top / Bot
End Function

Page EX-19

Excel Problem 8 Solution


Two ordinary differential equations are solved for L (the moles of liquid remaining) and T (the
bubble point temperature) with x2 (mole fraction of toluene) as the independent variable.
Reference (2) discusses the approach of differentiating the bubble point equation to derive an
express for dT/dx2.
EX Listing (6-2) and EX Listing (8-1) are the user defined functions were used to carry out the
integration. EX Spreadsheet (8-1) presents the results
EX Spreadsheet (8-1)
Problem 8
Binary Batch Distillation
Parameters

Value

Solution of initial bubble point


Temperature
Use Goal Seek

6.90565
1211.033
220.79
6.95464
1344.8
219.482
912
0.4
100
95.56839

A1 (Benzene)
B1 (Benzene)
C1 (Benzene)
A2(Toluene)
B2 (Toluene)
C2 (Toluene)
P (mmHg)
x2 (initial)
L (initial) moles
T(initial)
h

Initial x1
Initial x2
T(bpt)
PA (mmHg)
PB (mm Hg)
k1
k2
Bpt Eq

0.01

Index

x2
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

0.4
0.41
0.42
0.43
0.44
0.45
0.46
0.47
0.48
0.49
0.5
0.51
0.52
0.53
0.54
0.55
0.56
0.57
0.58
0.59
0.6
0.61
0.62
0.63

L
(moles)
100
94.83341
90.00233
85.4779
81.2343
77.2484
73.49942
69.96863
66.63913
63.49562
60.52423
57.71239
55.04861
52.52244
50.12434
47.84556
45.6781
43.61459
41.64828
39.77293
37.98279
36.27256
34.63732
33.07253

T(bpt) - C
95.56839
95.84216
96.1181
96.39625
96.67663
96.95927
97.24421
97.53147
97.82108
98.11308
98.4075
98.70437
99.00373
99.30562
99.61006
99.91709
100.2267
100.5391
100.8541
101.1719
101.4924
101.8158
102.142
102.4712

0.6
0.4
95.56839
1195.663
485.4187
1.311034
0.532257
-0.000477

Page EX-20
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

0.64
0.65
0.66
0.67
0.68
0.69
0.7
0.71
0.72
0.73
0.74
0.75
0.76
0.77
0.78
0.79
0.8

31.57396
30.13769
28.76008
27.43771
26.16743
24.94626
23.77144
22.64036
21.55059
20.49983
19.48592
18.50683
17.56062
16.64546
15.75961
14.90142
14.06929

102.8033
103.1383
103.4764
103.8176
104.1619
104.5094
104.8601
105.214
105.5713
105.9319
106.2959
106.6634
107.0345
107.409
107.7873
108.1692
108.5548

EX Listing (8-1)
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering
'prm(1) = A1 for Benzene
'prm(2) = B1 for Benzene
'prm(3) = C1 for benzene
'prm(4) = A2 for Toluene
'prm(5) = B2 for Toluene
'prm(6) = C2 for Toluene
' prm(7) = Pressure mmHg
'prm(8) = x2 initial
'prm(9) = initial moles liquid
'prm(10) = Initial bpt
'y1 is L
'y2 is T(bubblepoint)

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


Ptol = 10 ^ (prm(4) - prm(5) / (y2 + prm(6)))
k2 = Ptol / prm(7)
x2 = x
fff1 = y1 / (x2 * (k2 - 1))
End Function

Public Function fff2(x, y1, y2, y3, y4, y5, prm)


Pben = 10 ^ (prm(1) - prm(2) / (y2 + prm(3)))
Ptol = 10 ^ (prm(4) - prm(5) / (y2 + prm(6)))
k1 = Pben / prm(7)
k2 = Ptol / prm(7)

Page EX-21
t1 = k2 - k1
t2 = -prm(2) / (prm(3) + y2) ^ 2
t3 = -prm(5) / (prm(6) + y2) ^ 2
x2 = x
x1 = 1 - x2
t4 = x1 * k1 * t2
t5 = x2 * k2 * t3
fff2 = t1 / (Log(10) * (t4 + t5))
End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)
fff3 = 0
End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = 0
End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

Page EX-22

Excel Problem 9 Solution


(a)
The three differential equations given in Reference (1), Eq (30), Eq (36) and Eq (39) were
integrated with the user defined function rk4 (EX Listing (7-1). The right hand sides are shown in
EX Listing (9-1).
A chart of the three independent variables X, T/1000 and y vs. W is given in EX Figure (9-1).
(b)
An explanation of the knee in EX Figure (9-1) is given in reference (2).
(c)
EX Figure (9-2) is a plot of CA and CC. User defined functions ConA and ConC (EX Listing (92) were used to evaluate CA and CC as given in Reference (1) Eq (34) and Eq (35).
EX Spreadsheet (9-1)
Problem 9
Reversible, Exothermic, Gas Phase Reaction in a Catalytic Reactor

Parameters

Index

Value

Temp
W

CPA - J/g-mol- K
CPC -J/g-mol-K
Del HR - J/g-mol
EA - J/g mol K
6

k - dm /kg-min-mol @ 450 K
3

KC - dm /g-mol @450 K)
3

CAO - g-mol/dm
To - K

40

Convrsn
X
0
0

Reduced P
y

450

T/1000
CA
0.45
0.271

CC
0

80

0.4 0.00302 453.095 0.99698749 0.4530948 0.267933 0.000405

-40,000

0.8

41,800

1.2 0.00958 459.793 0.99088435 0.4597931 0.261546 0.001264

0.5

1.6 0.01315 463.432 0.98779154 0.4634318 0.258212 0.001721

25,000

0.271

2.4 0.02101 471.397 0.98151716 0.4713968 0.251222 0.002696

0.0062 456.354 0.99394929 0.4563537 0.264784 0.000826

2 0.01696 467.291

0.9846696 0.4672913 0.254774 0.002197

450

2.8 0.02535 475.777

8.314
5

8
9

3.2 0.03001 480.467 0.97511457 0.4804667 0.24373


3.6 0.03502 485.506 0.97186091 0.4855056 0.239763

Ua - J/kg-min-K

0.8

10

4 0.04044 490.942 0.96856963 0.4909416 0.235628 0.004965

Ta - K

500

11

4.4 0.04632 496.832 0.96523841 0.4968323 0.231306 0.005617

0.015

12

4.8 0.05273 503.247 0.96186463 0.5032469 0.226773 0.006312

10

13

5.2 0.05976

14

5.6 0.06752 518.007 0.95497694

-0.5

15
16
17
18
19
20
21

6
6.4
6.8
7.2
7.6
8
8.4

R - J/g-mol-K
FAO- g.-mol/min

-1

Alpha - kg
Po -atm

yAo - Pure A Feed


Epsilon
Integration Parameter h

0.4

0.07614
0.08578
0.09665
0.10904
0.1233
0.13993
0.15957

0.9783327 0.4757772 0.247544 0.003219


0.00377
0.00435

510.27 0.95844528 0.5102703 0.222004 0.007056


526.588
536.177
546.986
559.288
573.445
589.938
609.42

0.95145566
0.94787683
0.94423505
0.94052392
0.93673579
0.93286145
0.92888966

0.518007 0.216966 0.007856


0.5265876
0.5361768
0.5469858
0.5592885
0.5734454
0.5899384
0.6094196

0.211623
0.205928
0.199826
0.193251
0.186119
0.178331
0.169763

0.00872
0.009661
0.01069
0.011826
0.013089
0.014507
0.016116

Page EX-23
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

8.8
9.2
9.6
10
10.4
10.8
11.2
11.6
12
12.4
12.8
13.2
13.6
14
14.4
14.8
15.2
15.6
16
16.4
16.8
17.2
17.6
18
18.4
18.8
19.2
19.6
20

0.18312
0.21181
0.24726
0.29153
0.34667
0.41353
0.48916
0.56464
0.62802
0.67229
0.69886
0.71327
0.72064
0.72428
0.72602
0.7268
0.72711
0.72718
0.72712
0.72699
0.72683
0.72664
0.72643
0.72622
0.72599
0.72576
0.72551
0.72526
0.725

EX Listing (9-1)
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering
'prm(1) - CPA -J / g - mol - K
'prm(2) - CPC -J / g - mol - K
'prm(3)- Del HR - J / g - mol
'prm(4) - EA - J/g mol K
'prm(5) - k - dm6/kg-min-mol @ 450 K
'prm(6) - KC - dm3/g-mol @450 K)
'prm(7) - CAO -g - mol / dm3
'prm(8) - To - K
'prm(9) - R -J / g - mol - K
'prm(10) -FAO- g.-mol/min
'prm(11) -Ua -J / kg - Min - K
'prm(12) -Ta -K
'prm(13) -Alpha -kg - 1
'prm(14) -Po -atm
'prm(15) - yAo - Pure A Feed
'prm(16) - Epsilon

632.779
661.232
696.403
740.316
795.029
861.37
936.365
1011.09
1073.59
1116.91
1142.47
1155.84
1162.15
1164.73
1165.4
1165.13
1164.37
1163.37
1162.25
1161.07
1159.85
1158.6
1157.35
1156.08
1154.81
1153.53
1152.24
1150.94
1149.64

0.9248067
0.9205958
0.91623678
0.91170635
0.90698043
0.90204036
0.89688438
0.89153817
0.88605025
0.88046987
0.87482953
0.86914507
0.86342294
0.85766546
0.85187324
0.84604621
0.84018391
0.83428575
0.82835103
0.82237899
0.81636884
0.81031972
0.80423075
0.79810103
0.7919296
0.78571548
0.77945764
0.77315502
0.7668065

0.632779
0.661232
0.6964028
0.7403155
0.795029
0.8613696
0.936365
1.011085
1.0735908
1.1169128
1.1424727
1.1558409
1.1621536
1.1647288
1.1654032
1.1651251
1.1643698
1.1633736
1.1622538
1.1610686
1.1598474
1.1586049
1.1573486
1.1560822
1.1548075
1.1535255
1.1522364
1.1509404
1.1496374

0.160266
0.149673
0.137811
0.124556
0.109952
0.09442
0.078989
0.065231
0.054576
0.047456
0.043224
0.040869
0.039568
0.038817
0.038342
0.038003
0.03773
0.03749
0.037266
0.037049
0.036834
0.03662
0.036406
0.03619
0.035973
0.035755
0.035534
0.035312
0.035088

0.017964
0.020111
0.022635
0.025626
0.029171
0.033288
0.037819
0.042301
0.046071
0.048678
0.050157
0.050833
0.051035
0.050983
0.0508
0.05055
0.050266
0.049963
0.049649
0.049328
0.049002
0.048671
0.048336
0.047998
0.047656
0.047311
0.046962
0.046609
0.046252

Page EX-24
'X - Conversion - y1
'y - Reduced Pressure - y2
'T - Temperature - y3
'W - Catalyst Weight

Public Function fff1(W, y1, y2, y3, y4, y5, prm)


k = prm(5) * Exp((prm(4) / prm(9)) * (1 / prm(8) - 1 / y2))
CA = ConA(W, y1, y2, y3, y4, y5, prm)
CC = ConC(W, y1, y2, y3, y4, y5, prm)
Kc = prm(6) * Exp((prm(3) / prm(9)) * (1 / prm(8) - 1 / y2))
ra = -k * (CA ^ 2 - CC / Kc)
fff1 = -ra / prm(10)

End Function
Public Function fff2(W, y1, y2, y3, y4, y5, prm)
k = prm(5) * Exp((prm(4) / prm(9)) * (1 / prm(8) - 1 / y2))
CA = ConA(W, y1, y2, y3, y4, y5, prm)
CC = ConC(W, y1, y2, y3, y4, y5, prm)
Kc = prm(6) * Exp((prm(3) / prm(9)) * (1 / prm(8) - 1 / y2))
ra = -k * (CA ^ 2 - CC / Kc)

fff2 = (prm(11) * (prm(12) - y2) + ra * prm(3)) / (prm(10) * prm(1))


End Function
Public Function fff3(W, y1, y2, y3, y4, y5, prm)
k = prm(5) * Exp((prm(4) / prm(9)) * (1 / prm(8) - 1 / y2))
CA = ConA(W, y1, y2, y3, y4, y5, prm)
CC = ConC(W, y1, y2, y3, y4, y5, prm)
Kc = prm(6) * Exp((prm(3) / prm(9)) * (1 / prm(8) - 1 / y2))
ra = -k * (CA ^ 2 - CC / Kc)
fff3 = (-prm(13) * (1 + prm(16) * y1)) * y2 / (2 * y3 * prm(8))

End Function
Public Function fff4(W, y1, y2, y3, y4, y5, prm)
fff4 = 0
End Function
Public Function fff5(W, y1, y2, y3, y4, y5, prm)
fff5 = 0

Page EX-25
End Function
Public Function ConA(W, y1, y2, y3, y4, y5, prm)
t1 = (1 - y1) / (1 - 0.5 * y1)
ConA = prm(7) * t1 * y3 * prm(8) / y2
End Function
Public Function ConC(W, y1, y2, y3, y4, y5, prm)
ConC = 0.5 * prm(7) * y1 * y3 * prm(8) / ((1 - 0.5 * y1) * y2)
End Function

EX Listing (9-2)
Public Function ConA(W, y1, y2, y3, y4, y5, prm)
t1 = (1 - y1) / (1 - 0.5 * y1)
ConA = prm(7) * t1 * y3 * prm(8) / y2
End Function
Public Function ConC(W, y1, y2, y3, y4, y5, prm)
ConC = 0.5 * prm(7) * y1 * y3 * prm(8) / ((1 - 0.5 * y1) * y2)
End Function

EX Figure (9-1)
Reversible, Exothermic, Gas Phase Reaction in a Catalytic Reactor
1.4

Values of X, T/1000 and y

1.2
1
0.8
0.6
X

0.4

y
T/1000

0.2
0
0

1.2 2.4 3.6 4.8

7.2 8.4 9.6 10.8 12 13.2 14.4 15.6 16.8 18 19.2


W (Weight of Catalyst- kg)

Page EX-26
EX Figure (9-2)
Reversible, Exothermic, Gas Phase Reaction in a Catalytic Reactor
0.3

Values of CA and CC

0.25
0.2
CA
CC

0.15
0.1
0.05
0
0

1.6

3.2

4.8

6.4
8
9.6 11.2 12.8 14.4
W (Weight of Catalyst - kg)

16

17.6 19.2

Page EX-27

Excel Problem 10 Solution


All parts of this problem (a-e) were solved using the rk4 user defined function [EX Listing (7-1)].
The right hand side user defined functions fff1 to fff2 were modified to account for the changes in
control and limits on q. Changes in Kc were made on the spreadsheet and passed to the user
defined functions fff1 to fff2.
(a)
The spreadsheet resulting from PI control with Kc = 0 (open loop) is given by EX Spreadsheet
(10-1). The user defined functions for fff1fff2 are given by EX Listing (10-1). The plot is given
in EX Figure (10-1).
EX Spreadsheet (10-1)
Problem 10(a)
Dynamics of a Heated Tank with PI Temperature Control
Parameters

Value

Index

<-----------------------Integration-------------------->
T
To
Tm
errsum

Time
(min)
rhoVCp - kJ/C
Tis - C
taud - min
Kc - kJ/min-C
WCp - kJ/min-C
Tr - C
taum - min
tauI - min
Integration Increment - h

4000
60
1
0
500
80
5
2
0.5

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
79.79167
78.59255
77.46608
76.40787
75.41377
74.47989
73.6026
72.77846
72.00425
71.27695
70.59372
69.95188
69.34892
68.7825

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.20833
80.23822
79.4824
78.4784
77.42499
76.39407
75.4101
74.47994
73.60395
72.78022
72.00609
71.27875
70.59543
69.95349

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.03406
80.02134
79.92278
79.73452
79.46461
79.12441
78.72553
78.27871
77.7936
77.27868
76.74138
76.18815
75.62456

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.007257
-0.02373
-0.01336
0.068771
0.265836
0.615901
1.151199
1.898347
2.878856
4.109703
5.603892
7.370964
9.417458

Page EX-28
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31
31.5
32
32.5
33
33.5
34
34.5
35
35.5
36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47

68.2504
67.75053
67.28095
66.83982
66.42541
66.03612
65.67041
65.32686
65.00412
64.70093
64.41612
64.14856
63.89721
63.66109
63.43928
63.2309
63.03515
62.85126
62.67851
62.51623
62.36378
62.22056
62.08603
61.95964
61.84091
61.72938
61.6246
61.52617
61.4337
61.34684
61.26524
61.18858
61.11657
61.04892
60.98537
60.92567
60.86959
60.8169
60.76741
60.72091
60.67723
60.6362
60.59766
60.56145
60.52743
60.49547
60.46546
60.43726
60.41076
60.38588
60.3625
60.34053
60.3199
60.30052
60.28231
60.26521
60.24914
60.23405
60.21987
60.20654
60.19403

69.35045
68.78393
68.25174
67.75179
67.28214
66.84093
66.42646
66.0371
65.67133
65.32772
65.00493
64.7017
64.41684
64.14924
63.89785
63.66169
63.43984
63.23143
63.03565
62.85173
62.67895
62.51664
62.36416
62.22093
62.08637
61.95996
61.84121
61.72966
61.62486
61.52642
61.43394
61.34706
61.26545
61.18878
61.11675
61.04909
60.98553
60.92582
60.86973
60.81703
60.76753
60.72103
60.67734
60.63631
60.59775
60.56154
60.52752
60.49556
60.46553
60.43733
60.41083
60.38594
60.36256
60.34059
60.31995
60.30057
60.28236
60.26525
60.24918
60.23408
60.2199

75.05541
74.48483
73.91631
73.35282
72.79686
72.2505
71.71546
71.19312
70.68458
70.19072
69.71217
69.24939
68.8027
68.37226
67.9581
67.56017
67.17834
66.81239
66.46205
66.12699
65.80687
65.50127
65.2098
64.932
64.66743
64.41563
64.17614
63.94849
63.73222
63.52687
63.33198
63.14711
62.97183
62.8057
62.64831
62.49925
62.35815
62.22461
62.09827
61.97878
61.86581
61.75902
61.65811
61.56277
61.47272
61.38769
61.30741
61.23163
61.16011
61.09264
61.02898
60.96894
60.91232
60.85893
60.80859
60.76115
60.71643
60.67428
60.63457
60.59716
60.56192

11.74732
14.36227
17.26214
20.44512
23.90806
27.64665
31.65566
35.92907
40.46024
45.24204
50.26697
55.52725
61.0149
66.72183
72.63992
78.76103
85.07707
91.58004
98.26208
105.1154
112.1326
119.3062
126.629
134.0941
141.6948
149.4245
157.2771
165.2464
173.3267
181.5124
189.7981
198.1787
206.6494
215.2054
223.8422
232.5557
241.3416
250.1963
259.1158
268.0968
277.136
286.23
295.376
304.571
313.8123
323.0974
332.4238
341.7893
351.1915
360.6285
370.0982
379.5989
389.1287
398.686
408.2693
417.877
427.5077
437.1601
446.833
456.5251
466.2355

Page EX-29
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155

47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56
56.5
57
57.5
58
58.5
59
59.5
60
60.5
61
61.5
62
62.5
63
63.5
64
64.5
65
65.5
66
66.5
67
67.5
68
68.5
69
69.5
70
70.5
71
71.5
72
72.5
73
73.5
74
74.5
75
75.5
76
76.5
77
77.5

60.18228
60.17123
60.16086
60.15111
60.14196
60.13336
60.12528
60.11769
60.11056
60.10386
60.09756
60.09165
60.0861
60.08088
60.07598
60.07138
60.06706
60.06299
60.05918
60.05559
60.05222
60.04906
60.04609
60.04329
60.04067
60.03821
60.03589
60.03372
60.03167
60.02976
60.02795
60.02626
60.02467
60.02317
60.02177
60.02045
60.01921
60.01805
60.01695
60.01593
60.01496
60.01406
60.0132
60.0124
60.01165
60.01095
60.01028
60.00966
60.00907
60.00853
60.00801
60.00752
60.00707
60.00664
60.00624
60.00586
60.0055
60.00517
60.00486
60.00456
60.00429

60.20658
60.19406
60.1823
60.17126
60.16088
60.15114
60.14198
60.13338
60.1253
60.1177
60.11057
60.10387
60.09758
60.09167
60.08611
60.0809
60.076
60.07139
60.06707
60.063
60.05919
60.0556
60.05223
60.04907
60.04609
60.0433
60.04068
60.03821
60.0359
60.03372
60.03168
60.02976
60.02796
60.02626
60.02467
60.02318
60.02177
60.02045
60.01921
60.01805
60.01696
60.01593
60.01496
60.01406
60.01321
60.01241
60.01165
60.01095
60.01028
60.00966
60.00908
60.00853
60.00801
60.00752
60.00707
60.00664
60.00624
60.00586
60.00551
60.00517
60.00486

60.52872
60.49745
60.468
60.44028
60.41417
60.38959
60.36645
60.34467
60.32417
60.30487
60.28671
60.26962
60.25354
60.23841
60.22418
60.21078
60.19818
60.18633
60.17518
60.16469
60.15483
60.14555
60.13683
60.12862
60.12091
60.11365
60.10683
60.10041
60.09438
60.08871
60.08338
60.07836
60.07365
60.06922
60.06505
60.06114
60.05746
60.054
60.05074
60.04769
60.04481
60.04211
60.03957
60.03719
60.03494
60.03284
60.03086
60.02899
60.02724
60.0256
60.02405
60.0226
60.02124
60.01996
60.01875
60.01762
60.01655
60.01555
60.01461
60.01373
60.0129

475.9629
485.7064
495.4651
505.2381
515.0246
524.8237
534.6348
544.457
554.2899
564.1327
573.9848
583.8458
593.715
603.5921
613.4765
623.3678
633.2655
643.1694
653.0791
662.9942
672.9143
682.8392
692.7687
702.7023
712.64
722.5813
732.5262
742.4744
752.4258
762.38
772.337
782.2966
792.2586
802.2229
812.1893
822.1578
832.1281
842.1003
852.0741
862.0495
872.0264
882.0047
891.9842
901.9651
911.947
921.9301
931.9142
941.8992
951.8852
961.872
971.8596
981.8479
991.8369
1001.827
1011.817
1021.808
1031.799
1041.791
1051.784
1061.777
1071.77

Page EX-30
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204

78
78.5
79
79.5
80
80.5
81
81.5
82
82.5
83
83.5
84
84.5
85
85.5
86
86.5
87
87.5
88
88.5
89
89.5
90
90.5
91
91.5
92
92.5
93
93.5
94
94.5
95
95.5
96
96.5
97
97.5
98
98.5
99
99.5
100
100.5
101
101.5
102

60.00403
60.00378
60.00355
60.00334
60.00314
60.00295
60.00277
60.0026
60.00244
60.00229
60.00216
60.00202
60.0019
60.00179
60.00168
60.00158
60.00148
60.00139
60.00131
60.00123
60.00115
60.00108
60.00102
60.00096
60.0009
60.00084
60.00079
60.00074
60.0007
60.00066
60.00062
60.00058
60.00054
60.00051
60.00048
60.00045
60.00042
60.0004
60.00037
60.00035
60.00033
60.00031
60.00029
60.00027
60.00026
60.00024
60.00023
60.00021
60.0002

EX Listing (10-1)
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

60.00456
60.00429
60.00403
60.00378
60.00355
60.00334
60.00314
60.00295
60.00277
60.0026
60.00244
60.00229
60.00216
60.00203
60.0019
60.00179
60.00168
60.00158
60.00148
60.00139
60.00131
60.00123
60.00115
60.00108
60.00102
60.00096
60.0009
60.00084
60.00079
60.00075
60.0007
60.00066
60.00062
60.00058
60.00055
60.00051
60.00048
60.00045
60.00042
60.0004
60.00037
60.00035
60.00033
60.00031
60.00029
60.00027
60.00026
60.00024
60.00023

60.01212
60.01139
60.0107
60.01005
60.00945
60.00887
60.00834
60.00783
60.00736
60.00691
60.0065
60.0061
60.00573
60.00539
60.00506
60.00475
60.00447
60.0042
60.00394
60.0037
60.00348
60.00327
60.00307
60.00289
60.00271
60.00255
60.00239
60.00225
60.00211
60.00198
60.00186
60.00175
60.00165
60.00155
60.00145
60.00136
60.00128
60.0012
60.00113
60.00106
60.001
60.00094
60.00088
60.00083
60.00078
60.00073
60.00069
60.00064
60.00061

1081.764
1091.758
1101.752
1111.747
1121.742
1131.738
1141.733
1151.729
1161.726
1171.722
1181.719
1191.716
1201.713
1211.71
1221.707
1231.705
1241.702
1251.7
1261.698
1271.696
1281.695
1291.693
1301.691
1311.69
1321.688
1331.687
1341.686
1351.685
1361.684
1371.683
1381.682
1391.681
1401.68
1411.679
1421.678
1431.678
1441.677
1451.676
1461.676
1471.675
1481.675
1491.674
1501.674
1511.673
1521.673
1531.673
1541.672
1551.672
1561.672

Page EX-31

'Proportional and Integral Controllers


'prm(1) -rhoVCp -kJ / C
'prm(2) -Tis -C
'prm(3) -taud -Min
'prm(4) -Kc -b kJ/min-C
'prm(5) -WCp -kJ / Min - C
'prm(6) -Tr -C
'prm(7) -taum -Min
'prm(8) -tauI -Min
'x - time
'y1 -T
'y2 - To
'y3 - Tm
'y4 - errsum

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff1 = dTdt
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff2 = (y1 - y2 - (prm(3) / 2) * dTdt) * 2 / prm(3)

End Function

Page EX-32
Public Function fff3(x, y1, y2, y3, y4, y5, prm)

fff3 = (y2 - y3) / prm(7)


End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = prm(6) - y3

End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

Page EX-33
EX Figure (10-1)

Dynamics of a Heated Tank - PI Control - Kc = 0


85

Temperature (Deg C)

80

75
T
To
Tm

70

65

60

55
0

10

20

30

40

50

Time (min)

(b)
The spreadsheet resulting from PI control with Kc = 50 is given by EX Spreadsheet (10-2). The
user defined functions for fff1fff2 are given by EX Listing (10-2). The plot is given in EX
Figure (10-2).
EX Spreadsheet (10-2)
Problem 10(b)
Dynamics of a Heated Tank with PI Temperature Control
Parameters

Value

Index

<-------------------Integration----------------->
T
To
Tm
errsum

Time
(min)
rhoVCp - kJ/C
Tis - C

4000
60

0
1

0
0.5

80
80

80
80

80
80

0
0

60

Page EX-34
taud - min
Kc - kJ/min-C
WCp - kJ/min-C
Tr - C
taum - min
tauI - min

1
50
500
80
5
2

Integration Increment - h

0.5

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
79.79167
78.59245
77.46574
76.40761
75.41458
74.48353
73.61157
72.79602
72.03439
71.32435
70.66369
70.05036
69.4824
68.95797
68.4753
68.03272
67.62861
67.26146
66.92977
66.63213
66.36717
66.13357
65.93005
65.75537
65.60833
65.48776
65.39253
65.32154
65.2737
65.24799
65.24337
65.25886
65.2935
65.34634
65.41646
65.50297
65.60499
65.72169
65.85222
65.99579
66.15161
66.31892
66.49698

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.20833
80.23825
79.4824
78.47809
77.42429
76.39336
75.41043
74.48309
73.61244
72.79732
72.03579
71.32572
70.66502
70.05163
69.48361
68.95912
68.4764
68.03376
67.62962
67.26242
66.9307
66.63303
66.36804
66.13441
65.93087
65.75616
65.6091
65.48851
65.39326
65.32224
65.27439
65.24866
65.24402
65.2595
65.29412
65.34694
65.41705
65.50354
65.60555
65.72223
65.85275
65.99631
66.15212

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.03406
80.02134
79.92277
79.73446
79.46449
79.12428
78.72555
78.27927
77.7953
77.28242
76.74839
76.20001
75.64324
75.0833
74.52471
73.9714
73.42675
72.89369
72.3747
71.87188
71.387
70.92153
70.47666
70.05336
69.65238
69.27428
68.91945
68.58815
68.28049
67.99648
67.73602
67.49893
67.28494
67.09372
66.92488
66.77798
66.65253
66.548
66.46385
66.39948
66.3543
66.32767

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.00726
-0.02373
-0.01336
0.068781
0.265892
0.616027
1.151365
1.898389
2.878365
4.107896
5.599458
7.361888
9.400837
11.71916
14.3173
17.19357
20.34445
23.76488
27.44841
31.38748
35.57354
39.99724
44.64857
49.51698
54.59149
59.86079
65.31333
70.93741
76.72124
82.65298
88.72083
94.91306
101.218
107.6243
114.1206
120.6958
127.339
134.0398
140.7876
147.5726
154.385
161.2152

Page EX-35
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

31.5
32
32.5
33
33.5
34
34.5
35
35.5
36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47
47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56
56.5
57
57.5
58
58.5
59
59.5
60

66.68506
66.88247
67.08852
67.30255
67.52393
67.75203
67.98625
68.226
68.47073
68.71989
68.97296
69.22942
69.48879
69.7506
70.0144
70.27975
70.54623
70.81345
71.08101
71.34856
71.61573
71.8822
72.14765
72.41177
72.67427
72.93489
73.19335
73.44942
73.70287
73.95347
74.20103
74.44535
74.68626
74.92358
75.15717
75.38688
75.61258
75.83414
76.05147
76.26447
76.47303
76.67709
76.87657
77.07141
77.26156
77.44698
77.62763
77.80349
77.97452
78.14073
78.3021
78.45863
78.61033
78.75722
78.89931
79.03662
79.16919
79.29705

66.31941
66.49746
66.68552
66.88292
67.08896
67.30298
67.52434
67.75242
67.98663
68.22637
68.47109
68.72023
68.97329
69.22974
69.4891
69.7509
70.01469
70.28002
70.5465
70.8137
71.08125
71.34879
71.61595
71.88241
72.14785
72.41196
72.67445
72.93506
73.19351
73.44957
73.70301
73.95361
74.20116
74.44547
74.68636
74.92368
75.15726
75.38696
75.61265
75.83421
76.05154
76.26452
76.47308
76.67713
76.8766
77.07144
77.26159
77.447
77.62765
77.8035
77.97453
78.14073
78.30209
78.45862
78.61032
78.75721
78.89929
79.0366

66.31897
66.32754
66.35273
66.39388
66.45032
66.52139
66.60642
66.70475
66.81573
66.93871
67.07305
67.21811
67.37327
67.53791
67.71144
67.89325
68.08278
68.27945
68.48271
68.69203
68.90687
69.12673
69.35112
69.57954
69.81154
70.04666
70.28446
70.52452
70.76643
71.0098
71.25426
71.49944
71.74498
71.99056
72.23586
72.48056
72.72439
72.96705
73.20828
73.44784
73.68548
73.92098
74.15412
74.3847
74.61254
74.83746
75.05929
75.27787
75.49307
75.70474
75.91278
76.11706
76.31748
76.51395
76.70639
76.89472
77.07887
77.25878

168.0543
174.8934
181.724
188.538
195.3276
202.0852
208.8039
215.4766
222.097
228.6589
235.1564
241.584
247.9366
254.2092
260.3972
266.4964
272.5027
278.4124
284.2221
289.9287
295.5292
301.021
306.4017
311.6692
316.8216
321.8571
326.7745
331.5723
336.2496
340.8056
345.2396
349.5512
353.7401
357.8063
361.7496
365.5705
369.2692
372.8463
376.3024
379.6383
382.8549
385.9532
388.9343
391.7995
394.5501
397.1874
399.7131
402.1287
404.4358
406.6362
408.7317
410.7241
412.6153
414.4072
416.102
417.7015
419.208
420.6234

Page EX-36

EX Listing (10-2
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

'Proportional and Integral Controllers


'prm(1) -rhoVCp -kJ / C
'prm(2) -Tis -C
'prm(3) -taud -Min
'prm(4) -Kc -b kJ/min-C
'prm(5) -WCp -kJ / Min - C
'prm(6) -Tr -C
'prm(7) -taum -Min
'prm(8) -tauI -Min
'x - time
'y1 -T
'y2 - To
'y3 - Tm
'y4 - errsum

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff1 = dTdt
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)

Page EX-37

qs = prm(5) * (prm(6) - prm(2))


q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff2 = (y1 - y2 - (prm(3) / 2) * dTdt) * 2 / prm(3)

End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)

fff3 = (y2 - y3) / prm(7)


End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = prm(6) - y3

End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

Page EX-38
EX Figure (10-2)
Dynamics of a Heated Tank - PI Control for Kc = 0

Temperature (deg C)

90

80

70

To
Tm

60
0

10

20

30

40

50

60

70

80

90

100

Time (min)

(c)
The spreadsheet resulting from PI control with Kc = 500 is given by EX Spreadsheet (10-3). The
user defined functions for fff1fff2 are given by EX Listing (10-3). The plot is given in EX
Figure (10-3).
EX Spreadsheet (10-3)
Problem 10(c)
Dynamics of a Heated Tank with PI Temperature Control
Parameters

Value

Index

<-------------------Integration----------------->
T
To
Tm
errsum

Time
(min)
rhoVCp - kJ/C
Tis - C
taud - min
Kc - kJ/min-C
WCp - kJ/min-C
Tr - C
taum - min
tauI - min
Integration Increment - h

4000
60
1
500
500
80
5
2
0.5

0
1
2
3
4
5
6
7
8
9
10

0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5

80
80
80
80
80
80
80
80
80
80
80

80
80
80
80
80
80
80
80
80
80
80

80
80
80
80
80
80
80
80
80
80
80

0
0
0
0
0
0
0
0
0
0
0

Page EX-39
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31
31.5
32
32.5
33
33.5
34
34.5
35
35.5

80
80
80
80
80
80
80
80
80
79.79167
78.59156
77.46267
76.40525
75.42196
74.51637
73.69249
72.95434
72.30578
71.75037
71.29123
70.93094
70.67143
70.51396
70.45902
70.50631
70.65466
70.9021
71.24576
71.68195
72.2061
72.81289
73.49617
74.24911
75.06419
75.9333
76.84778
77.79854
78.7761
79.77071
80.77242
81.77121
82.75704
83.71997
84.65028
85.53852
86.37565
87.15308
87.86282
88.49748
89.05044
89.51582
89.88863
90.16477
90.34107
90.41536
90.38648
90.25426
90.01961
89.68442
89.2516
88.72506

80
80
80
80
80
80
80
80
80
80.20833
80.23845
79.4824
78.47535
77.41794
76.38696
75.41343
74.5115
73.68907
72.95159
72.30347
71.74846
71.28973
70.92988
70.67086
70.51391
70.45952
70.50736
70.65628
70.90429
71.24851
71.68524
72.20992
72.8172
73.50095
74.25431
75.06977
75.9392
76.85396
77.80493
78.78264
79.77734
80.77909
81.77784
82.76357
83.72634
84.65642
85.54438
86.38116
87.15819
87.86747
88.50163
89.05404
89.51884
89.89104
90.16654
90.34218
90.4158
90.38623
90.25333
90.01801
89.68215

80
80
80
80
80
80
80
80
80
80
80.03409
80.0214
79.92271
79.73396
79.46337
79.12301
78.72577
78.28429
77.81063
77.31616
76.81154
76.30676
75.81113
75.33328
74.88119
74.46214
74.08275
73.74891
73.46583
73.23797
73.06906
72.96208
72.91924
72.94203
73.03114
73.18652
73.4074
73.69226
74.03889
74.4444
74.90526
75.41734
75.97595
76.5759
77.21153
77.87679
78.56528
79.27034
79.98512
80.70261
81.41573
82.11744
82.80074
83.45881
84.08503
84.67306
85.21692
85.71105
86.15034
86.53021
86.84666

0
0
0
0
0
0
0
0
0
0
-0.00726
-0.02376
-0.0134
0.068876
0.266394
0.617165
1.152866
1.89876
2.873926
4.091585
5.559447
7.280063
9.251155
11.46596
13.91358
16.57926
19.44482
22.48891
25.68743
29.01386
32.43963
35.93447
39.46685
43.00428
46.51376
49.96209
53.31631
56.54401
59.61374
62.4953
65.16011
67.5815
69.73501
71.59865
73.15316
74.38218
75.27249
75.81414
76.00053
75.82856
75.29865
74.41473
73.18428
71.6182
69.73078
67.53954
65.06508
62.33091
59.36318
56.19048
52.84355

Page EX-40
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47
47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56
56.5
57
57.5
58
58.5
59
59.5
60

88.10963
87.41107
86.63597
85.79173
84.88644
83.92887
82.9283
81.89451
80.83765
79.76811
78.69648
77.6334
76.58949
75.57518
74.6007
73.67588
72.81013
72.0123
71.2906
70.65251
70.10473
69.65307
69.30242
69.05668
68.91872
68.89035
68.97232
69.16426
69.46471
69.87113
70.37993
70.98646
71.68509
72.46926
73.33152
74.26363
75.2566
76.30081
77.3861
78.50184
79.63706
80.78056
81.92101
83.04705
84.14744
85.21112
86.22737
87.18589
88.07692

EX Listing (10-3
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

89.2487
88.72154
88.10552
87.40642
86.63082
85.78613
84.88045
83.92253
82.92169
81.88769
80.83068
79.76106
78.68942
77.62641
76.58263
75.56852
74.5943
73.66982
72.80447
72.00709
71.28589
70.64836
70.10118
69.65016
69.30017
69.05512
68.91787
68.89023
68.97293
69.16559
69.46675
69.87387
70.38334
70.99051
71.68974
72.47447
73.33725
74.26981
75.26317
76.30772
77.39327
78.5092
79.64455
80.7881
81.92852
83.05446
84.15467
85.2181
86.23403

87.09628
87.27634
87.38475
87.42016
87.38191
87.27009
87.08551
86.82971
86.50494
86.11415
85.66096
85.14962
84.58496
83.97239
83.31781
82.62754
81.9083
81.16713
80.4113
79.64827
78.88559
78.13086
77.39159
76.67522
75.98895
75.33973
74.73417
74.17846
73.67835
73.23902
72.8651
72.56057
72.32875
72.17224
72.0929
72.09185
72.16941
72.32513
72.5578
72.86542
73.24522
73.69375
74.20681
74.77958
75.4066
76.08187
76.79887
77.55064
78.32986

49.35497
45.75887
42.09058
38.3863
34.68271
31.01666
27.42476
23.94304
20.60656
17.44911
14.50281
11.79785
9.362092
7.220878
5.396707
3.909023
2.774002
2.004381
1.609318
1.594282
1.960989
2.707364
3.827551
5.311953
7.147312
9.316825
11.8003
14.57434
17.61257
20.88586
24.36264
28.00918
31.78994
35.66787
39.60483
43.56191
47.49987
51.37947
55.1619
58.80916
62.28444
65.55248
68.57993
71.33571
73.7913
75.92106
77.70247
79.11639
80.14726

Page EX-41

'Proportional and Integral Controllers


'prm(1) -rhoVCp -kJ / C
'prm(2) -Tis -C
'prm(3) -taud -Min
'prm(4) -Kc -b kJ/min-C
'prm(5) -WCp -kJ / Min - C
'prm(6) -Tr -C
'prm(7) -taum -Min
'prm(8) -tauI -Min
'x - time
'y1 -T
'y2 - To
'y3 - Tm
'y4 - errsum

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff1 = dTdt
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3) + prm(4) * y4 / prm(8)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff2 = (y1 - y2 - (prm(3) / 2) * dTdt) * 2 / prm(3)

End Function

Page EX-42
Public Function fff3(x, y1, y2, y3, y4, y5, prm)

fff3 = (y2 - y3) / prm(7)


End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = prm(6) - y3

End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

EX Figure (10-3)
Dynamics of a Heated Tank - PI Control - Kc = 500
100

Temperature (Deg C)

90

80

70
T
To
Tm
60
0

10

20

30

40

50

60

70

80

90

100

Time (min)

(d)
The spreadsheet resulting from P control alone with Kc = 500 is given by EX Spreadsheet (10-4).
The user defined functions for fff1fff2 are given by EX Listing (10-4). The plot is given in EX
Figure (10-4).

Page EX-43
EX Spreadsheet (10-4)
Problem 10(d)
Dynamics of a Heated Tank with Proportional Temperature Control
Parameters

Value

Index

<-------------------Integration----------------->
T
To
Tm
errsum

Time
(min)
rhoVCp - kJ/C
Tis - C
taud - min
Kc - kJ/min-C
WCp - kJ/min-C
Tr - C
taum - min
tauI - min
Integration Increment - h

4000
60
1
500
500
80
5
2
0.5

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
79.79167
78.59167
77.46327
76.40651
75.42252
74.51212
73.67547
72.91192
72.22013
71.59813
71.04344
70.55313
70.12397
69.75244
69.43486
69.16745
68.94637
68.76775
68.62782
68.52284
68.4492
68.40344
68.38225
68.38248
68.40118
68.43561
68.48319
68.54159
68.60863
68.68237
68.76104
68.84305

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.20833
80.23837
79.48226
78.47555
77.41926
76.38969
75.41618
74.51004
73.67527
72.91269
72.22147
71.59986
71.04545
70.55536
70.12634
69.75491
69.43739
69.17
68.9489
68.77025
68.63025
68.52519
68.45146
68.40559
68.38427
68.38438
68.40295
68.43724
68.4847
68.54296
68.60987
68.68348

80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80
80.03409
80.02139
79.92269
79.73402
79.46362
79.12352
78.72634
78.28415
77.8081
77.30824
76.79356
76.27197
75.7504
75.2348
74.73025
74.24102
73.77057
73.32172
72.89663
72.49689
72.12358
71.77735
71.45842
71.16669
70.90176
70.66296
70.44944
70.26015
70.09394
69.94952
69.82555

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-0.00726
-0.02376
-0.01339
0.068882
0.266329
0.61691
1.152325
1.898064
2.873804
4.093917
5.568018
7.301495
9.29603
11.55009
14.05938
16.81727
19.81522
23.04309
26.48953
30.14223
33.98823
38.01413
42.20632
46.55117
51.03516
55.64505
60.36798
65.19157
70.10398
75.094
80.15106

Page EX-44
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31
31.5
32
32.5
33
33.5
34
34.5
35
35.5
36
36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47
47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56

68.92702
69.01171
69.09606
69.17914
69.26018
69.33854
69.41368
69.48519
69.55275
69.61613
69.67518
69.72982
69.78004
69.82586
69.86737
69.90468
69.93795
69.96736
69.99309
70.01536
70.03439
70.0504
70.06364
70.07433
70.08269
70.08896
70.09335
70.09607
70.09731
70.09727
70.09612
70.09403
70.09115
70.08763
70.08358
70.07914
70.07441
70.06947
70.06442
70.05932
70.05425
70.04926
70.04439
70.03968
70.03516
70.03087
70.02681
70.023
70.01946
70.01618
70.01316
70.01041
70.00792
70.00568
70.00369
70.00193
70.00038
69.99905
69.99791
69.99695
69.99616

68.76203
68.84393
68.92779
69.01238
69.09663
69.17962
69.26058
69.33885
69.41393
69.48537
69.55288
69.61621
69.67522
69.72982
69.78
69.8258
69.86728
69.90458
69.93783
69.96722
69.99294
70.01521
70.03423
70.05025
70.06349
70.07418
70.08255
70.08882
70.09321
70.09594
70.09719
70.09715
70.09601
70.09393
70.09106
70.08754
70.08351
70.07907
70.07435
70.06942
70.06437
70.05928
70.05422
70.04923
70.04436
70.03966
70.03515
70.03086
70.0268
70.023
70.01946
70.01618
70.01317
70.01042
70.00793
70.00569
70.0037
70.00193
70.00039
69.99906
69.99792

69.72063
69.63335
69.56227
69.50599
69.46309
69.43225
69.41214
69.40153
69.39922
69.40411
69.41514
69.43134
69.45183
69.47576
69.5024
69.53107
69.56116
69.59212
69.6235
69.65486
69.68586
69.71619
69.74559
69.77385
69.80082
69.82635
69.85036
69.87277
69.89356
69.9127
69.93021
69.94611
69.96044
69.97324
69.9846
69.99456
70.00322
70.01065
70.01693
70.02216
70.02641
70.02978
70.03234
70.03418
70.03538
70.036
70.03613
70.03583
70.03516
70.03418
70.03294
70.03149
70.02989
70.02816
70.02635
70.02449
70.0226
70.02072
70.01885
70.01703
70.01526

85.26527
90.42748
95.62922
100.8627
106.121
111.3976
116.687
121.9839
127.2841
132.5835
137.8789
143.1675
148.4469
153.7151
158.9707
164.2124
169.4393
174.6511
179.8472
185.0276
190.1924
195.3418
200.4763
205.5964
210.7027
215.7958
220.8766
225.9457
231.0041
236.0525
241.0917
246.1225
251.1458
256.1623
261.1728
266.178
271.1785
276.175
281.168
286.1582
291.146
296.1319
301.1164
306.0997
311.0823
316.0644
321.0464
326.0284
331.0106
335.9933
340.9765
345.9604
350.945
355.9305
360.9169
365.9042
370.8924
375.8816
380.8717
385.8627
390.8546

Page EX-45
113
114
115
116
117
118
119
120

56.5
57
57.5
58
58.5
59
59.5
60

69.99552
69.99502
69.99464
69.99438
69.99422
69.99415
69.99415
69.99422

69.99696
69.99617
69.99553
69.99503
69.99465
69.99439
69.99423
69.99415

EX Listing (10-4
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

'Proportional Control
'prm(1) -rhoVCp -kJ / C
'prm(2) -Tis -C
'prm(3) -taud -Min
'prm(4) -Kc -b kJ/min-C
'prm(5) -WCp -kJ / Min - C
'prm(6) -Tr -C
'prm(7) -taum -Min
'prm(8) -tauI -Min
'x - time
'y1 -T
'y2 - To
'y3 - Tm
'y4 - errsum

Public Function fff1(x, y1, y2, y3, y4, y5, prm)


step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))

70.01356
70.01194
70.01041
70.00897
70.00762
70.00637
70.00523
70.00417

395.8474
400.8411
405.8355
410.8306
415.8265
420.823
425.8201
430.8177

Page EX-46
q = qs + prm(4) * (prm(6) - y3)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff1 = dTdt
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
step = 1
If x < 10 Then
step = 0
End If
ti = prm(2) + step * (-20)
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (prm(6) - y3)
dTdt = (prm(5) * (ti - y1) + q) / prm(1)
fff2 = (y1 - y2 - (prm(3) / 2) * dTdt) * 2 / prm(3)

End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)

fff3 = (y2 - y3) / prm(7)


End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
fff4 = prm(6) - y3

End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function

Page EX-47
EX Figure (10-4)
Dynamics of a Heated Tank - Proportional Control Only with Kc = 500
82
80

Temperature (Deg C)

78
76

T
To
Tm

74
72
70
68
66
0

10

20

30

40

50

60

Time (min)

(e)
The spreadsheet resulting from P control alone for Kc = 5000 with a maximum limit on q (equal
to 2.6 x 10000) and a minimum on q (equal to 0) is given by EX Spreadsheet (10-5). The user
defined functions for fff1fff2 are given by EX Listing (10-5). The plots are given in EX Figure
(10-5) and EX Figure (10-6).
EX Spreadsheet (10-5)
Problem 10(e)
Dynamics of a Heated Tank with P Temperature Control and Limits on q
Parameters
rhoVCp - kJ/C
Tis - C
taud - min
Kc - kJ/min-C
WCp - kJ/min-C
Tr - C
taum - min
tauI - min
Integration Increment - h

Value

Index

4000
60
1
5000
500
80
5
2
0.5

0
1
2
3
4
5
6
7
8
9
10
11

Time(min) T
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
5.5

To
80
80
80
80
80
80
80
80
80
80
80
80

Tm
80
80
80
80
80
80
80
80
80
80
80
80

errsum
80
80
80
80
80
80
80
80
80
80
80
80

0
0
0
0
0
0
0
0
0
0
0
0

q
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000

qlim
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000
10000

Page EX-48
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

6
6.5
7
7.5
8
8.5
9
9.5
10
10.5
11
11.5
12
12.5
13
13.5
14
14.5
15
15.5
16
16.5
17
17.5
18
18.5
19
19.5
20
20.5
21
21.5
22
22.5
23
23.5
24
24.5
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
30.5
31
31.5
32
32.5
33
33.5
34
34.5
35
35.5
36

80
80
80
80
80
80
80
80
80.33333
82.25192
84.05426
85.74741
87.33797
88.83217
90.23584
91.55446
92.79319
93.95688
95.05005
96.077
97.04172
97.92717
98.37738
98.24027
97.55701
96.39319
94.83836
93.00112
91.02462
89.14494
87.37913
85.72032
84.2346
83.09616
82.36217
82.0595
82.1889
82.72554
83.62132
84.80862
86.20506
87.71525
89.18659
90.56878
91.86119
92.96145
93.78573
94.29668
94.47642
94.32736
93.87135
93.14772
92.2102
91.1232
89.95752
88.78589
87.67851
86.69901
85.90087
85.32463
84.996

80
80
80
80
80
80
80
80
79.66667
79.61884
80.82817
82.43457
84.12002
85.76949
87.34384
88.8321
90.23368
91.55165
92.79026
93.95401
95.04732
96.09524
97.20401
98.04357
98.4029
98.22148
97.51179
96.33039
94.74474
92.87474
90.97111
89.12773
87.33604
85.63582
84.18031
83.06569
82.35151
82.06685
82.21255
82.76326
83.67024
84.86909
86.29173
87.76639
89.20957
90.62188
91.91414
92.99608
93.80532
94.3022
94.46862
94.30742
93.841
93.10919
92.16612
91.07643
89.91096
88.74231
87.6404
86.66843
85.87935

80
80
80
80
80
80
80
80
80
79.94551
79.96586
80.12355
80.42477
80.85663
81.40094
82.03915
82.75406
83.53025
84.35411
85.21379
86.09896
87.00071
87.91915
88.84616
89.74281
90.5624
91.2609
91.80202
92.15984
92.31683
92.27779
92.06369
91.69759
91.199
90.59687
89.92938
89.23836
88.5658
87.95106
87.42857
87.02592
86.76243
86.64953
86.6867
86.85937
87.1517
87.54574
88.01571
88.53113
89.05963
89.5692
90.03017
90.41691
90.70926
90.89345
90.96273
90.91749
90.76492
90.51835
90.19621
89.82071

0
0
0
0
0
0
0
0
0.833333
5.844945
10.8713
15.85471
20.7233
25.408
29.84789
33.99141
37.79598
41.22716
44.25781
46.86711
49.03979
50.7654
52.03571
52.84384
53.19431
53.11383
52.65216
51.87929
50.88092
49.75353
48.59718
47.50505
46.55886
45.82979
45.37731
45.2439
45.45188
46.00245
46.87639
48.03593
49.42774
50.9867
52.6399
54.31176
55.93049
57.43231
58.76165
59.87382
60.73832
61.34049
61.68186
61.77944
61.66413
61.37834
60.97299
60.50414
60.02944
59.60463
59.28027
59.09893
59.09299

10000
10000
10000
10000
10000
10000
10000
10000
60000
60272.458
60170.695
59382.231
57876.157
55716.87
52995.32
49804.229
46229.681
42348.771
38229.439
33931.051
29505.19
24996.474
20404.257
15769.178
11285.935
7188.0172
3695.4806
989.91381
-799.2141
-1584.158
-1388.939
-318.4445
1512.0335
4004.9882
7015.6543
10353.076
13808.181
17171.02
20244.709
22857.135
24870.421
26187.868
26752.365
26566.488
25703.168
24241.512
22271.289
19921.457
17344.349
14701.833
12153.985
9849.1553
7915.4276
6453.7099
5532.7605
5186.3381
5412.5587
6175.4079
7408.2335
9018.9299
10896.44

10000
10000
10000
10000
10000
10000
10000
10000
26000
26000
26000
26000
26000
26000
26000
26000
26000
26000
26000
26000
26000
24996.47
20404.26
15769.18
11285.93
7188.017
3695.481
989.9138
0
0
0
0
1512.033
4004.988
7015.654
10353.08
13808.18
17171.02
20244.71
22857.14
24870.42
26000
26000
26000
25703.17
24241.51
22271.29
19921.46
17344.35
14701.83
12153.98
9849.155
7915.428
6453.71
5532.761
5186.338
5412.559
6175.408
7408.233
9018.93
10896.44

Page EX-49
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

36.5
37
37.5
38
38.5
39
39.5
40
40.5
41
41.5
42
42.5
43
43.5
44
44.5
45
45.5
46
46.5
47
47.5
48
48.5
49
49.5
50
50.5
51
51.5
52
52.5
53
53.5
54
54.5
55
55.5
56
56.5
57
57.5
58
58.5
59
59.5
60

84.92488
85.1054
85.51688
86.12567
86.88766
87.75131
88.66103
89.56069
90.39694
91.12231
91.69784
92.09505
92.2972
92.2999
92.11081
91.74877
91.2422
90.62704
89.9443
89.2374
88.54954
87.92104
87.38712
86.97594
86.70725
86.5915
86.62959
86.8132
87.12564
87.5432
88.03679
88.57395
89.12088
89.64454
90.11454
90.50494
90.79553
90.97288
91.03086
90.97068
90.80058
90.53505
90.19369
89.79988
89.37919
88.95781
88.56094
88.21132

EX Listing (10-5
'These functions must be modified for actual problem usage
'Written by EMRosen 6/19/97
'Copyright (c) by EMR Technology Group
'Permission is granted for educational use by
'Departments of Chemical Engineering

85.3131
84.99476
84.93359
85.12315
85.54226
86.15687
86.92258
87.78771
88.6967
89.59351
90.42506
91.14424
91.71252
92.10188
92.29609
92.29121
92.09538
91.72777
91.21711
90.59952
89.91608
89.21021
88.52495
87.90042
87.37154
86.96615
86.70359
86.59395
86.63777
86.82639
87.14287
87.56326
88.05839
88.59573
89.14154
89.66287
90.12956
90.51586
90.80188
90.97445
91.02774
90.96325
90.78945
90.52103
90.17773
89.78301
89.36245
88.9422

89.41637
89.00848
88.62154
88.27784
87.99621
87.79104
87.67157
87.64157
87.69933
87.83793
88.04593
88.30817
88.60687
88.92273
89.23624
89.52874
89.78359
89.98706
90.12901
90.20337
90.20836
90.1464
90.02384
89.85037
89.63835
89.40196
89.15628
88.91635
88.69628
88.50842
88.36274
88.26628
88.22286
88.233
88.29399
88.40018
88.54345
88.7138
88.89997
89.09024
89.27307
89.43783
89.5754
89.67863
89.74269
89.7653
89.74674
89.68974

59.28305
59.67721
60.27106
61.04842
61.98281
63.0394
64.17741
65.35284
66.52114
67.63997
68.67159
69.58496
70.35731
70.97522
71.43498
71.7425
71.91255
71.96752
71.93579
71.84983
71.74405
71.65269
71.6078
71.63738
71.76389
72.00311
72.36348
72.84587
73.4438
74.14419
74.92832
75.7732
76.65315
77.54137
78.41163
79.23981
80.00524
80.69182
81.28879
81.79117
82.1998
82.52112
82.76652
82.95147
83.09446
83.21573
83.33605
83.47543

12918.135
14957.589
16892.287
18610.784
20018.926
21044.8
21642.15
21792.134
21503.373
20810.354
19770.357
18459.138
16965.673
15386.331
13818.822
12356.31
11082.026
10064.689
9354.9687
8983.1697
8958.2217
9267.9854
9880.8062
10748.171
11808.269
12990.207
14218.597
15418.242
16518.615
17457.891
18186.295
18668.606
18885.684
18834.986
18530.061
17999.114
17282.739
16431.012
15500.127
14548.797
13634.65
12810.826
12122.986
11606.87
11286.56
11173.494
11266.281
11551.291

12918.13
14957.59
16892.29
18610.78
20018.93
21044.8
21642.15
21792.13
21503.37
20810.35
19770.36
18459.14
16965.67
15386.33
13818.82
12356.31
11082.03
10064.69
9354.969
8983.17
8958.222
9267.985
9880.806
10748.17
11808.27
12990.21
14218.6
15418.24
16518.62
17457.89
18186.3
18668.61
18885.68
18834.99
18530.06
17999.11
17282.74
16431.01
15500.13
14548.8
13634.65
12810.83
12122.99
11606.87
11286.56
11173.49
11266.28
11551.29

Page EX-50
'Proportional Control and Limits on q
'prm(1) -rhoVCp -kJ / C
'prm(2) -Tis -C
'prm(3) -taud -Min
'prm(4) -Kc -b kJ/min-C
'prm(5) -WCp -kJ / Min - C
'prm(6) -Tr -C
'prm(7) -taum -Min
'prm(8) -tauI -Min
'x - time
'y1 -T
'y2 - To
'y3 - Tm
'y4 - errsum

Public Function fff1(x, y1, y2, y3, y4, y5, prm)

ti = prm(2)
step = 1
If x < 10 Then
step = 0
End If
tr = prm(6) + step * 10
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (tr - y3)
qlim = q
If q < 0 Then
qlim = 0
End If
If q > 26000 Then
qlim = 26000
End If

dTdt = (prm(5) * (ti - y1) + qlim) / prm(1)


fff1 = dTdt
End Function
Public Function fff2(x, y1, y2, y3, y4, y5, prm)
ti = prm(2)
step = 1

Page EX-51
If x < 10 Then
step = 0
End If
tr = prm(6) + step * 10
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (tr - y3)
qlim = q
If q < 0 Then
qlim = 0
End If
If q > 26000 Then
qlim = 26000
End If

dTdt = (prm(5) * (ti - y1) + qlim) / prm(1)

fff2 = (y1 - y2 - (prm(3) / 2) * dTdt) * 2 / prm(3)

End Function
Public Function fff3(x, y1, y2, y3, y4, y5, prm)
fff3 = (y2 - y3) / prm(7)
End Function
Public Function fff4(x, y1, y2, y3, y4, y5, prm)
step = 1
If x < 10 Then
step = 0
End If
tr = prm(6) + step * 10
fff4 = tr - y3
End Function
Public Function fff5(x, y1, y2, y3, y4, y5, prm)
fff5 = 0
End Function
Public Function qqlim(x, y1, y2, y3, y4, y5, prm, nr)
'nr = 1 gives q
'nr = 2 gives qlim

Page EX-52

ti = prm(2)
step = 1
If x < 10 Then
step = 0
End If
tr = prm(6) + step * 10
qs = prm(5) * (prm(6) - prm(2))
q = qs + prm(4) * (tr - y3)
qlim = q
If q < 0 Then
qlim = 0
End If
If q > 26000 Then
qlim = 26000
End If
If nr = 1 Then
qqlim = q
Exit Function
End If

If nr = 2 Then
qqlim = qlim
Exit Function
End If

End Function

Page EX-53
EX Figure (10-5)
Dynamics of a Heat Tank for P Control with Limits on q
100

Temp)erature (deg C)

95

90

85
T
To
Tm

80

75
0

10

20

30

40

50

60

70

80

90

100

Time (min)

EX Figure (10-6)
Dynamics of a Heated Tank for P Control with Limits on q
70000

Value of q and qlim (KJ/min)

60000
50000
40000
q
qlim

30000
20000
10000
0
-10000
0

10

20

30

40

50
Time (min)

60

70

80

90

100

Page EX-54
References
1. Cutlip, M. B., J. J. Hwalek, H. E. Nuttall and M. Shacham, The Use of Mathematical
Software Packages in Chemical Engineering Presented at the Chemical Engineering Summer
School at Snowbird Utah, August 13, 1997.
2. Cutlip, M. B. and M. Shacham, Polymath Solutions to the Chemical Engineering Problem
Set Presented at the Chemical Engineering Summer School at Snowbird, Utah, August 13,
1997.

Вам также может понравиться