// MODEL NUMBER: 0147
// MODEL NAME: Vessels_4RC
// SHORT DESCRIPTION: This model describes a flow through vessels with resistance to flow,
// and compliance. Model 'Vessel_2RC' has two RC vessels in series while
// 'Vessel4RC has two RC vessels in parallel with two RC vessels in series.
import nsrunit; unit conversion on;
math Compliant_Vessel{
realDomain t sec; t.min = 0; t.max = 10; t.delta = 0.01;
// PARAMETERS:
real
Pmean = 30 mmHg, // Mean input driving pressure
Pamp = 2.5 mmHg, // Input driving pressure amplitude
tnorm = 1 sec, // Normalizing time constant
mu = 3 cP, // Fluid viscosity
L1 = 12500 um, // Vessel length
D1init = 200 um, // Vessel diameter
P1ext = 0 mmHg, // Extraluminal pressure
R1 dyne*s/(uL*cm^2), // Vessel resistance to flow
C1 uL/mmHg, // Vessel compliance
L2 = 12500 um, // Vessel length
D2init = 200 um, // Vessel diameter
Pout = 25 mmHg, // Output pressure
P2ext = 0 mmHg, // Extraluminal pressure
R2 dyne*s/(uL*cm^2), // Vessel resistance to flow
C2 uL/mmHg; // Vessel compliance
// VARIABLES
real
Pin(t) mmHg, // Input driving pressure
P1(t) mmHg, // Output from vessel 1 pressure
Fout(t) uL/s, // Flow through the vessel
Fin(t) uL/s, // Flow into the vessel
F1comp(t) uL/s, // Flow attributed to volume change
V1(t) uL, // Volume of vessel
D1(t) um, // Vessel diameter
F2comp(t) uL/s, // Flow attributed to volume change
V2(t) uL, // Volume of vessel
D2(t) um; // Vessel diameter
// ALGEBRAIC AND ODE EQUATIONS
Pin = Pmean + Pamp*sin(2*PI*t/tnorm); // Input pressure sine train
Pin P1 = Fout*R1;
R1 = (128*mu*L1) / (PI*D1init^4); // Vessel resistance to flow
C1 = (PI*(D1init^2)*L1) / (4*Pmean); // Vessel compliance
D1 = (4*V1/(PI*L1))^0.5; // Vessel diameter
R2 = (128*mu*L2) / (PI*D2init^4); // Vessel resistance to flow
C2 = (PI*(D2init^2)*L2) / (4*Pmean); // Vessel compliance
D2 = (4*V2/(PI*L2))^0.5; // Vessel diameter
Fout = (Pin  Pout)/(R1+R2); // Set of equations to solve
Fin = Fout + F1comp +F2comp; // for flows and volume
V1 = (Pin  P1ext) * C1;
V2 = (P1  P2ext) * C2;
F1comp = V1:t;
F2comp = V2:t;
} // END OF MML CODE
/*
FIGURE:
Fin
> Pin R1 P1 R2 Pout
o/\/\/\/\o/\/\/\/\o
  >
    Fout
  F1comp   F2comp
 v  v
C1,V1 ===== C2,V2 =====
 
 
 
o P1ext o P2ext
 
 
 
DETAILED DESCRIPTION:
The model simulates fluid flow, F, through a compliant vessel with
resistance to flow, R, and vessel compliance, C, given a pressure drop
across the length of the vessel equivalent to Pin  Pout. The flow
out of the vessel is related to the resistance by the fluid equivalent
of Ohm's Law.
Fout = (Pin  Pout) / R
where Pin  Pout is the difference in pressure between the beginning
and end of the vessel and R is determined from Poiseuille's Law as:
R = 128*mu*L / pi*D^4
where mu is the fluid viscosity, L is the vessel length, and D is the
vessel diameter.
The flow into the vessel and the flow out of the vessel are different
because of the change in volume which adds or subtracts flow from that
leaving the vessel depending on whether the pressure is increasing or
decreasing in the vessel. So we have:
Fin = Fout + Fcomp
where the flow attributed to the vessel compliance, Fcomp, is given by:
Fcomp = dV/dt
and where V is the vessel volume and is related to the compliance, C and
intraluminal pressure, Pin, by:
V = Pin * C
It should be noted in the code that the initial vessel volume is
prescribed by Pin and the value of C calculated from the initial diameter
and vessel length.
SHORTCOMINGS/GENERAL COMMENTS:
KEY WORDS: compliant, vessel, flow, resistance, compliance, RC circuit, Tutorial,
Pressure volume, parallel RC
REFERENCES:
Ohm GS. Die galvanische Kette mathematisch bearbeitet, 1827
REVISION HISTORY:
Created by Max Neal
Modified by Brian Carlson on 31 August 2007
Modified by Micah Nicholson on 2 April 2009
Revised by: Date:02jun11 : Added an RC unit in series to the model
COPYRIGHT AND REQUEST FOR ACKNOWLEDGMENT OF USE:
Copyright (C) 19992011 University of Washington. From the National Simulation Resource,
Director J. B. Bassingthwaighte, Department of Bioengineering, University of Washington, Seattle WA 981955061.
Academic use is unrestricted. Software may be copied so long as this copyright notice is included.
This software was developed with support from NIH grant HL073598.
Please cite this grant in any publication for which this software is used and send an email
with the citation and, if possible, a PDF file of the paper to: staff@physiome.org.
*/
// MODEL NAME: Vessel_4RC
// SHORT DESCRIPTION: This model describes a flow through vessels with resistance to flow,
// and compliance. Model 'Vessel_2RC' has two RC vessels in series while
// 'Vessel4RC has two RC vessels in parallel with two RC vessels in series.
import nsrunit; unit conversion on;
math Compliant_Vessel{
realDomain t sec; t.min = 0; t.max = 10; t.delta = 0.01;
// PARAMETERS:
real
Pmean = 30 mmHg, // Mean input driving pressure
Pamp = 2.5 mmHg, // Input driving pressure amplitude
tnorm = 1 sec, // Normalizing time constant
mu = 3 cP, // Fluid viscosity
L1 = 12500 um, // Vessel length
D1init = 200 um, // Vessel diameter
P1ext = 0 mmHg, // Extraluminal pressure
R1 dyne*s/(uL*cm^2), // Vessel resistance to flow
C1 uL/mmHg, // Vessel compliance
L2 = 12500 um, // Vessel length
D2init = 200 um, // Vessel diameter
Pout = 25 mmHg, // Output pressure
P2ext = 0 mmHg, // Extraluminal pressure
R2 dyne*s/(uL*cm^2), // Vessel resistance to flow
C2 uL/mmHg, // Vessel compliance
L3 = 12500 um, // Vessel length
D3init = 200 um, // Vessel diameter
P3ext = 0 mmHg, // Extraluminal pressure
R3 dyne*s/(uL*cm^2), // Vessel resistance to flow
C3 uL/mmHg, // Vessel compliance
L4 = 12500 um, // Vessel length
D4init = 200 um, // Vessel diameter
P4ext = 0 mmHg, // Extraluminal pressure
R4 dyne*s/(uL*cm^2), // Vessel resistance to flow
C4 uL/mmHg, // Vessel compliance
R2_3 dyne*s/(uL*cm^2); // Total resistance to Vessels 2,3 in parallel
// VARIABLES
real
Pin(t) mmHg, // Input driving pressure
P1(t) mmHg, // Output from vessel 1 pressure
P2(t) mmHg, // Pressure at point after parallel RCs
Fout(t) uL/s, // Flow through the vessel
Fin(t) uL/s, // Flow into the vessel
F2(t) uL/s, // Flow through vessel 2
F3(t) uL/s, // Flow through vessel 3
F1comp(t) uL/s, // Flow attributed to volume change
V1(t) uL, // Volume of vessel
D1(t) um, // Vessel diameter
F2comp(t) uL/s, // Flow attributed to volume change
V2(t) uL, // Volume of vessel
D2(t) um, // Vessel diameter
F3comp(t) uL/s, // Flow attributed to volume change
V3(t) uL, // Volume of vessel
D3(t) um, // Vessel diameter
F4comp(t) uL/s, // Flow attributed to volume change
V4(t) uL, // Volume of vessel
D4(t) um; // Vessel diameter
// ALGEBRAIC AND ODE EQUATIONS
Pin = Pmean + Pamp*sin(2*PI*t/tnorm); // Input pressure sine train
Pin P1 = Fout*R1;
P2  P1 = Fout*R2_3;
R1 = (128*mu*L1) / (PI*D1init^4); // Vessel resistance to flow
C1 = (PI*(D1init^2)*L1) / (4*Pmean); // Vessel compliance
D1 = (4*V1/(PI*L1))^0.5; // Vessel diameter
R2 = (128*mu*L2) / (PI*D2init^4); // Vessel resistance to flow
C2 = (PI*(D2init^2)*L2) / (4*Pmean); // Vessel compliance
D2 = (4*V2/(PI*L2))^0.5; // Vessel diameter
R3 = (128*mu*L3) / (PI*D3init^4); // Vessel resistance to flow
C3 = (PI*(D3init^2)*L3) / (4*Pmean); // Vessel compliance
D3 = (4*V3/(PI*L3))^0.5; // Vessel diameter
R4 = (128*mu*L4) / (PI*D4init^4); // Vessel resistance to flow
C4 = (PI*(D4init^2)*L4) / (4*Pmean); // Vessel compliance
D4 = (4*V4/(PI*L4))^0.5; // Vessel diameter
1/R2_3 = 1/R2 + 1/R3;
Fout = (Pin  Pout)/(R1+R2+R2_3); // Set of equations to solve
Fin = Fout + F1comp + F2comp + F3comp + F4comp; // for flows and volume
F2 = (P2P1)/R2;
F3 = (P2P1)/R3;
V1 = (Pin  P1ext) * C1;
V2 = (P1  P2ext) * C2;
V3 = (P1  P3ext) * C3;
V4 = (P2  P4ext) * C4;
F1comp = V1:t;
F2comp = V2:t;
F3comp = V3:t;
F4comp = V4:t;
} // END OF MML CODE
/*
FIGURE:



P2ext
o

===== C2,V2
^  F2
F2comp   R2 >
 /\/\/\/\/\
 
Fin  
> Pin R1 P1 P2 R4 Pout
o/\/\/\/\o o/\/\/\/\o
    >
   R3    Fout
  F1comp /\/\/\/\/\   F4comp
 v  >  v
C1,V1 =====  F3 ===== C4,V4
 ===== C3,V3 
  
 o P3ext 
o P1ext  o P4ext
  
  
 
DETAILED DESCRIPTION:
The model simulates fluid flow, F, through up to four compliant vessel,
two of which are in parallel with resistance to flow, R, and vessel
compliance, C, given a pressure drop across the length of the vessel
equivalent to Pin  Pout. The flow out of the vessel is related to the
resistance by the fluid equivalent of Ohm's Law.
Fout = (Pin  Pout) / R
where Pin  Pout is the difference in pressure between the beginning
and end of the vessel system and R is determined from Poiseuille's Law as:
R = 128*mu*L / pi*D^4
where mu is the fluid viscosity, L is the vessel length, and D is the
vessel diameter.
The flow into the vessel and the flow out of the vessel are different
because of the change in volume which adds or subtracts flow from that
leaving the vessel depending on whether the pressure is increasing or
decreasing in the vessel. So we have:
Fin = Fout + Fcomp
where the flow attributed to the vessel compliance, Fcomp, is given by:
Fcomp = dV/dt
and where V is the vessel volume and is related to the compliance, C and
intraluminal pressure, Pin, by:
V = Pin * C
It should be noted in the code that the initial vessel volume is
prescribed by Pin and the value of C calculated from the initial diameter
and vessel length.
SHORTCOMINGS/GENERAL COMMENTS:
KEY WORDS: compliant, vessel, flow, resistance, compliance, RC circuit, Tutorial,
Pressure volume, parallel RC
REFERENCES:
Ohm GS. Die galvanische Kette mathematisch bearbeitet, 1827
REVISION HISTORY:
Created by Max Neal
Modified by Brian Carlson on 31 August 2007
Modified by Micah Nicholson on 2 April 2009
Revised by: Date:02jun11 : Added 3 RC units to the model
COPYRIGHT AND REQUEST FOR ACKNOWLEDGMENT OF USE:
Copyright (C) 19992011 University of Washington. From the National Simulation Resource,
Director J. B. Bassingthwaighte, Department of Bioengineering, University of Washington, Seattle WA 981955061.
Academic use is unrestricted. Software may be copied so long as this copyright notice is included.
This software was developed with support from NIH grant HL073598.
Please cite this grant in any publication for which this software is used and send an email
with the citation and, if possible, a PDF file of the paper to: staff@physiome.org.
*/