This model does not use physiologically based parameters.
Figure 1: Washout: Fig1 parameter set
Figure 1 is a combined plot of Cout (red solid), Area_out
(dashed blue), Tbar_out (dashed orange), and analytic
calculation of Area_out (dashed green) as a
function of time.
The parameters for this run are
C0 = 1 mM (concentration in the compartment at time = 0),
F = 0.01 ml/sec (flow),
V = 0.05 ml (volume),
G = 0 ml/sec (clearance rate) and
Cin = 0 (the inflowing concentration).
The mean transit time through the chamber is V/F = 5 seconds
which equals the transit time of the outflow concentration
since the transit time of the inflow concentration is zero.
This means that the solution should fall to 1/e of its
original value in 5 seconds. Using the text button, we find
that C(t=5 seconds) = .36787944 mM which is correct to all 8
digits.
The area of the outflow concentration approaches 5 mM*sec
(4.999693 mM*sec) confirming that
Area_out=
/infinity V*C0
| C(t) dt = ----, when G=0.
/ 0 F
Verify that when G>0,
/infinity V*C0
| C(t) dt = ----, when G>0
/ 0 F+G
by setting C0=2 and G=0.03. The answer should be
Area_out = 2.5 mM*sec.
Plotpage ConcStat:
Figure 2A: Concentrations: Fig2 parameter set
Figure 2B: Areas: Fig2 parameter set
Figure 2C: Area Ratio: Fig2 parameter set
Figure 2D: Tbar's: Fig2 parameter set
Load the Fig2 parameter set and run the model. The following
parameters have been set:
C0 = 0.0 mM (initial concentration at time = 0. )
F = 0.01 ml/sec (flow),
V = 0.05 ml (volume),
G = 0 ml/sec (clearance rate) and
Cin = The Lagged Normal input function use the function
generator, fgen_1. (the inflowing concentration).
Al plots are functions of time.
Figure 2A shows Cin and the more dispersed Cout.
Figure 2B shows the corresponding areas from integration. It
is seen that both approach the same value.
Figure 2C shows the ratio of Area_out divided by Area_in. It
shows that the ratio approaches 1 demonstrating
that the integrated inflow concentration must
equal the integrated outflow concentration in the
absence of decay (clearance).
Figure 2D shows the transit times of Cin, Cout, and the
system. The transit time of the system approaches
V/F = 5 seconds.
Figure 3: Fraction Remaining and Consumed: Fig3 parameter set
The black solid line is the fraction consumed (or cleared).
The red solid line is the fraction remaining.
Load the Fig3 parameter set and run the model. The following
parameters have been set:
C0 = 1.0 mM (initial concentration at time = 0. )
F = 0.00 ml/sec (flow),
V = 0.05 ml (volume),
G = 0.01 ml/sec (clearance rate) and
Cin = 0.0 mM.
The time to reach C=C0/e is 5 seconds as before, and the
fraction of C consumed is C0*(1-1/e).
Figure 4: Steady State with Cin constant: Fig4 parameter set
The numeric, analytic, and steady state solutions are plotted
as a function of time.
C0=0.6 mM,
F = 0.01 ml/sec,
G=0.01 ml/sec,
V=0.05,
Cin = 1.0 mM (constant).
The concentration of C(t) levels
off at 0.5 mM. This is because the clearance rate equals
the flow so that half is consumed during the time that
C is in the compartment.
Run loops with G=0.01, 0.005, and 0.015 ml/sec. The results
are
G ml/sec C(t=60) mM
0.005 0.666
0.010 0.500
0.015 0.400
The steady state solution for the equation
dC(t)/dt = (F/V)*(Cin-C(t))-(G/V)*C(t)
when Cin is constant is
C(t) = F*Cin/(F+G), after about 10 seconds.
This value does not depend on C0, except when F and
G are both zero. If F and G are both zero, the
steady state value is
C(t) = C0 for all time.
/* MODEL NUMBER: 0242
MODEL NAME: Comp1FlowDecay
SHORT DESCRIPTION: Models single compartment with inflowing and
outflowing concentration of a single substance which undergoes decay.
Does not use physiological units.
*/
import nsrunit; unit conversion on;
math Comp1FlowDecay {
// INDEPENDENT VARIABLE
realDomain t sec; t.min=0; t.max=40; t.delta=0.1;
// PARAMETERS
real C0 = 0 mM, // Initial Concentration
V = 0.05 ml, // Volume of compartment
F = 0.01 ml/sec, // Flow rate (volume per second)
G = 0.01 ml/sec; // Consumption rate of C, defined as a clearance,
// or the flow of fluid cleared of C per unit time
extern real Cin(t) mM; // Inflowing concentration (defined with
// function generator)
// VARIABLES
real C(t) mM, // Concentration in compartment
Cout(t) mM; // Outflowing concentration NOTE that Cout=C
// because compartment instantaneously well mixed.
// INITIAL CONDITION
when(t = t.min) C=C0;
// ORDINARY DIFFERENTIAL EQUATION
C:t = (F/V)*(Cin-C)-(G/V)*C;
Cout = C;
// ADDITIONAL CALCULATIONS
// ANALYTIC SOLUTION FOR CONSTANT INFLOW CONCENTRATION
real Canalytic(t) mM;
Canalytic=((F*Cin)-(F*(Cin-C0)-G*C0)*exp(-(F+G)*t/V) )/(F+G);
// QUANTITY OF SUBSTANCE FROM TWO DIFFERENT CALCULATIONS
real Q(t) nmol, // Quantity = Volume* Concentration
Qint(t) nmol; // Quantity = integral of Flow multiplying inflow
// concentration minus outflow concentration
Q = V*C;
when (t=t.min) Qint=V*C0;
Qint:t = F*(Cin-Cout)-G*C;
// AREA AND TRANSIT TIME OF INFLOW AND OUTFLOW CONCENTRATIONS
private real TCin(t) mM*sec^2, TCout(t) mM*sec^2; // First moments
real Area_in(t) mM*sec, Area_out(t) mM*sec, // Areas
Tbar_in(t) sec, Tbar_out(t) sec, Tbar_sys(t) sec;
// Transit times
when(t=t.min) {Area_in = 0; TCin = 0;
Area_out = 0; TCout = 0; }
Area_in:t = Cin; // Running integral of inflow concentration
Area_out:t = Cout; // Running integral of outflow concentration
TCin:t = Cin*t;
TCout:t = Cout*t;
Tbar_in = if(Area_in>0) TCin /Area_in else 0;
Tbar_out = if(Area_out>0) TCout/Area_out else 0;
Tbar_sys = Tbar_out-Tbar_in; // System transit time
} // End of code.
/* Diagram
+-----------------------------+
F*Cin ---> G (decay) C ---> F*Cout
(flow) | V(volume) | Cout = C
| instantaneously well mixed |
+-----------------------------+
DETAILED DESCRIPTION:
A Flow carries an inflow concentration, Cin, into a
one compartment model with a given Volume. Cin is constantly
and instantaneously well mixed becoming C, the concentration
in the compartment. C empties out of the compartment and is
designated Cout. G is a clearance rate.
For a constant concentration of inflowing material
the analytic solution is given.
SHORTCOMINGS/GENERAL COMMENTS:
- None.
KEY WORDS:
Course, compartment, compartmental, tutorial, flow, decay, clearance,
Comp1FlowDecay
REFERENCES: None.
REVISION HISTORY:
08/09/11 M. Herrmannsfeldt: Added analytic solution to
SteadyState plotpage. Other minor changes.
JSim SOFTWARE COPYRIGHT AND REQUEST FOR ACKNOWLEDGMENT OF USE:
JSim software was developed with support from NIH grants HL088516,
and HL073598. Please cite these grants in any publication for which
this software is used and send one reprint of published abstracts or
articles to the address given below. Academic use is unrestricted.
Software may be copied so long as this copyright notice is included.
Copyright (C) 1999-2009 University of Washington.
Contact Information:
The National Simulation Resource,
Director J. B. Bassingthwaighte,
Department of Bioengineering,
University of Washington, Seattle, WA
98195-5061
*/