![]()
![]()
Computer
Lab Modules![]()
The Compartment Model
Background. The
matrix A has
as an eigenvalue, with the associated eigenvector
provided
.
Computer Lab Work.
Exercise 1. Use Mathematica to find the eigenvalues and eigenvectors of the matrix A.
Construct the characteristic polynomial for the matrix.
There are several ways to find the roots of a polynomial. Try these three ways.
It is easy to see that the roots of P are the eigenvalues of A,
but what about the eigenvectors ?
It is best to use Mathematica to calculate both the
eigenvalues and eigenvectors, store them in L and V,
respectively.
Notice that the eigenvectors are stored in rows, which is contrary to the way we do things with pencil and paper. We can easily list and verify this fact with the following loop.
More Background. The
"compartment" model is used to describe the concentration of a
dissolved substance in several compartments in a system. For
Exercise, the "three-stage system" consists of three tanks containing
V1, V2, V3 gallons of solute. Pure water flows at the rate r into the
first tank and is mixed, then flows at the rate r into the second
tank and is mixed, then flows at the rate r into the third tank and
is mixed, and finally flows out of the third tank at the rate r.
We define the constants k1 = r/V1, k2 = r/V2, k3 = r/V3. Then the
differential equation for the system is
![[Graphics:e14.txtgr10.gif]](e14.txtgr10.gif)
Exercise 2. Find the solution
to the "three-stage system" where
![]()
with the initial conditions
.
Plot the solution curves for
for 0 <= t <= 20.
From your observations what do you conjecture about the sum
![]()
The three vector eigenfunctions and the general solution are:
The following calculation will verify that X[t] is the general solution.
Now solve for the constants using the initial conditions, and replace these values for the constants in X[t] and call the solution Y[t]. Then check out the initial condition Y[0].
Extract the three coordinate functions from Y[t] and call them y1[t], y2[t], y3[t].
Plot the functions to see how the solute moves through the system
of tanks.
Plot the function y1[t].
From your observations of the graphs, what do you conjecture about
the total amount of solute in the system at time t, i.e. what can you
say about the sum
.
Plot the graph of the sum over the interval 0 <= t <= 40.
What is the limit of the sum
?
Did you suspect that this was going to happen ?
Why should you expect this to happen ?
Return to the Differential Equations Project
Return to the Numerical Analysis Project
Return to the Complex Analysis Project
(c) John H. Mathews, 1998