To get a "tight" comparison, set t.max to 305 seconds,
and t.delta = 0.001 for both models.
BTEX_Pipe: Shows the conservation of volume of volume
(top Figure, green line), conservation of mass (middle
Figure, green line) and the concentrations in the two compartments
and average concentration in the pipe (bottom Figure) as functions
of time for BTEX10_OscillatingFlow model.
Comp_Pipe: Similar to plots for Comp1_OscillatingFlow model
where the BTEX10 pipe has been replace by a one compartment pipe.
Comparison: The concentrations for both models are plotted
with the BTEX10_OscillatingFlow results plotted as dashed red
lines.
// MODEL FOR VALIDATING BTEX10x2_CircularFlow
import nsrunit;
unit conversion on;
math Compx2_CircularFlow{
// INDEPENDENT VARIABLE
realDomain t sec; t.min=0; t.max=10; t.delta=0.01;
// PARAMETERS
real F = 3 ml/min, // Flow
V1 = 0.1 ml, // Volume for V1
V2 = 0.1 ml, // Volume for V2
Vm = 0.03 ml, // Pipe Volumes
Cp0 = 0 M, // Initial Amount in Pipes
A10 = 1 mmol, // Initial Amount in V1
A20 = 0 mmol; // Initial Amount in V2
// DEPENDENT VARIABLES
real A1(t) mmol, // Amount in V1
A2(t) mmol, // Amount in V2
AL(t) mmol, // Amount in pipe 1
AR(t) mmol; // Amount in pipe2
real C1(t) M, C2(t) M, CL(t) M, CR(t) M;
// INITIAL CONDITIONS
when(t=t.min) {A1=A10;
A2=A20;
AL=Cp0*Vm;
AR=Cp0*Vm; }
// ORDINARY DIFFERENTIAL EQUATIONS
A1:t = F*(CR-C1);
A2:t = F*(CL-C2);
AL:t = F*(C1-CL);
AR:t = F*(C2-CR);
// CALCULATE CONCENTRATIONS
C1=A1/V1;
C2=A2/V2;
CL=AL/Vm;
CR=AR/Vm;
}
/*
DIAGRAM:
Fixed Fixed Pipes Fixed
Volume V1(t) Volume Vm Volume V2(t)
---------- ----------
( ) --------------------- ( )
( C1(t) ----> COMPARTMENT PIPE 1 ----> C2(t) )
( ) --------------------- ( )
( <---- COMPARTMENT PIPE 2 <--- )
---------- ----------------------- ----------
This model consists of four compartmental models. There are
two well stirred tanks, connected by two smaller pipes. The
material circulates in a circular path.
*/
To get a "tight" comparison, set t.max to 305 seconds,
and t.delta = 0.001 for both models.
BTEX_Pipe: Shows the conservation of volume of volume
(top Figure, green line), conservation of mass (middle
Figure, green line) and the concentrations in the two compartments
and average concentration in the pipe (bottom Figure) as functions
of time for BTEX10_OscillatingFlow model.
Comp_Pipe: Similar to plots for Comp1_OscillatingFlow model
where the BTEX10 pipe has been replace by a one compartment pipe.
Comparison: The concentrations for both models are plotted
with the BTEX10_OscillatingFlow results plotted as dashed red
lines.
/* MODEL NUMBER:
// MODEL NUMBER: 0309
MODEL NAME: BTEX10x2CircularFlow
SHORT DESCRIPTION: Two single compartments use a circular flow
through a two pipes (BTEX10s) to exchange material.
Pipe 1 has flow to the right, pipe 2 has flow to the left.
*/
import nsrunit; unit conversion on;
math BTEX10x2CircularFlow {
// INDEPENDENT VARIABLES
realDomain t sec; t.min=0; t.max=10; t.delta=0.01;
real L = 0.1 cm, Ndiv=21;
realDomain x cm; x.min=0; x.max=L; x.ct=Ndiv;
// PARAMETERS
real F = 3 ml/min, // Circular Flow
V1 = 0.10 ml, // Volume for V1
V2 = 0.10 ml, // Volume for V2
Vm = 0.03 ml, // Volume of pipes
Cp0 = 0 M, // Initial Pipe Concentrations
A10 = 1 mmol, // Initial Amount in V1
A20 = 0 mmol, // Initial Amount in V2
D = 0.1 cm^2/sec; // Diffusion coefficient in pipes
// DEPENDENT VARIABLES
real A1(t) mmol, // Amount in V1
A2(t) mmol, // Amount in V2
AL(t) mmol, // Amount in pipe 1
AR(t) mmol, // Amount in pipe 2
CL(t,x) M, // Concentration in pipe 1
CR(t,x) M, // Concentration in pipe 2
CoutL(t) M, // Concentration at outflow
// at left (pipe 1)
CoutR(t) M; // Concentration at outflow
// at right (pipe 2)
real C1(t) M, C2(t) M;
// INITIAL CONDITIONS
when(t=t.min) {A1=A10;
A2=A20;
CL=Cp0;
CR=Cp0; }
// BOUNDARY CONDITIONS
when(x=x.min) {-F*L/Vm*(CL-C1) + D*CL:x=0; CR:x=0; CoutR=CR; }
when(x=x.max) { F*L/Vm*(CR-C2 ) + D*CR:x=0; CL:x=0; CoutL=CL;}
// ORDINARY DIFFERENTIAL EQUATIONS
A1:t = F*(CoutR-C1);
A2:t = F*(CoutL-C2);
// PARTIAL DIFFERENTIAL EQUATION FOR PIPE
CL:t = -F*L/Vm*CL:x + D*CL:x:x;
CR:t = F*L/Vm*CR:x + D*CR:x:x;
// CALCULATE AMOUNT IN PIPE AND CONCENTRATIONS IN V1 and V2
C1=A1/V1;
C2=A2/V2;
AL=Vm*sum(CL@x)/Ndiv;
AR=Vm*sum(CR@x)/Ndiv;
}
/*
DIAGRAM:
Fixed Fixed Pipes Fixed
Volume V1(t) Volume Vm Volume V2(t)
---------- ----------
( ) --------------------- ( )
( C1(t) ----> BTEX10 PIPE 1 ----> C2(t) )
( ) --------------------- ( )
( <---- BTEX10 PIPE 2 <--- )
---------- ----------------------- ----------
DETAILED DESCRIPTION:
This model consists of two well stirred tanks (ODE's), connected by
two smaller pipes (BTEX10 models (PDE's). The material circulates
in a circular path. Pipe 1 is flow from the left, Pipe2 is flow from
the right. The diffusion coefficient, D, is set to a high value for
comparison with a corresponding version which uses compartmental
models for the pipes. A second model is included,
Compx2_CircularFlow comparing using compartmental models for the
two pipes and a large value of the diffusion coefficient in the
BTEX10 (partial differential equations) pipes. Model illustrates
inflow boundary conditions and PDEs for inflow on both left and
right boundaries.
KEY WORDS:
BTEX10, Compartmental, Circular flow, PDE, advection, diffusion
REFERENCES:
W.C. Sangren and C.W. Sheppard. A mathematical derivation of the
exchange of a labelled substance between a liquid flowing in a
vessel and an external compartment. Bull Math BioPhys, 15, 387-394,
1953.
C.A. Goresky, W.H. Ziegler, and G.G. Bach. Capillary exchange modeling:
Barrier-limited and flow-limited distribution. Circ Res 27: 739-764, 1970.
J.B. Bassingthwaighte. A concurrent flow model for extraction
during transcapillary passage. Circ Res 35:483-503, 1974.
B. Guller, T. Yipintsoi, A.L. Orvis, and J.B. Bassingthwaighte. Myocardial
sodium extraction at varied coronary flows in the dog: Estimation of
capillary permeability by residue and outflow detection. Circ Res 37: 359-378, 1975.
C.P. Rose, C.A. Goresky, and G.G. Bach. The capillary and
sarcolemmal barriers in the heart--an exploration of labelled water
permeability. Circ Res 41: 515, 1977.
J.B. Bassingthwaighte, F.P. Chinard, C. Crone, C.A. Goresky,
N.A. Lassen, R.S. Reneman, and K.L. Zierler. Terminology for
mass transport and exchange. Am. J. Physiol. 250 (Heart. Circ.
Physiol. 19): H539-H545, 1986.
J.B. Bassingthwaighte, C.Y. Wang, and I.S. Chan. Blood-tissue
exchange via transport and transformation by endothelial cells.
Circ. Res. 65:997-1020, 1989.
Poulain CA, Finlayson BA, Bassingthwaighte JB.,Efficient numerical methods
for nonlinear-facilitated transport and exchange in a blood-tissue exchange
unit, Ann Biomed Eng. 1997 May-Jun;25(3):547-64.
REVISION HISTORY:
Written 09/08/10 Gary M. Raymond
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
*/