Howard Hughes Medical Institute 2014 Math Inquiry Workshop

advertisement
Howard Hughes Medical Institute
2014 Math Inquiry Workshop
Compartment Models
Introduction
When analyzing certain systems in the natural or social sciences, people encounter many problems
that are classified as compartment problems or mixing problems.
This class of modeling applications will be introduced through a simple example involving a single
compartment as shown in Figure 1. The compartment contains a solution of brine (salt dissolved in
water) whose variable concentration c(t) is measured in units of grams per liter (mass per volume).
Fluid enters the compartment at a flow rate labeled Rin and leaves the compartment at the rate Rout .
The rates are measured in units of volume per time. In this case, they are given as liters per second.
The in- and out-flows have a brine concentration associated with each. The in-flow concentration is cin ,
and the outflow concentration is cout both given in gm/L. The objective of the model is to track the
brine concentration c(t) in the tank as a function of time t. One other consideration is the volume V (t)
of brine in the take. This quantity may is a function of time if the in- and out-flow rates are not the
same.
Figure 1: Compartment with in- and out-flows.
The known quantities are Rin , cin , Rout . The initial setup will be made simpler by assuming the inand out-flows are constant and equal, Rin = Rout . This means V is constant, and c(t) = x(t)/V , where
x(t) is the mass of salt (in gm) in the compartment as a function of time. The quantity x(t) will be
modeled in this case. A common assumption with mixing versions of compartment models is that the
brine solution is well-mixed so that c(t)/V represents the brine concentration at every location in the
tank, including the exit tube.
The following principle, common to all (or most) compartment problems, is
the rate of change of x(t) = rate of x in − rate of x out
(1)
The rate of change of x with respect to time t has units gm/min. Consequently, any expression used to
represent either term on the right-hand-side of Equation (1) must have these units. This is a necessary
condition, but not sufficient. There are any number of expression that could be used that have the
correct units. However, having the correct units does not make the expression correct. Having incorrect
units does make the expression incorrect. So, the use of “units” is a guide to possible correct expressions.
In many modeling endeavors, an expression is often determined to be “correct” only after testing the
model in various ways including comparing modeled results with observed or measured results. See
Exercise 1 for an example of how a model can be tested for viability.
For the rate of x in, consider using the two known in-flow quantities in the following way
rate of x in = Rin · cin
|{z} |{z}
L gm
min L
and note that this product results in an expression with the correct units because the volume unit L is
eliminated in the “product of units” shown under the braces.
A similar expression for the rate of x out will be considered. That is
rate of x out = Rout · cout
|{z} |{z}
gm
L
min L
The catch here is that the quantity cout is not known. However, using the assumption of a well-mixed
solution, it may be expressed in terms of the unknown x(t) and the volume V of the compartment so
that
x(t)
rate of x out = Rout ·
|{z} V
|{z}
L
gm
min L
Putting the terms together, the final model equation results
the rate of change of x(t) =
Rout
dx
= Rin · cin −
· x(t)
dt
V
(2)
Exercises
1. Equation (2) was derived assuming Rin = Rout so that the compartment volume V is constant.
(a) Simply Equation (2) using the fact that Rin = Rout = R. The result should be in terms of R.
(b) Use the simplified version of Equation (2) found in Exercise 1a to determine the condition
x(t)
that would make dx
dt zero. What is the resulting value for V ? Does it make sense? Why or
why not? This value of x(t), or c(t), is referred to as an equilibrium solution.
2. Rin = Rout . Use Google Sheets or Sage to solve the following compartment problem using Equation
(2) and the following values: Rin = Rout = 4L/min, V = 10 L, cin = 3gm/L, x(0) = 5gm.
(a) Make a plot of x(t) versus t for 0 ≤ t ≤ 10
(b) Make a plot of c(t) versus t for 0 ≤ t ≤ 10
(c) How long does it take c(t) to get within 90% of its equilibrium solution?
(d) Determine the minimum flow rate required to get c(t) with 90% of its equilibrium value in 5
minutes.
3. Rin ̸= Rout . Consider the following compartment problem using Equation (2) and the following
values: Rin = 4L/min, Rout = 3L/min, V0 = 10 L, cin = 3gm/L, x(0) = 5gm. The capacity of the
compartment is 20 L.
(a) With unequal rates (in and out), the volume V of the tank is not constant. Express V (t) in
terms of V0 , Rin , Rout , and time t.
(b) Use Google Sheets or Sage to determine the brine concentration the instant the tank is full.
(c) Suppose Rin = 3L/min and Rout = 4L/min, with all other values the same as in Exercise 3b.
What is the concentration of the last drop of brine to leave the tank?
(d) Under what circumstances, if any, is there an equilibrium solution in the case of unequal flow
rates? If so, what is the equilibrium solution? Test your answer using your Google Sheets or
Sage worksheet.
Download