Module for the Compartment Model
Numerical Methods for O. D. E. using Mathematica. (c) John H. Mathews, 2003
The Compartment Model I.
The "compartment" model is used to describe the concentration of a dissolved substance in several compartments in a system. For example, the "three-stage system" consists of three tanks containing
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
. Then the differential equation for the system is
Example 1. Find the solution to the "three-stage system" where
with the initial conditions
.
Plot the solution curves for
for
.
Solution 1
The Compartment Model II.
Another "compartment" model is used to describe the concentration of a dissolved substance in several compartments in a system. For example, the "closed" three-stage system consists of three tanks containing
gallons of solute. The liquid flows at the rate r from 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 and back into the first tank at the rate r. We define the constants
. Then the differential equation for the system is
Example 2. Find the solution to the "closed" three-stage system where
with the initial conditions
.
Plot the solution curves for
for
.
Solution 2.
Research Experience for Undergraduates