You are on page 1of 6

Chapter 2 Solutions

Euler integration vs. ode45


40.8

2.1

40.7

40.6

Outlet Temperature C

The modeling equation is

dP
RT
RT 
=
qi
P Ph
dt
V
V
At steady state
dP
RT
RT 
=
qi
P Ph = 0
dt
V
V
RT 
RT
Ps Phs =
qis
V
V
q2
Ps = Phs + is2

40.5

40.4

40.3

40.2

40.1
ode45
Euler
40

0.2

0.6

0.8

1
Time min

1.2

1.4

1.6

1.8

Figure 2-2: Plot for 2.2

Thus we can conclude that it is a selfregulating system, as for a change in input it will attain a new
steadystate.
The sketch of the steadystate inputoutput curve
should look like gure 2-1.

the inlet and outlet ow rates are the same. Thus


Fi
(Ti T ) + Q = 0
V
100
(20 40) + Q = 0
500
Q = 4 C/min

Steadystate inputoutput curve


30

b. For this part we need to integrate

25

Ps

0.4

20

100
dT
=
(22 T ) + 4
dt
500

15

from an initial state of T = 40 C. The Euler


formula is
xk+1 = xk + txk

10

xk = f (xk )
5

0.5

1.5

2.5
q

3.5

4.5

where f () is the right hand side of the dierential equation, and x is the state, in this case T .
Using t = 0.5, and for a total of 2 minutes, we
have

is

Figure 2-1: Plot for 2.1

x0 = 40
x1

2.2

x2

The model equations are

x3

dV
= Fi F
dt
dT
Fi
= (Ti T ) + Q
dt
V

x4

a. At steadystate, the volume will not change, as


2-1


1
(22 40) + 4 = 40.2
= 40 + 0.5
5


1
(22 40.2) + 4 = 40.38
= 40.2 + 0.5
5


1
(22 40.38) + 4 = 40.542
= 40.38 + 0.5
5


1
(22 40.542) + 4 = 40.6878
= 40.542 + 0.5
5


Figure 2-2 shows the curve of the solution found


using matlabs ode45, with the circles marking
the points of the Euler solution.

2.3

solving at steadystate, we get

CAi
Since the model equations have only two states, Vl
CP 1s = Fs s
and P , we have to assume the following are constant:
kV + 1
density of the liquid (), temperature (T ), the ideal
gas constant (R) and the molecular weight of the gas We need to meet a yearly production, so our nal
constraint is
(M W ).
Starting with the balance of the liquid mass in the
Fs CP 1s S = 100x106 lb/yr
system, we have
Where S = 62lb/lbmol 504000min/yr is our converdVl
dMl
=
= Ff F
sion factor, assuming 350 days of operation in a year.
dt
dt
Then,
dVl
CAi
= Ff F
Fs Fs s S = 100x106 lb/yr
dt
kV + 1
For the balance of the mass of gas
solving for the owrate, we get Fs = 7.9256ft3 /min.
Now we need to consider the second reactor in sednM W
= qi M Wi qM W
ries,
which will also change the owrate needed to
dt
meet production levels. The equations for the second
dn
= qi q
reactor are
dt
F
dCA2
= (CA1 CA2 ) kCA2
dt
V
F
dCP 1
= (CP 1 CP 2 ) + kCA2
dt
V

From the ideal gas law P Vg = nRT , where the volume of gas is Vg = V Vl Then,
d(P Vg )
nRT
=
dt
dt
dn
d(V Vl )
dP
+ (V Vl )
= RT
P
dt
dt
dt
and using the previously derived expressions for
and Vdtl
P

dn
d(V Vl )
dP
+ (V Vl )
= RT
dt
dt
dt
dVl
dP
+ (V Vl )
= RT (qi q)
P
dt
dt
P
RT
dP
=
(Ff F ) +
(qi q)
dt
V Vl
V Vl

Thus our model equations are


dVl
= Ff F
dt
P
RT
dP
=
(Ff F ) +
(qi q)
dt
V Vl
V Vl

2.4

dn
dt

Solving at steadystate, we get


 

kV
kV
+
2
CAis
Fs
Fs
CP 2s =

2
kV
Fs + 1
Again, we need to meet production levels, so

kV

kV
Fs
kV
Fs

Fs CP 2s S = 100x106 lb/yr

+ 2 CAis
S = 100x106 lb/yr
2
+1

Solving for the owrate, we get Fs = 6.5799ft3 /min.


Thus we have a savings of 16.98% using the two reactors in series over a single one.

2.5
The resulting graph should be the same as gure 2-5,
except that the time range from -1 to 0 will not appear.

Since we have a larger volume than the example, we


have to calculate the ow rate for a single reactor as
2.6
well. Our volume is V = 106.9444ft3 . The equations
for the rst tank are
dCA1
F
= (CAi CA1 ) kCA1
dt
V
dCP 1
F
= CP 1 + kCA1
dt
V

d(V Ca )
= Fin CAin kV CA
dt
dV
= Fin
dt
2-2

We need equations whose states are V and CA , then


d(V Ca )
dt
d(V )
dCa
+ CA
V
dt
dt
dCa
V
dt
dCa
V
dt
dCa
dt

= Fin CAin kV CA
= Fin CAin kV CA
= CA

d(V )
+ Fin CAin kV CA
dt

= CA Fin + Fin CAin kV CA


=

Fin
(CAin CA ) kCA
V

and using the state and input variables as dened, we have






F
f1 

2

=
(C

C
)

kC
a11 =
wi
w1
w1 

x1 ss
Cw1 V1
ss
Fs
=
2kCw1s
V1




F
f1 

2
a12 =
=
(Cwi Cw1 ) kCw1 

x2 ss
Cw2 V1
ss
=0
a21

our two equations are


dV
= Fin
dt
Fin
dCa
=
(CAin CA ) kCA
dt
V

a22

2.7
a. The modeling equations are

b11

F
dCw1
2
=
(Cwi Cw1 ) kCw1
dt
V1
F
dCw2
2
=
(Cw1 Cw2 ) kCw2
dt
V2

b12

b. At steadystate we can solve the following equations


Fs
2
(Cwis Cw1s ) kCw1s
=0
V1
Fs
2
(Cw1s Cw2s ) kCw2s
=0
V2

b21

ss

Rearranging the rst equation, we have the


quadratic
2
+
kCw1s

Fs
Fs
Cw1s
Cwis = 0
V1
V1

b22

ss

1
=
(Cw1s Cw2s )
V2




F
f2 

2
=
=
(Cw1 Cw2 ) kCw2 

u2 ss
Cwi V2
ss
=0

the positive root gives us


Cw1s = 0.33333 mol/liter
Rearranging the second equation, we have the
quadratic
2
+
kCw2s





F
f2 

2
=
=
(Cw1 Cw2 ) kCw2 

x1 ss
Cw1 V2
ss
Fs
=
V2




F
f2 

2
=
=
(Cw1 Cw2 ) kCw2 

x2 ss
Cw2 V2
ss
Fs
=
2kCw2s
V2




F
f1 

2

=
=
(C

C
)

kC
wi
w1
w1 

u1 ss
F V1
ss
1
=
(Cwis Cw1s )
V1




F
f1 

2
=
=
(Cwi Cw1 ) kCw1 

u2 ss
Cwi V1
ss
Fs
=
V1




F
f2 

2

=
=
(C

C
)

kC
w1
w2
w2 

u1
F V2

Fs
Fs
Cw2s
Cw1s = 0
V2
V2

the positive root gives us


Cw2s = 0.0900521 mol/liter

d. Evaluating these coecients at our steadystate,


we have


1.25 hr1
0
A=
0.05 hr1 0.320156 hr1


2
0.0016667 mol/l
0.25 hr1
B=
2
0.000121641 mol/l
0
e. Since y = x, it is

1
C=
0

c. To linearize, we have the functions


F
dCw1
2
=
(Cwi Cw1 ) kCw1
dt
V1
F
dCw2
2
=
f2 =
(Cw1 Cw2 ) kCw2
dt
V2

f1 =

straightforward to show that





0
0 0
D
=
1
0 0

f. Using matlab, the eigenvalues are 0.320156


and 1.25.
2-3

analytically, we have

det

then
U A = 183.9 Btu/( Fmin)

det (I A) = 0

0
=0
+ 0.320156

+ 1.25
0.05

Fjs = 1.5 ft3 /min

( + 1.25)( + 0.320156) = 0
thus the eigenvalues are 1 = 1.25 and 2 =
0.320156
g. Figure 2-3 shows the plot for the linear and nonlinear responses; as it can be seen, the extraction
requirements are still met.
Response to a 10 l/min step change from steady state
0.355

Cw1 mol/l

0.35
0.345
0.34
0.335
0.33

c. heater.m le should be like the example in the


book (p. 73)

nonlinear
linear
0

10
time (hrs)

12

14

16

18

d. Using delJ = 0, run ode45 to solve the equations dened in heater.m, then plot the two
states vs. time. The result should be constant
values that match the steady states for all time.

0.096

Cw2 mol/l

b. Applying the equations for the elements of the


linearization matrices
 


0.4 0.3
a11 a12
=
a21 a22
1.2 1.8


0 7.5 0.1 0
B=
20
0
0 0.6


1 0
C=
0 1


0 0 0 0
D=
0 0 0 0

0.094

0.092
nonlinear
linear
0.09

10
time (hrs)

12

14

16

18

Figure 2-3: Plot for 2.7g


h. If the order of the reaction vessels is reversed,
the steadystate equations we have to solve are
Fs
2
(Cwis Cw1s ) kCw1s
=0
V2
Fs
2
(Cw1s Cw2s ) kCw2s
=0
V1

e. To get the desired plots for the two step responses, the mle shown in pages 74-75 can
be used, starting with the denition of the state
space linear model. Since the model is linear,
the output of the step response command can be
scaled accordingly for steps of dierent sizes by
just multiplying by delFj. Figures 4(a) and 4(b)
show the responses for a small (0.2% change in
Fj ) and a large (10% change in Fj ) steps, respectively.
f. Since we know U A for the small vessel, and we
are assuming that U remains constant, we can
nd the value of U A for a larger volume as

solving then we get Cw1s = 16 mol/l and Cw2s =


0.10301 mol/l. Thus, the extraction requirements are no longer met.

2.8
a. Solve the following two simultaneous equations
using the parameters and steadystate values
provided:

U Asmall

Alarge
= U Alarge
Asmall

Modeling the vessel as a cylinder, the volume is


V = 2 D3 , and the area is A = 2.25D2 . We can
then calculate the area of the small vessel as a
function of its volume, for which we get

Asmall = 2.25

20

 23

Similarly, we have the area of the larger vessel in


terms of its volume

2
2V 3
Alarge = 2.25

Fs
UA
(Tis Ts ) +
(Tjs Ts ) = 0
V
V cp
Fjs
UA
(Tjins Tjs )
(Tj s Ts ) = 0
Vj
Vj j cpj
2-4

then

nonlinear vs. linear, small step, V=10 ft3

125.06

Tjs = 178.86 F

125.04

Fjs = 35.478 ft3 /min

temp F

125.08

125.02
nonlinear
linear
125

10

15
time (min)

20

25

10

15
time (min)

20

25

We can already see that the steadystate jacket


temperature has gone up, so we want to know
how large we can make the vessel before the
jacket temperature approaches the inlet jacket
temperature. We can solve the following equation, using FVs = 0.1 min1 , as we want to maintain the residence time. We also use the expression in terms of the volume that we found in
part f

30

150.1

jacket temp F

150.08
150.06
150.04
150.02
150

nonlinear
linear
30

(a)

Fs
UA
(Tis Ts ) +
(Tj s Ts ) = 0
V
V cp
V
23
U Asmall 10
0.1 (Tis Ts ) +
(Tj s Ts ) = 0
V cp

nonlinear vs. linear, large step, V=10 ft3


127.5

temp F

127
126.5

then V = 270 ft3 .

126
125.5
125

nonlinear
linear
0

10

15
time (min)

20

25

h. Applying the equations for the elements of the


linearization matrices using the steady state for
the larger vessel, we have


0.2392 0.1392
A=
0.5570 1.9761

30

153.5

jacket temp F

153
152.5
152
151.5

151
nonlinear
linear

150.5
150

10

15
time (min)

20

25

30

(b)

Figure 2-4: Plot for 2.8e (a) small step of 0.2% (b)
large step of 10%

V
10

0
1

0.1
0


0 0
0 0

0
1.4191

The eigenvalues for the system with the large


vessel are at 1 = 0.1957 and 2 = 2.0197.
While for the system with the smaller vessel,
they are 1 = 0.1780 and 2 = 2.0220. They
are very close to each other, thus the speed of
the response will be similar for both vessels.

And the ratio of the areas is


Alarge
=
Asmall

0.75
0

1
C=
0

0 0
D=
0 0

0
B=
0.8456

 23

Applying this, we nd that


U Alarge = 853.588 Btu/( Fmin)
g. Solve the following two simultaneous equations
using the value of U A calculated for the large
vessel
Fs
UA
(Tis Ts ) +
(Tj s Ts ) = 0
V
V cp
UA
Fjs (Tjins Tjs )
(Tj s Ts ) = 0
j cpj

i. Figure 2-5 shows the response to a step of


0.1 ft3 /min. Comparing this to gure 4(a), we
can see that both linear model responses are
practically the same as the nonlinear model response. The change in temperatures is also minor, as the change in jacket ow rate is small
(0.2% of the steady state value in both cases).
j. Figure 2-6 shows the response to a step of 10% of
the steady state jacket ow rate. Comparing this
to gure 4(b), we can see that both linear model

2-5

nonlinear vs. linear, small step, V=100 ft3


125.035
125.03
temp F

125.025
125.02
125.015
125.01
nonlinear
linear

125.005
125

10

15
time (min)

20

25

30

178.93

jacket temp F

178.92
178.91
178.9
178.89
178.88
nonlinear
linear

178.87
178.86

10

15
time (min)

20

25

30

Figure 2-5: Plot for 2.8i


responses are close to the nonlinear model response, but there is an oset in the steady state.
The change in temperatures is also more marked,
and larger in the case of the smaller reactor, as
would be expected due to the smaller volume.
nonlinear vs. linear, large step, V=100 ft3

temp F

126

125.5
nonlinear
linear
125

10

15
time (min)

20

25

10

15
time (min)

20

25

30

181

jacket temp F

180.5
180
179.5
179
178.5

nonlinear
linear
30

Figure 2-6: Plot for 2.8j

2-6

You might also like