Differential Equations Project

Computer Lab Modules

 

The Compartment Model

 

 

Background. The matrix A has [Graphics:e14.txtgr1.gif] as an eigenvalue, with the associated eigenvector [Graphics:e14.txtgr2.gif] provided [Graphics:e14.txtgr3.gif].

 

Computer Lab Work.

 

Exercise 1. Use Mathematica to find the eigenvalues and eigenvectors of the matrix A.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr4.gif]

Construct the characteristic polynomial for the matrix.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr6.gif]

There are several ways to find the roots of a polynomial. Try these three ways.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr7.gif]

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.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr8.gif]

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.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr9.gif]
 

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]

 

Exercise 2. Find the solution to the "three-stage system" where
[Graphics:e14.txtgr11.gif]
with the initial conditions
[Graphics:e14.txtgr12.gif].
Plot the solution curves for [Graphics:e14.txtgr13.gif] for 0 <= t <= 20.
From your observations what do you conjecture about the sum [Graphics:e14.txtgr14.gif]

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr15.gif]

The three vector eigenfunctions and the general solution are:

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr16.gif]

The following calculation will verify that X[t] is the general solution.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr17.gif]

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].

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr18.gif]

Extract the three coordinate functions from Y[t] and call them y1[t], y2[t], y3[t].

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr19.gif]

Plot the functions to see how the solute moves through the system of tanks.
Plot the function y1[t].

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr20.gif]

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 [Graphics:e14.txtgr21.gif]. Plot the graph of the sum over the interval 0 <= t <= 40.

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr22.gif]

What is the limit of the sum [Graphics:e14.txtgr23.gif] ?
Did you suspect that this was going to happen ?
Why should you expect this to happen ?

[Graphics:e14.txtgr5.gif][Graphics:e14.txtgr24.gif]
 

Solutions.


Return to the Differential Equations Project

Return to the Numerical Analysis Project

Return to the Complex Analysis Project

 




























(c) John H. Mathews, 1998