Location: Guyton, Red, Cells, And, Viscosity, 2008 @ fc83b30a3bcf / red_cells.cellml

Author:
jonna
Date:
2009-07-10 15:27 +1200
Desc:
Added units to all files. Added 1.1 files
Permanent Source URI:
http://models.cellml.org/workspace/guyton_red_cells_and_viscosity_2008/rawfile/fc83b30a3bcf785799aa912366bf0288457423a8/red_cells.cellml

<?xml version="1.0" encoding="utf-8"?>
<model 
	name="red_cells_and_viscosity_model"
	cmeta:id="red_cells_and_viscosity_model"
	
	xmlns="http://www.cellml.org/cellml/1.1#"
	xmlns:cellml="http://www.cellml.org/cellml/1.1#"
	xmlns:cmeta="http://www.cellml.org/metadata/1.0#"
	xmlns:xlink="http://www.w3.org/1999/xlink">

	<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
		<rdf:Description rdf:about="#red_cells_and_viscosity_model">
			<rdf:value>
			The red cell volume is considered to be controlled by two principal factors that 
			control the production of erythropoietin:  
			(1) the arterial blood oxygen saturation (OSA) and renal function as determined by 
			renal blood flow (RFN), and 
			(2) the fraction (REK) of the renal mass that is functional.
			</rdf:value>
		</rdf:Description>
	</rdf:RDF>

<!-- =============================================	Import the required units from the Units file	==================================================== -->
	<import xlink:href="../General%20Files/units.cellml">
		<units name="minute" units_ref="minute"/>
		<units name="per_minute" units_ref="per_minute"/>
		<units name="beats_per_minute" units_ref="beats_per_minute"/>
		<units name="beats_per_minute_per_mmHg" units_ref="beats_per_minute_per_mmHg"/>
		<units name="minute_per_L" units_ref="minute_per_L"/>
		<units name="mmHg" units_ref="mmHg"/>
		<units name="per_mmHg" units_ref="per_mmHg"/>
		<units name="mmHg_per_mL" units_ref="mmHg_per_mL"/>
		<units name="mmHg_L" units_ref="mmHg_L"/>
		<units name="per_mmHg2" units_ref="per_mmHg2"/>
		<units name="mmHg3" units_ref="mmHg3"/>
		<units name="monovalent_mEq" units_ref="monovalent_mEq"/>
		<units name="monovalent_mEq_per_minute" units_ref="monovalent_mEq_per_minute"/>
		<units name="monovalent_mEq_per_litre" units_ref="monovalent_mEq_per_litre"/>
		<units name="mOsm" units_ref="mOsm"/>
		<units name="mOsm_per_litre" units_ref="mOsm_per_litre"/>
		<units name="mOsm_per_minute" units_ref="mOsm_per_minute"/>
		<units name="monovalent_mEq_per_litre_per_minute" units_ref="monovalent_mEq_per_litre_per_minute"/>
		<units name="litre2_per_monovalent_mEq_per_minute" units_ref="litre2_per_monovalent_mEq_per_minute"/>
		<units name="L_per_minute" units_ref="L_per_minute"/>
		<units name="per_mmHg_per_minute" units_ref="per_mmHg_per_minute"/>
		<units name="mL" units_ref="mL"/>
		<units name="gram_per_L" units_ref="gram_per_L"/>
		<units name="L_mmHg_per_gram" units_ref="L_mmHg_per_gram"/>
		<units name="L2_mmHg_per_gram2" units_ref="L2_mmHg_per_gram2"/>
		<units name="mmHg_minute_per_L" units_ref="mmHg_minute_per_L"/>
		<units name="mmHg_L_per_minute" units_ref="mmHg_L_per_minute"/>
		<units name="gram_per_minute" units_ref="gram_per_minute"/>
		<units name="mL_per_L" units_ref="mL_per_L"/>
		<units name="mL_per_L_per_mmHg" units_ref="mL_per_L_per_mmHg"/>
		<units name="mL_per_L_per_minute" units_ref="mL_per_L_per_minute"/>
		<units name="mL_per_minute_per_mmHg" units_ref="mL_per_minute_per_mmHg"/>
		<units name="L_mL_per_minute_per_mmHg" units_ref="L_mL_per_minute_per_mmHg"/>
		<units name="L_per_mL" units_ref="L_per_mL"/>
		<units name="L_per_mmHg" units_ref="L_per_mmHg"/>
		<units name="mL_per_minute" units_ref="mL_per_minute"/>
		<units name="L_per_minute_per_mmHg" units_ref="L_per_minute_per_mmHg"/>
		<units name="L_per_minute_per_mmHg2" units_ref="L_per_minute_per_mmHg2"/>
	</import>

<!-- =====================================	Import all Parameters and State Variables from the Parameter file	============================================== -->
	<import xlink:href="../General%20Files/parameters.cellml">
		<component component_ref="parameter_values" name="parameter_values"/>
		<component component_ref="state_variables" name="state_variables"/>
	</import>


<!-- ========================================	RED CELLS AND VISCOSITY TOP-LEVEL COMPONENT	============================================= -->
	<component 	name="red_cells_and_viscosity" 
				cmeta:id="red_cells_and_viscosity">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#red_cells_and_viscosity">
				<rdf:value>
				Encapsulation grouping component containing all the components in the Red Cells and Viscosity Model. 
				The inputs and outputs of the Red Cells and Viscosity Model must be passed by this component.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>

		<variable name="time"	units="minute"	private_interface="out" public_interface="in"/>

<!-- Inputs from components in other models -->
		<variable name="VP"	units="litre" private_interface="out" public_interface="in"/>

<!-- Outputs to components in other models -->
		<variable name="VIM" 	units="dimensionless" private_interface="in" public_interface="out"/>
		<variable name="HM" 	units="dimensionless" private_interface="in" public_interface="out"/>
		<variable name="HM1" 	units="dimensionless" private_interface="in" public_interface="out"/>
		<variable name="VRC" 	units="litre" private_interface="in" public_interface="out"/>
	</component>

<!-- OUTPUT CONNECTIONS -->
	<connection>
		<map_components component_1="red_cells_and_viscosity" component_2="blood_viscosity"/>
		<map_variables variable_1="VIM" variable_2="VIM"/>
	</connection>
<!--	<connection>
		<map_components component_1="red_cells_and_viscosity" component_2="hematocrit_fraction"/>
		<map_variables variable_1="HM" variable_2="HM"/>
		<map_variables variable_1="HM1" variable_2="HM1"/>
	</connection> -->
<!--	<connection>
		<map_components component_1="red_cells_and_viscosity" component_2="RBC_volume"/>
		<map_variables variable_1="VRC" variable_2="VRC"/>
	</connection> -->

<!-- ========================================	BLOOD VISCOSITY CALCULATIONS	============================================= -->
	<component 	name="blood_viscosity_calculations" 
				cmeta:id="blood_viscosity_calculations">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#blood_viscosity_calculations">
				<rdf:value>
				Containment grouping component for "hematocrit_fraction", "viscosity_due_to_RBCs"
				and "blood_viscosity".
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
	</component>

<!-- ========================================	HEMATOCRIT_FRACTION	============================================= -->
	<component 	name="hematocrit_fraction" 
				cmeta:id="hematocrit_fraction">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#hematocrit_fraction">
				<rdf:value>
				RC6:  
				Calculation of blood volume (VB) by adding the volume of the red blood cells (VRC) 
				to the plasma volume (VP).

				RC7:  
				The fraction of the blood that is composed of red blood cells (HM1) is equal to 
				the volume of red blood cells (VRC) divided by the blood volume (VB).

				RC8:  
				The hematocrit (HM) equals the fraction of the blood that is red cells (HM1) 
				times 100.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC6">
				<rdf:value>
				RC6:  
				Calculation of blood volume (VB) by adding the volume of the red blood cells (VRC) 
				to the plasma volume (VP).
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC7">
				<rdf:value>
				RC7:  
				The fraction of the blood that is composed of red blood cells (HM1) is equal to 
				the volume of red blood cells (VRC) divided by the blood volume (VB).
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC8">
				<rdf:value>
				RC8:  
				The hematocrit (HM) equals the fraction of the blood that is red cells (HM1) 
				times 100.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="VP"		units="litre" private_interface="none" public_interface="in"/>
		<variable name="VRC"	units="litre" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable name="HM" 	units="dimensionless" private_interface="none" public_interface="out"/>
		<variable	cmeta:id="hematocrit_fraction_HM1"
					name="HM1" 	units="dimensionless" private_interface="none" public_interface="out"/>

<!-- Internal variables -->
		<variable name="VB"		units="litre" private_interface="none" public_interface="none"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC6">
				<eq/>
				<ci>VB</ci>
				<apply>
					<plus/>
					<ci>VP</ci>
					<ci>VRC</ci>
				</apply>
			</apply>
			<apply id="RC7">
				<eq/>
				<ci>HM1</ci>
				<apply>
					<divide/>
					<ci>VRC</ci>
					<ci>VB</ci>
				</apply>
			</apply>
			<apply id="RC8">
				<eq/>
				<ci>HM</ci>
				<apply>
					<times/>
					<cn cellml:units="dimensionless">100</cn>
					<ci>HM1</ci>
				</apply>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="hematocrit_fraction" component_2="red_cells_and_viscosity"/>
		<map_variables variable_1="HM" variable_2="HM"/>
		<map_variables variable_1="HM1" variable_2="HM1"/>
		<map_variables variable_1="VP" variable_2="VP"/>
	</connection>
	<connection>
		<map_components component_1="hematocrit_fraction" component_2="RBC_volume"/>
		<map_variables variable_1="VRC" variable_2="VRC"/>
	</connection>

<!-- ========================================	VISCOSITY DUE TO RED BLOOD CELLS	============================================= -->
	<component 	name="viscosity_due_to_RBCs" 
				cmeta:id="viscosity_due_to_RBCs">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#viscosity_due_to_RBCs">
				<rdf:value>
				RC9, RC10, and RC11:  
				Curve-fitting blocks to calculate the portion of the viscosity of the blood that
				is caused by red blood cells (VIE).  The two variables (HMK and HKM) are 
				curve-fitting constants.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC9_to_RC11">
				<rdf:value>
				RC9, RC10, and RC11:  
				Curve-fitting blocks to calculate the portion of the viscosity of the blood that
				is caused by red blood cells (VIE).  The two variables (HMK and HKM) are 
				curve-fitting constants.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="HM"	units="dimensionless" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable name="VIE" 	units="dimensionless" private_interface="none" public_interface="out"/>

<!-- Parameters from parameter_file -->
		<variable name="HMK"	units="dimensionless" private_interface="none" public_interface="in"/>
		<variable name="HKM"	units="dimensionless" private_interface="none" public_interface="in"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC9_to_RC11">
				<eq/>
				<ci>VIE</ci>
				<apply>
					<divide/>
					<ci>HM</ci>
					<apply>
						<times/>
						<apply>
							<minus/>
							<ci>HMK</ci>
							<ci>HM</ci>
						</apply>
						<ci>HKM</ci>
					</apply>
				</apply>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="viscosity_due_to_RBCs" component_2="hematocrit_fraction"/>
		<map_variables variable_1="HM" variable_2="HM"/>
	</connection>

<!-- PARAMETER CONNECTIONS -->
	<connection>
		<map_components component_1="viscosity_due_to_RBCs" component_2="parameter_values"/>
		<map_variables variable_1="HMK" variable_2="HMK"/>
		<map_variables variable_1="HKM" variable_2="HKM"/>
	</connection>

<!-- ========================================	BLOOD VISCOSITY	============================================= -->
	<component 	name="blood_viscosity" 
				cmeta:id="blood_viscosity">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#blood_viscosity">
				<rdf:value>
				RC12:  
				The viscosity of the blood (VIB) when calculated as a multiple of the viscosity 
				of water is equal to the viscosity effect caused by the red cells (VIE) plus a 
				constant determined by the viscosity of the plasma.  

				RC13:  
				Calculation of a normalized viscosity multiplier factor (VIM) that is used elsewhere 
				in the circulation to calculate the effect of changes in the viscosity from normal 
				(assumed to be 1.0) on various circulatory effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC12">
				<rdf:value>
				RC12:  
				The viscosity of the blood (VIB) when calculated as a multiple of the viscosity 
				of water is equal to the viscosity effect caused by the red cells (VIE) plus a 
				constant determined by the viscosity of the plasma.  
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC13">
				<rdf:value>
				RC13:  
				Calculation of a normalized viscosity multiplier factor (VIM) that is used elsewhere 
				in the circulation to calculate the effect of changes in the viscosity from normal 
				(assumed to be 1.0) on various circulatory effects.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="VIE"	units="dimensionless" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable	cmeta:id="blood_viscosity_VIM"
					name="VIM" 	units="dimensionless" private_interface="none" public_interface="out"/>

<!-- Internal variables -->
		<variable name="VIB"	units="dimensionless" private_interface="none" public_interface="none"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC12">
				<eq/>
				<ci>VIB</ci>
				<apply>
					<plus/>
					<ci>VIE</ci>
					<cn cellml:units="dimensionless">1.5</cn>
				</apply>
			</apply>
			<apply id="RC13">
				<eq/>
				<ci>VIM</ci>
				<apply>
					<times/>
					<cn cellml:units="dimensionless">0.3333</cn>
					<ci>VIB</ci>
				</apply>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="blood_viscosity" component_2="viscosity_due_to_RBCs"/>
		<map_variables variable_1="VIE" variable_2="VIE"/>
	</connection>

<!-- ========================================	RED_BLOOD_CELLS_FORMATION_AND_DESTRUCTION	============================================= -->
	<component 	name="RBC_formation_and_destruction" 
				cmeta:id="RBC_formation_and_destruction">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#RBC_formation_and_destruction">
				<rdf:value>
				Containment grouping component for "oxygen_stimulation", "RBC_production",
				"RBC_destruction" and "blood_viscosity".
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
	</component>

<!-- ========================================	OXYGEN_STIMULATION	============================================= -->
	<component 	name="oxygen_stimulation" 
				cmeta:id="oxygen_stimulation">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#oxygen_stimulation">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC1D">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC1A_and_RC1B">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC1">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC1C_and_RC2C">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC2">
				<rdf:value>
				RC1, RC1A, RC1B, RC1C, RC1D, RC2, RC2C, and RC2D:  
				Calculation of the effect of atmospheric O2 pressure (PO2AMB) on the 
				driving force (HM7) for production of red blood cells.  RC1A, RC1B, and RC1D 
				calculate the effect of pressures below the level of 80 mmHg, and RC1 the effect 
				of pressures above 80.  Blocks RC2, RC2C, and RC2D provide limits to the effects.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="HM"	units="dimensionless" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable name="HM7" 	units="mmHg" private_interface="none" public_interface="out"/>

<!-- Parameters from parameter_file -->
		<variable name="PO2AMB"	units="mmHg" private_interface="none" public_interface="in"/>
		<variable name="HM6"	units="mmHg" private_interface="none" public_interface="in"/>

<!-- Internal variables -->
		<variable name="PO2AM1"	units="mmHg" private_interface="none" public_interface="none"/>
		<variable name="HM3"	units="mmHg" private_interface="none" public_interface="none"/>
		<variable name="HM4"	units="mmHg" private_interface="none" public_interface="none"/>
		<variable name="HM5"	units="mmHg" private_interface="none" public_interface="none"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC1D">
				<eq/>
				<ci>PO2AM1</ci>
				<piecewise>
					<piece>
						<cn cellml:units="mmHg">80</cn>
						<apply>
							<gt/>
							<ci>PO2AMB</ci>
							<cn cellml:units="mmHg">80</cn>
						</apply>
					</piece>
					<otherwise>
						<ci>PO2AMB</ci>
					</otherwise>
				</piecewise>
			</apply>
			<apply id="RC1A_and_RC1B">
				<eq/>
				<ci>HM3</ci>
				<apply>
					<times/>
					<apply>
						<minus/>
						<ci>PO2AM1</ci>
						<cn cellml:units="mmHg">40</cn>
					</apply>
					<ci>HM</ci>
				</apply>
			</apply>
			<apply id="RC1">
				<eq/>
				<ci>HM4</ci>
				<apply>
					<minus/>
					<ci>PO2AMB</ci>
					<cn cellml:units="mmHg">40</cn>
				</apply>
			</apply>
			<apply id="RC1C_and_RC2C">
				<eq/>
				<ci>HM5</ci>
				<piecewise>
					<piece>
						<cn cellml:units="mmHg">0</cn>
						<apply>
							<lt/>
							<apply>
								<plus/>
								<ci>HM3</ci>
								<ci>HM4</ci>
							</apply>
							<cn cellml:units="mmHg">0</cn>
						</apply>
					</piece>
					<otherwise>
						<apply>
							<plus/>
							<ci>HM3</ci>
							<ci>HM4</ci>
						</apply>
					</otherwise>
				</piecewise>
			</apply>
			<apply id="RC2">
				<eq/>
				<ci>HM7</ci>
				<apply>
					<minus/>
					<ci>HM6</ci>
					<ci>HM5</ci>
				</apply>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="oxygen_stimulation" component_2="hematocrit_fraction"/>
		<map_variables variable_1="HM" variable_2="HM"/>
	</connection>

<!-- PARAMETER CONNECTIONS -->
	<connection>
		<map_components component_1="oxygen_stimulation" component_2="parameter_values"/>
		<map_variables variable_1="PO2AMB" variable_2="PO2AMB"/>
		<map_variables variable_1="HM6" variable_2="HM6"/>
	</connection>

<!-- ========================================	RED_BLOOD_CELL_PRODUCTION	============================================= -->
	<component 	name="RBC_production" 
				cmeta:id="RBC_production">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#RBC_production">
				<rdf:value>
				RC2A, RC2B, and RC2E:  
				Calculation of the rate of red blood cell production (RC1), with a lower limit 
				of zero set by Block RC2E, and the rate of production partly determined by the 
				amount of kidney mass available (REK) to produce erythropoition.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC2A_RC2B_and_RC2E">
				<rdf:value>
				RC2A, RC2B, and RC2E:  
				Calculation of the rate of red blood cell production (RC1), with a lower limit 
				of zero set by Block RC2E, and the rate of production partly determined by the 
				amount of kidney mass available (REK) to produce erythropoition.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="HM7"	units="mmHg" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable name="RC1" 	units="L_per_minute" private_interface="none" public_interface="out"/>

<!-- Parameters from parameter_file -->
		<variable name="HM8"	units="L_per_minute_per_mmHg" private_interface="none" public_interface="in"/>
		<variable name="REK"	units="dimensionless" private_interface="none" public_interface="in"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC2A_RC2B_and_RC2E">
				<eq/>
				<ci>RC1</ci>
				<piecewise>
					<piece>
						<cn cellml:units="L_per_minute">0</cn>
						<apply>
							<lt/>
							<apply>
								<plus/>
								<apply>
									<times/>
									<ci>HM7</ci>
									<ci>HM8</ci>
									<ci>REK</ci>
								</apply>
								<cn cellml:units="L_per_minute">0.000005</cn>
							</apply>
							<cn cellml:units="L_per_minute">0</cn>
						</apply>
					</piece>
					<otherwise>
						<apply>
							<plus/>
							<apply>
								<times/>
								<ci>HM7</ci>
								<ci>HM8</ci>
								<ci>REK</ci>
							</apply>
							<cn cellml:units="L_per_minute">0.000005</cn>
						</apply>
					</otherwise>
				</piecewise>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_production" component_2="oxygen_stimulation"/>
		<map_variables variable_1="HM7" variable_2="HM7"/>
	</connection>

<!-- PARAMETER CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_production" component_2="parameter_values"/>
		<map_variables variable_1="HM8" variable_2="HM8"/>
		<map_variables variable_1="REK" variable_2="REK"/>
	</connection>

<!-- ========================================	RED_BLOOD_CELL_DESTRUCTION	============================================= -->
	<component 	name="RBC_destruction" 
				cmeta:id="RBC_destruction">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#RBC_destruction">
				<rdf:value>
				RC5:  
				Calculation of the rate of red cell volume destruction (RC2) caused by the presence 
				of an already large red cell volume (VRC).  The rate factor for this effect is (RKC).  
				Also increased blood viscosity is considered to cause increased destruction.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC5">
				<rdf:value>
				RC5:  
				Calculation of the rate of red cell volume destruction (RC2) caused by the presence 
				of an already large red cell volume (VRC).  The rate factor for this effect is (RKC).  
				Also increased blood viscosity is considered to cause increased destruction.
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="VRC"	units="litre" private_interface="none" public_interface="in"/>
		<variable name="VIM"	units="dimensionless" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable name="RC2" 	units="L_per_minute" private_interface="none" public_interface="out"/>

<!-- Parameters from parameter_file -->
		<variable name="RKC"	units="per_minute" private_interface="none" public_interface="in"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC5">
				<eq/>
				<ci>RC2</ci>
				<apply>
					<times/>
					<ci>VRC</ci>
					<ci>RKC</ci>
					<ci>VIM</ci>
				</apply>
			</apply>
		</math>
	</component>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_destruction" component_2="RBC_volume"/>
		<map_variables variable_1="VRC" variable_2="VRC"/>
		<map_variables variable_1="RC2" variable_2="RC2"/>
	</connection>
	<connection>
		<map_components component_1="RBC_destruction" component_2="blood_viscosity"/>
		<map_variables variable_1="VIM" variable_2="VIM"/>
	</connection>

<!-- PARAMETER CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_destruction" component_2="parameter_values"/>
		<map_variables variable_1="RKC" variable_2="RKC"/>
	</connection>

<!-- ========================================	RED_BLOOD_CELL_VOLUME	============================================= -->
	<component 	name="RBC_volume" 
				cmeta:id="RBC_volume">
		<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
			<rdf:Description rdf:about="#RBC_volume">
				<rdf:value>
				RC3:  
				Calculation of the rate of change of red blood cell volume (RCD) by adding 
				the rate of RBC production (RC1) and subtracting the rate of destruction (RC2).
				NB - Parameter TRRBC is not in diagram.

				RC4:  
				Calculation of the instantaneous volume of red blood cells by integrating the rate 
				of change in total volume of red cells (RCD).
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC3">
				<rdf:value>
				RC3:  
				Calculation of the rate of change of red blood cell volume (RCD) by adding 
				the rate of RBC production (RC1) and subtracting the rate of destruction (RC2).
				NB - Parameter TRRBC is not in diagram.
				</rdf:value>
			</rdf:Description>
			<rdf:Description rdf:about="#RC4">
				<rdf:value>
				RC4:  
				Calculation of the instantaneous volume of red blood cells by integrating the rate 
				of change in total volume of red cells (RCD).
				</rdf:value>
			</rdf:Description>
		</rdf:RDF>
		
<!-- Inputs from other components -->
		<variable name="RC1"	units="L_per_minute" private_interface="none" public_interface="in"/>
		<variable name="RC2"	units="L_per_minute" private_interface="none" public_interface="in"/>
		<variable name="VRC_init"	units="litre" private_interface="none" public_interface="in"/>
		<variable name="time"	units="minute" private_interface="none" public_interface="in"/>

<!-- Outputs to other components -->
		<variable	cmeta:id="RBC_volume_VRC"
					name="VRC" 	initial_value="VRC_init"	units="litre" private_interface="none" public_interface="out"/>

<!-- Parameters from parameter_file -->
		<variable name="TRRBC"	units="L_per_minute" private_interface="none" public_interface="in"/>

<!-- Internal variables -->
		<variable name="RCD"	units="L_per_minute" private_interface="none" public_interface="none"/>

		<math xmlns="http://www.w3.org/1998/Math/MathML">
			<apply id="RC3">
				<eq/>
				<ci>RCD</ci>
				<apply>
					<plus/>
					<apply>
						<minus/>
						<ci>RC1</ci>
						<ci>RC2</ci>
					</apply>
					<ci>TRRBC</ci>
				</apply>
			</apply>
			<apply id="RC4">
				<eq/>
				<apply>
					<diff/>
					<bvar>
						<ci>time</ci>
					</bvar>
					<ci>VRC</ci>
				</apply>
				<ci>RCD</ci>
			</apply>
		</math>
	</component>

<!-- STATE VARIABLES INITIAL VALUE -->
	<connection>
		<map_components component_1="RBC_volume" component_2="state_variables"/>
		<map_variables variable_1="VRC_init" variable_2="VRC_init"/> 
	</connection>

<!-- INPUT CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_volume" component_2="RBC_production"/>
		<map_variables variable_1="RC1" variable_2="RC1"/>
	</connection>
	<connection>
		<map_components component_1="RBC_volume" component_2="red_cells_and_viscosity"/>
		<map_variables variable_1="VRC" variable_2="VRC"/>
		<map_variables variable_1="time" variable_2="time"/>
	</connection>

<!-- PARAMETER CONNECTIONS -->
	<connection>
		<map_components component_1="RBC_volume" component_2="parameter_values"/>
		<map_variables variable_1="TRRBC" variable_2="TRRBC"/>
	</connection>

	
<!-- ============================================================		GROUPING		=============================================================== -->
	<group>
		<relationship_ref relationship="containment"/>
		<component_ref component="red_cells_and_viscosity">
			<component_ref component="blood_viscosity_calculations">
				<component_ref component="hematocrit_fraction"/>
				<component_ref component="viscosity_due_to_RBCs"/>
				<component_ref component="blood_viscosity"/>
			</component_ref>
			<component_ref component="RBC_formation_and_destruction">
				<component_ref component="oxygen_stimulation"/>
				<component_ref component="RBC_production"/>
				<component_ref component="RBC_destruction"/>
				<component_ref component="RBC_volume"/>
			</component_ref>
		</component_ref>
	</group>

	<group>
		<relationship_ref relationship="encapsulation"/>
		<component_ref component="red_cells_and_viscosity">
			<component_ref component="parameter_values"/>
			<component_ref component="state_variables"/>
			<component_ref component="blood_viscosity_calculations"/>
			<component_ref component="hematocrit_fraction"/>
			<component_ref component="viscosity_due_to_RBCs"/>
			<component_ref component="blood_viscosity"/>
			<component_ref component="RBC_formation_and_destruction"/>
			<component_ref component="oxygen_stimulation"/>
			<component_ref component="RBC_production"/>
			<component_ref component="RBC_destruction"/>
			<component_ref component="RBC_volume"/>
		</component_ref>
	</group>
   
</model>