Biomedical Engineering Reference
In-Depth Information
by default, you only need to change the lines between
“Sub Func(f, ByVal x As Double, ByVal y, Optional c)” and “End Sub.”
In between these lines, you are to input the differential equations. You will need to write
each equation separately on a different line. In the example shown in the code, there are two
differential equations:
d
y 1
d
ð
Þ¼
ð1Þ
ð
Þ
x ¼ f 1 ¼ c 1 y 1
f
1
c
y
1
0
f 2 ¼
c 2 þ
c 3
y 2 ^ c 4 0:1
y 1 0
d
y 2
d
x ¼ f 2 ¼ c 2 x þ c 3 y c 4
2 0:1y 1
where c j 's are reserved as parameters (i.e. true constants) that one can pass from excel work-
sheet to the visual basic program at run time. This gives us freedom to make each code to be
more general and thus capable of solving a class of problems. When you change the values of
c j 's, the solution to the set of equations changes. You will not need to change the visual basic
code just for the different values of c j 's.
Example 4-8. Concentration profile for a series reaction with feedback regulation. A liquid
reaction system is carried out in a batch reactor:
A ! B ! C
(E4-8.1)
with
k 1 C A
K 1 þ C A þ K C C C
r 1 ¼
(E4-8.2)
k 2 C B
K 2 þ C B
r 2 ¼
(E4-8.3)
1 mol $ L 1
$ h 1 , k 2 ¼
0.5 mol $ L 1
$ h 1 , K 1 ¼
0.1 mol $ L 1 , K 2 ¼
0.2 mol $ L 1 , and
where k 1 ¼
K C ¼
100.
Find the change of concentrations of A, B, and C as a function of time between 0 and 100 h
in a constant volume isothermal batch reactor starting with
a. pure A initially at C A0 ¼
10 mol $ L 1 ;C B0 ¼
0 mol $ L 1
C C0 ¼
10 mol $ L 1 ,C B0 ¼
0 mol $ L 1 ,C C0 ¼
10 mol $ L 1
b. C A0 ¼
Solution. This is a set of two reactions occurring in series. Mole balance for species j leads to
d
n j
d
t ¼ r j V
(E4-8.4)
Since the volume is constant, we have
d C j
d
¼ r j
(E4-8.5)
t
We next find the rates of reaction ( Fig. E4.8-1 ). Applying Eqn (3.66), we obtain
r A ¼ n 1A r 1 þ n 2A r 2
¼r 1 ¼ k 1 C A
K 1 þ C A þ K C C C
(E4-8.6)
Search WWH ::




Custom Search