Figure 1: RUN LOOPS: (Default parameter set)
The concentration of C in mM is ploted as a
function of time in seconds.
Note the G/V = (-3 ml/min)/(0.05 ml) = -1/sec.
Therefore at time = 1 second, C(1 sec) = exp(-1).
Run LOOPS. When G=3 ml/sec, C(1 sec) = exp(1).
Change the Y vaxis to Log (check box).
/* MODEL NUMBER: 0230
MODEL NAME: CompDecayTutorial
SHORT DESCRIPTION: Models single compartment with
decay, no change, or synthesis of substrate. */
import nsrunit; // enables units in the model
unit conversion on; /* Checks equations for
dimensional compatibility. */
math CompDecayTutorial {
// INDEPENDENT VARIABLE
realDomain t s; t.min=0; t.max=3; t.delta=0.1; // units are seconds
// PARAMETERS
real C0 = 1 mM, // Initial Concentration
V = 0.05 ml, // Volume
G = -3.0 ml/min; // Decay rate
// DEPENDENT VARIABLES
real C(t) mM, // Numeric Solution concentration
analyticC(t); // Analytic Solution concentration
// INITIAL CONDITION
when(t=t.min) C=C0;
// ORDINARY DIFFERENTIAL EQUATION
C:t = (G/V)*C;
// ANALYTIC SOLUTION
analyticC = C0*exp((G/V)*t);
} // END
/*
FIGURE:
+--------------------------------------+
| V C(t) |
| |
| G |
+--------------------------------------+
DETAILED DESCRIPTION:
This is a tutorial model for decay (G<0), no change
(G=0), or synthesis (G>0). This is a single compartment
model.
KEY WORDS:
Course, compartment, compartmental, tutorial, synthesis,
constant, decay
REFERENCES: None.
REVISION HISTORY:
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
*/