//----------------------------------------------------------------------------- // Distributed model for the O2-CO2 transport, exchange and metabolism. The // instantaneous equilibrium bindings of O2 and CO2 with hemoglobin and // myoglobin are considered. HbO2 saturation depends explicitly on pH and // pCO2. Similarly, HbCO2 saturation depends explicitly on pH and pO2. // The subscripts below "pl", "rbc", "isf", and "pc" denote "plasma", "red // blood cells", "interstitial fluid", and "parenchymal cells". // // The JSIM code is developed by // // Ranjan K. Dash // National Simulation Resource // Department of Bioengineering // Box 356962 // University of Washington // Seattle, WA-98195, USA // // Last modified in November 2002 // AXIALLY FLAT (CONSTANT) INITIAL PROFILE // //----------------------------------------------------------------------------- JSim v1.1 import nsrunit; unit conversion on; math o2co2model_v1 { realDomain t sec; // time domain t.min=0; t.max=300; t.delta=1; realDomain x cm; // space domain real L=0.1 cm; int Ngrid=51; x.min=0; x.max=L; x.ct=Ngrid; private x.min, x.max, x.ct; //----------------------------------------------------------------------------- // Parameters for O2-CO2 transport, exchange, and metabolism, assuming that // the organ is heart and its weight is 5 kg. real Rvel = 1.6, // velocity ratio (vrbc/vpl) (unitless) H = 0.45, // large vessel hematocrit (unitless) Hcap = H/(H+(1-H)*Rvel),// capillary hematocrit (unitless) Fb = 1.0 ml/min/g, // total blood flow rate (cardiac output) Fpl = (1-H)*Fb, // flow rate of plasma Frbc = H*Fb, // flow rate of RBCs Vcap = 0.07 ml/g, // anatomical volume of CAP Vpl = (1-Hcap)*Vcap, // anatomical volume of plasma Vrbc = Hcap*Vcap, // anatomical volume of RBC Visf = 0.20 ml/g, // anatomical volume of ISF Vpc = 0.70 ml/g, // anatomical volume of PCs Wpl = 0.94, // fractional water content of plasma Wrbc = 0.72, // fractional water content of RBCs Wisf = 0.92, // fractional water content of ISF Wpc = 0.80, // fractional water content of PCs VWpl = Vpl*Wpl, // volume of water content in plasma VWrbc = Vrbc*Wrbc, // volume of water content in RBCs VWisf = Visf*Wisf, // volume of water content in ISF VWpc = Vpc*Wpc, // volume of water content in PCs RQ = 0.80, // respiratory quotient (unitless) Km = 7.0e-7 M, // Km for cytochrome oxidase in PCs Vmax = 5.0e-6 mol/min/g,// Vmax for cytochrome oxidase in PCs O2PScap = 200 ml/min/g, // PS for O2 across CAP Membrane O2PSrbc = 1000 ml/min/g,// PS for O2 across RBC Membrane O2PSpc = 2000 ml/min/g, // PS for O2 across PC membrane CO2PScap = 200 ml/min/g,// PS for CO2 across CAP Membrane CO2PSrbc = 1000 ml/min/g,// PS for CO2 across RBC Membrane CO2PSpc = 2000 ml/min/g,// PS for CO2 across PC membrane HpPScap = 20 ml/min/g, // PS for H+ across CAP Membrane HpPSrbc = 100 ml/min/g, // PS for H+ across RBC Membrane HpPSpc = 200 ml/min/g, // PS for H+ across PC Membrane HCO3mPScap = 20 ml/min/g,// PS for HCO3- across CAP Membrane HCO3mPSrbc = 100 ml/min/g,// PS for HCO3- across RBC Membrane HCO3mPSpc = 200 ml/min/g, // PS for HCO3- across PC membrane Rrbc = 0.69, // Gibbs-Donnan ratio [H+]pl/[H+]rbc Rcap = 0.63, // Gibbs-Donnan ratio [H+]pl/[H+]isf Rpc = 0.79, // Gibbs-Donnan ratio [H+]isf/[H+]pc O2Dpl = 1e-4 cm^2/sec, // diffusion coefficient for O2 in plasma O2Drbc = 1e-4 cm^2/sec, // diffusion coefficient for O2 in RBCs O2Disf = 1e-4 cm^2/sec, // diffusion coefficient for O2 in ISF O2Dpc = 1e-4 cm^2/sec, // diffusion coefficient for O2 in PCs CO2Dpl = 1e-4 cm^2/sec, // diffusion coefficient for CO2 in plasma CO2Drbc = 1e-4 cm^2/sec,// diffusion coefficient for CO2 in RBCs CO2Disf = 1e-4 cm^2/sec,// diffusion coefficient for CO2 in ISF CO2Dpc = 1e-4 cm^2/sec, // diffusion coefficient for CO2 in PCs HpDpl = 1e-4 cm^2/sec, // diffusion coefficient for H+ in plasma HpDrbc = 1e-4 cm^2/sec, // diffusion coefficient for H+ in RBCs HpDisf = 1e-4 cm^2/sec, // diffusion coefficient for H+ in ISF HpDpc = 1e-4 cm^2/sec, // diffusion coefficient for H+ in PCs HCO3mDpl = 1e-4 cm^2/sec,// diffusion coefficient for HCO3- in plasma HCO3mDrbc = 1e-4 cm^2/sec,// diffusion coefficient for HCO3- in RBCs HCO3mDisf = 1e-4 cm^2/sec,// diffusion coefficient for HCO3- in ISF HCO3mDpc = 1e-4 cm^2/sec, // diffusion coefficient for HCO3- in PCs BCpl = 6 mM, // buffering capacity in plasma BCrbc = 54 mM, // buffering capacity in RBC BCisf = 24 mM, // buffering capacity in ISF BCpc = 45 mM, // buffering capacity in PCs CFpl = 100, // catalytic factor in plasma due to CA CFrbc = 13000, // catalytic factor in RBC due to CA CFisf = 5000, // catalytic factor in ISF due to CA CFpc = 10000; // catalytic factor in PCs due to CA //----------------------------------------------------------------------------- // Rate and equilibrium constants for the reactions of O2 and CO2 with the // hemoglobin and myoglobin (privately fixed): used for computing saturations. private real alphaO2 = 1.46e-6 M/mmHg,// O2 solubility coefficient alphaCO2 = 3.27e-5 M/mmHg,// CO2 solubility coefficient kp1 = 0.12 1/sec, // forward rate constant in CO2+H2O reaction km1 = 89 1/sec, // backward rate constant in CO2+H2O reaction KH2CO3 = 5.5e-4 M, // EQUIL constant in H2CO3 ionization K1 = (kp1/km1)*KH2CO3, // EQUIL constant in overall CO2+H2O reaction K2 = 2.95e-5, // EQUIL constant in CO2+HbNH2 reaction K3 = 2.51e-5, // EQUIL constant in CO2+O2HbNH2 reaction K4p = 202123 M^(-1), // proportionality EQUIL constant for K4 K5 = 2.63e-8 M, // EQUIL constant in HbNH3+ ionization K6 = 1.91e-8 M, // EQUIL constant in O2HbNH3+ ionization n1 = 1.05, // index on HpCrbc0/HpCrbc; unitless n2 = 0.12, // index on CO2Crbc0/CO2Crbc; unitless CHb = 5.2e-3 M, // CONC of Hb in RBC = 150/(64458*Hct) M CMb = 0.4e-3 M, // CONC of Mb in PCs = 5/(16800*FCV) M CHbrbc = 4*CHb/Wrbc, // CONC of 4Hb in the water space of RBCs CMbpc = CMb/Wpc, // CONC of Mb in the water space of PCs P50Mb = 2.4 mmHg, // P50 for MbO2 saturation pO2rbc0 = 100.0 mmHg, // standard O2 partial pressure in RBCs pCO2rbc0 = 40.0 mmHg, // standard CO2 partial pressure in RBCs pHrbc0 = 7.24, // standard pH in RBCs, unitless NormConc = 1 M, // H+ ion CONC normalization variable O2Crbc0 M, CO2Crbc0 M, HpCrbc0 M;// standard O2, CO2, H+ concentrations O2Crbc0 = alphaO2*pO2rbc0; // standard O2 concentration in RBCs CO2Crbc0 = alphaCO2*pCO2rbc0; // standard CO2 concentration in RBCs HpCrbc0 = NormConc*10^(-pHrbc0);// standard H+ concentration in RBCS //----------------------------------------------------------------------------- // Physiological variables which are computed as solutions of the problem real pO2pl(t,x) mmHg, // partial pressure of O2 in plasma pO2rbc(t,x) mmHg, // partial pressure of O2 in RBCs pO2isf(t,x) mmHg, // partial pressure of O2 in ISF pO2pc(t,x) mmHg, // partial pressure of O2 in PCs pCO2pl(t,x) mmHg, // partial pressure of CO2 in plasma pCO2rbc(t,x) mmHg, // partial pressure of CO2 in RBCs pCO2isf(t,x) mmHg, // partial pressure of CO2 in ISF pCO2pc(t,x) mmHg, // partial pressure of CO2 in PCs O2Cpl(t,x) M, // concentration of disolved O2 in plasma O2Crbc(t,x) M, // concentration of disolved O2 in RBCs O2Cisf(t,x) M, // concentration of disolved O2 in ISF O2Cpc(t,x) M, // concentration of disolved O2 in PCs CO2Cpl(t,x) M, // concentration of disolved CO2 in plasma CO2Crbc(t,x) M, // concentration of disolved CO2 in RBCs CO2Cisf(t,x) M, // concentration of disolved CO2 in ISF CO2Cpc(t,x) M, // concentration of disolved CO2 in PCs KHbO2(t,x) M^(-2.7), // Hill's coefficient for HbO2 saturation KHbCO2(t,x) M^(-1), // Hill's coefficient for HbCO2 saturation KMbO2 M^(-1), // Hill's coefficient for MbO2 saturation SHbO2(t,x), // HbO2 saturation (unitless) SHbCO2(t,x), // HbCO2 saturation (unitless) SMbO2(t,x), // MbO2 saturation (unitless) CHbO2(t,x) M, // concentration of HbO2 in RBCs CHbCO2(t,x) M, // concentration of HbCO2 in RBCs CMbO2(t,x) M, // concentration of MbO2 in RBCs TO2Crbc(t,x) M, // total O2 concentration in RBCs TCO2Crbc(t,x) M, // total CO2 concentration in RBCs TO2Cpc(t,x) M, // total O2 concentration in PCs O2Gpc(t,x) ml/min/g, // gulosity for O2 consumption in PCS MRO2pc(t,x) mol/min/g, // O2 consumption rate in PCS MRO2pcavg(t) mol/min/g, // AVG O2 consumption rate in PCS O2Cart(t) M, // O2 concentration in arterial blood O2Cven(t) M, // O2 concentration in venous blood O2extr(t), // O2 extraction (percentage; unitless) HCO3mCpl(t,x) M, // concentration of HCO3- in plasma HCO3mCrbc(t,x) M, // concentration of HCO3- in RBCs HCO3mCisf(t,x) M, // concentration of HCO3- in ISF HCO3mCpc(t,x) M, // concentration of HCO3- in PCs HpCpl(t,x) M, // concentration of H+ in plasma HpCrbc(t,x) M, // concentration of H+ in RBCs HpCisf(t,x) M, // concentration of H+ in ISF HpCpc(t,x) M, // concentration of H+ in PCs pHpl(t,x), // pH in plasma (unitless) pHrbc(t,x), // pH in RBCs (unitless) pHisf(t,x), // pH in ISF (unitless) pHpc(t,x); // pH in PCs (unitless) //----------------------------------------------------------------------------- // Intermediate variables which are computed as functions of t and x during the // computations. SIX ITERATIONS ARE USED TO COMPUTE "O2Crbc" FROM "TO2Crbc". private real Ratio0 M^(-1.7), Ratio1(t,x), Ratio2(t,x), K4(t,x) M^(-2.7), TMP1(t,x) M^(-1), TMP2(t,x) M^(-1), TMP3(t,x), TMP4(t,x), O2Crbc1(t,x) M, // free O2 in RBCs at iteration # 1 O2Crbc2(t,x) M, // free O2 in RBCs at iteration # 2 O2Crbc3(t,x) M, // free O2 in RBCs at iteration # 3 O2Crbc4(t,x) M, // free O2 in RBCs at iteration # 4 O2Crbc5(t,x) M, // free O2 in RBCs at iteration # 5 O2Crbc6(t,x) M; // free O2 in RBCs at iteration # 6 //----------------------------------------------------------------------------- // Calculations for evaluating the left boundary (x=x.min=0) conditions in the // convective (flowing) plasma and RBC regions. real // variables at the arterial end of the BTEX unit pO2art = 100 mmHg, // pO2 in the arterial end pCO2art = 40 mmHg, // pCO2 in the arterial end pHartpl = 7.4, // pH in arterial plasma pHartrbc = pHartpl + log(Rrbc); // pH in arterial RBCs private real // CALCULATIONS AT THE ARTERIAL END O2Cartpl M, O2Cartrbc M, CO2Cartpl M, CO2Cartrbc M, HpCartpl M, HpCartrbc M, HCO3mCartpl M, HCO3mCartrbc M, KHbO2art M^(-1), KHbCO2art M^(-1), SHbO2art, SHbCO2art, CHbO2art M, CHbCO2art M, TO2Cartrbc M, TCO2Cartrbc M, Ratio0art, Ratio1art, Ratio2art, K4art M^(-1), TMP1art M^(-1), TMP2art M^(-1), TMP3art, TMP4art; O2Cartpl = alphaO2*pO2art; O2Cartrbc = alphaO2*pO2art; CO2Cartpl = alphaCO2*pCO2art; CO2Cartrbc = alphaCO2*pCO2art; HpCartpl = NormConc*10^(-pHartpl); HpCartrbc = NormConc*10^(-pHartrbc); HCO3mCartpl = K1*CO2Cartpl/HpCartpl; HCO3mCartrbc = K1*CO2Cartrbc/HpCartrbc; Ratio0art = exp(1.7*ln(O2Cartrbc/O2Crbc0)); Ratio1art = exp(-n1*ln(HpCartrbc/HpCrbc0)); Ratio2art = exp(-n2*ln(CO2Cartrbc/CO2Crbc0)); TMP1art = K2/HpCartrbc; TMP2art = K3/HpCartrbc; TMP3art = (1+HpCartrbc/K5); TMP4art = (1+HpCartrbc/K6); K4art = K4p*Ratio0art*Ratio1art*Ratio2art; KHbO2art = K4art*(TMP2art*CO2Cartrbc+TMP4art)/ (TMP1art*CO2Cartrbc+TMP3art); KHbCO2art = (TMP1art+K4art*O2Cartrbc*TMP2art)/ (TMP3art+K4art*O2Cartrbc*TMP4art); SHbO2art = KHbO2art*O2Cartrbc/(1+KHbO2art*O2Cartrbc); SHbCO2art = KHbCO2art*CO2Cartrbc/(1+KHbCO2art*CO2Cartrbc); CHbO2art = CHbrbc*SHbO2art; CHbCO2art = CHbrbc*SHbCO2art; TO2Cartrbc = O2Cartrbc+CHbO2art; TCO2Cartrbc = CO2Cartrbc+CHbCO2art; //----------------------------------------------------------------------------- // Calculations for evaluating the initial (t=t.min=0) conditions real // variables in the BTEX unit at time t=0 pO2plt0 = 100 mmHg, // pO2 in plasma at t=0 pO2rbct0 = 100 mmHg, // pO2 in RBCs at t=0 pO2isft0 = 50 mmHg, // pO2 in ISF at t=0 pO2pct0 = 50 mmHg, // pO2 in PCs at t=0 pCO2plt0 = 40 mmHg, // pCO2 in plasma at t=0 pCO2rbct0 = 40 mmHg, // pCO2 in RBCs at t=0 pCO2isft0 = 50 mmHg, // pCO2 in ISF at t=0 pCO2pct0 = 50 mmHg, // pCO2 in PCs at t=0 pHplt0 = 7.4, // pH in plasma at t=0 pHrbct0 = pHplt0 + log(Rrbc), // pH in RBCs at t=0 pHisft0 = pHplt0 + log(Rcap), // pH in ISF at t=0 pHpct0 = pHisft0 + log(Rpc); // pH in PCs at t=0 private real // CALCULATIONS AT TIME t=0. O2Cplt0 M, O2Crbct0 M, O2Cisft0 M, O2Cpct0 M, CO2Cplt0 M, CO2Crbct0 M, CO2Cisft0 M, CO2Cpct0 M, HpCplt0 M, HpCrbct0 M, HpCisft0 M, HpCpct0 M, HCO3mCplt0 M, HCO3mCrbct0 M, HCO3mCisft0 M, HCO3mCpct0 M, KHbO2t0 M^(-1), KHbCO2t0 M^(-1), KMbO2t0 M^(-1), SHbO2t0, SHbCO2t0, SMbO2t0, CHbO2t0 M, CHbCO2t0 M, CMbO2t0 M, TO2Crbct0 M, TCO2Crbct0 M, TO2Cpct0 M, Ratio0t0, Ratio1t0, Ratio2t0, K4t0 M^(-1), TMP1t0 M^(-1), TMP2t0 M^(-1), TMP3t0, TMP4t0; O2Cplt0 = alphaO2*pO2plt0; O2Crbct0 = alphaO2*pO2rbct0; O2Cisft0 = alphaO2*pO2isft0; O2Cpct0 = alphaO2*pO2pct0; CO2Cplt0 = alphaCO2*pCO2plt0; CO2Crbct0 = alphaCO2*pCO2rbct0; CO2Cisft0 = alphaCO2*pCO2isft0; CO2Cpct0 = alphaCO2*pCO2pct0; HpCplt0 = NormConc*10^(-pHplt0); HpCrbct0 = NormConc*10^(-pHrbct0); HpCisft0 = NormConc*10^(-pHisft0); HpCpct0 = NormConc*10^(-pHpct0); HCO3mCplt0 = K1*CO2Cplt0/HpCplt0; HCO3mCrbct0 = K1*CO2Crbct0/HpCrbct0; HCO3mCisft0 = K1*CO2Cisft0/HpCisft0; HCO3mCpct0 = K1*CO2Cpct0/HpCpct0; Ratio0t0 = exp(1.7*ln(O2Crbct0/O2Crbc0)); Ratio1t0 = exp(-n1*ln(HpCrbct0/HpCrbc0)); Ratio2t0 = exp(-n2*ln(CO2Crbct0/CO2Crbc0)); TMP1t0 = K2/HpCrbct0; TMP2t0 = K3/HpCrbct0; TMP3t0 = (1+HpCrbct0/K5); TMP4t0 = (1+HpCrbct0/K6); K4t0 = K4p*Ratio0t0*Ratio1t0*Ratio2t0; KHbO2t0 = K4t0*(TMP2t0*CO2Crbct0+TMP4t0)/(TMP1t0*CO2Crbct0+TMP3t0); KHbCO2t0 = (TMP1t0+K4t0*O2Crbct0*TMP2t0)/(TMP3t0+K4t0*O2Crbct0*TMP4t0); KMbO2t0 = (alphaO2*P50Mb)^(-1); SHbO2t0 = KHbO2t0*O2Crbct0/(1+KHbO2t0*O2Crbct0); SHbCO2t0 = KHbCO2t0*CO2Crbct0/(1+KHbCO2t0*CO2Crbct0); SMbO2t0 = KMbO2t0*O2Cpct0/(1+KMbO2t0*O2Cpct0); CHbO2t0 = CHbrbc*SHbO2t0; CHbCO2t0 = CHbrbc*SHbCO2t0; CMbO2t0 = CMbpc*SMbO2t0; TO2Crbct0 = O2Crbct0+CHbO2t0; TCO2Crbct0 = CO2Crbct0+CHbCO2t0; TO2Cpct0 = O2Cpct0+CMbO2t0; //----------------------------------------------------------------------------- // Initial (t=t.min=0) and boundary (x=x.min=0 & x=x.max=L) conditions. The // above derived boundary conditions are used at the arterial end (x=0) of // the capillary. Zero flux conditions are used at the venous end (x=L) of // the capillary as well as at x=0 and x=L of the tissue region. when (t=t.min) { // INITIAL CONDITIONS O2Cpl = if (x=x.min) O2Cartpl else O2Cplt0; TO2Crbc = if (x=x.min) TO2Cartrbc else TO2Crbct0; O2Cisf = O2Cisft0; TO2Cpc = TO2Cpct0; CO2Cpl = if (x=x.min) CO2Cartpl else CO2Cplt0; TCO2Crbc = if (x=x.min) TCO2Cartrbc else TCO2Crbct0; CO2Cisf = CO2Cisft0; CO2Cpc = CO2Cpct0; HCO3mCpl = if (x=x.min) HCO3mCartpl else HCO3mCplt0; HCO3mCrbc = if (x=x.min) HCO3mCartrbc else HCO3mCrbct0; HCO3mCisf = HCO3mCisft0; HCO3mCpc = HCO3mCpct0; HpCpl = if (x=x.min) HpCartpl else HpCplt0; HpCrbc = if (x=x.min) HpCartrbc else HpCrbct0; HpCisf = HpCisft0; HpCpc = HpCpct0; } when (x=x.min) { // LEFT BOUNDARY CONDITIONS O2Cpl = O2Cartpl; TO2Crbc = TO2Cartrbc; O2Cisf:x = 0; TO2Cpc:x = 0; CO2Cpl = CO2Cartpl; TCO2Crbc = TCO2Cartrbc; CO2Cisf:x = 0; CO2Cpc:x = 0; HCO3mCpl = HCO3mCartpl; HCO3mCrbc = HCO3mCartrbc; HCO3mCisf:x = 0; HCO3mCpc:x = 0; HpCpl = HpCartpl; HpCrbc = HpCartrbc; HpCisf:x = 0; HpCpc:x = 0; O2Cart = (1-H)*Wpl*O2Cpl + H*Wrbc*TO2Crbc; } when (x=x.max) { // RIGHT BOUNDARY CONDITIONS O2Cpl:x = 0; TO2Crbc:x = 0; O2Cisf:x = 0; TO2Cpc:x = 0; CO2Cpl:x = 0; TCO2Crbc:x = 0; CO2Cisf:x = 0; CO2Cpc:x = 0; HCO3mCpl:x = 0; HCO3mCrbc:x = 0; HCO3mCisf:x = 0; HCO3mCpc:x = 0; HpCpl:x = 0; HpCrbc:x = 0; HpCisf:x = 0; HpCpc:x = 0; O2Cven = (1-H)*Wpl*O2Cpl + H*Wrbc*TO2Crbc; O2extr = (O2Cart - O2Cven)/O2Cart; MRO2pcavg = Fb*O2extr*O2Cart; } //----------------------------------------------------------------------------- // Equations for Hill coefficients KHbO2, KHbCO2 and KMbO2, saturations SHbO2, // SHbCO2 and SMbO2, and concentrations CHbO2, CHbCO2 and CMbO2. KMbO2 is the // equilibrium constant in Mb+O2 <--> MbO2 reaction. KHbO2 and KHbCO2 do not // vary appreciably with CO2Crbc. So KHbO2 and KHbCO2 are evaluated using the // normal value of CO2Crbc at the arterial end (i.e. CO2Cartrbc or CO2rbc0). // This way the system of equations are DISTANGLED and solved in JSIMSTUDIO. // Even KHbCO2 do not vary appreciably with O2Crbc. So KHbCO2 is evaluated // using the normal value of O2Crbc at the arterial end (i.e. O2Cartrbc or // O2rbc0). To avoid this we need a nonlinear solver in JSIMSTUDIO. Ratio0 = O2Crbc0^(-1.7); Ratio1 = exp(-n1*ln(HpCrbc/HpCrbc0)); Ratio2 = exp(-n2*ln(CO2Cartrbc/CO2Crbc0)); TMP1 = K2/HpCrbc; TMP2 = K3/HpCrbc; TMP3 = (1+HpCrbc/K5); TMP4 = (1+HpCrbc/K6); K4 = K4p*Ratio0*Ratio1*Ratio2; KHbO2 = K4*(TMP2*CO2Cartrbc+TMP4)/(TMP1*CO2Cartrbc+TMP3); KHbCO2 = (TMP1+K4*(O2Crbc^2.7)*TMP2)/(TMP3+K4*(O2Crbc^2.7)*TMP4); KMbO2 = (alphaO2*P50Mb)^(-1); SHbO2 = KHbO2*(O2Crbc^2.7)/(1+KHbO2*(O2Crbc^2.7)); SHbCO2 = KHbCO2*CO2Crbc/(1+KHbCO2*CO2Crbc); SMbO2 = KMbO2*O2Cpc/(1+KMbO2*O2Cpc); CHbO2 = CHbrbc*SHbO2; CHbCO2 = CHbrbc*SHbCO2; CMbO2 = CMbpc*SMbO2; //----------------------------------------------------------------------------- // Compute the partial pressures of O2 and CO2 and pH in the four regions // of the BTEX unit pO2pl = O2Cpl/alphaO2; pO2rbc = O2Crbc/alphaO2; pO2isf = O2Cisf/alphaO2; pO2pc = O2Cpc/alphaO2; pCO2pl = CO2Cpl/alphaCO2; pCO2rbc = CO2Crbc/alphaCO2; pCO2isf = CO2Cisf/alphaCO2; pCO2pc = CO2Cpc/alphaCO2; pHpl = -log(HpCpl/NormConc); pHrbc = -log(HpCrbc/NormConc); pHisf = -log(HpCisf/NormConc); pHpc = -log(HpCpc/NormConc); //----------------------------------------------------------------------------- // PDEs for O2 transport in plasma, RBCs, ISF, and parenchymal cells, where // TO2Crbc = O2Crbc + CHbrbc*SHbO2(O2Crbc). To find O2Crbc as a function of // TO2Crbc, the above relation need to be inverted. This is NOT possible // in JSIMSTUDIO since there is NO non-linear algebraic solver available. // SO A MANUAL ITERATIVE METHOD IS USED. However, the equivalent relation // in parenchymal cells [i.e., TO2Cpc = O2Cpc + CMbpc*SMbO2(O2Cpc)] leads to // a quadratic equation for O2Cpc. It is solved analytically to find O2Cpc. O2Cpl:t = - (Fpl/Vpl)*L*(O2Cpl:x) + (O2PSrbc/VWpl)*(O2Crbc-O2Cpl) - (O2PScap/VWpl)*(O2Cpl-O2Cisf) + O2Dpl*(O2Cpl:x:x); TO2Crbc:t = - (Frbc/Vrbc)*L*(TO2Crbc:x) - (O2PSrbc/VWrbc)*(O2Crbc-O2Cpl) + O2Drbc*(TO2Crbc:x:x); O2Cisf:t = (O2PScap/VWisf)*(O2Cpl-O2Cisf) - (O2PSpc/VWisf)*(O2Cisf-O2Cpc) + O2Disf*(O2Cisf:x:x); TO2Cpc:t = (O2PSpc/VWpc)*(O2Cisf-O2Cpc) + O2Dpc*(TO2Cpc:x:x) - (O2Gpc/VWpc)*O2Cpc; O2Crbc1 = O2Cartrbc; O2Crbc2 = ((TO2Crbc-O2Crbc1)/(KHbO2*(CHbrbc-(TO2Crbc-O2Crbc1))))^(1/2.7); O2Crbc3 = ((TO2Crbc-O2Crbc2)/(KHbO2*(CHbrbc-(TO2Crbc-O2Crbc2))))^(1/2.7); O2Crbc4 = ((TO2Crbc-O2Crbc3)/(KHbO2*(CHbrbc-(TO2Crbc-O2Crbc3))))^(1/2.7); O2Crbc5 = ((TO2Crbc-O2Crbc4)/(KHbO2*(CHbrbc-(TO2Crbc-O2Crbc4))))^(1/2.7); O2Crbc6 = ((TO2Crbc-O2Crbc5)/(KHbO2*(CHbrbc-(TO2Crbc-O2Crbc5))))^(1/2.7); O2Crbc = O2Crbc6; O2Cpc = if (TO2Cpc <= 0) 0 else (((1+KMbO2*(CMbpc-TO2Cpc))^2 + 4*KMbO2*TO2Cpc)^0.5 - (1+KMbO2*(CMbpc-TO2Cpc)))/(2*KMbO2); O2Gpc = Vmax/(Km+O2Cpc); MRO2pc = O2Gpc*O2Cpc; //----------------------------------------------------------------------------- // PDEs for CO2 in plasma, RBCs, ISF, and parenchymal cells. To find // CO2Crbc as a function of TCO2Crbc, the quadratic equation TCO2Crbc= // CO2Crbc+CHbrbc*SHbCO2 is inverted analytically. CO2Cpl:t = - (Fpl/Vpl)*L*(CO2Cpl:x) + (CO2PSrbc/VWpl)*(CO2Crbc-CO2Cpl) - (CO2PScap/VWpl)*(CO2Cpl-CO2Cisf) + CO2Dpl*(CO2Cpl:x:x) - CFpl*(kp1*CO2Cpl-(km1/KH2CO3)*HCO3mCpl*HpCpl); TCO2Crbc:t = - (Frbc/Vrbc)*L*(TCO2Crbc:x) - (CO2PSrbc/VWrbc)*(CO2Crbc-CO2Cpl) + CO2Drbc*(TCO2Crbc:x:x) - CFrbc*(kp1*CO2Crbc-(km1/KH2CO3)*HCO3mCrbc*HpCrbc); CO2Cisf:t = (CO2PScap/VWisf)*(CO2Cpl-CO2Cisf) - (CO2PSpc/VWisf)*(CO2Cisf-CO2Cpc) + CO2Disf*(CO2Cisf:x:x) - CFisf*(kp1*CO2Cisf-(km1/KH2CO3)*HCO3mCisf*HpCisf); CO2Cpc:t = (CO2PSpc/VWpc)*(CO2Cisf-CO2Cpc) + CO2Dpc*(CO2Cpc:x:x) + RQ*(O2Gpc/VWpc)*O2Cpc - CFpc*(kp1*CO2Cpc-(km1/KH2CO3)*HCO3mCpc*HpCpc); CO2Crbc = if (TCO2Crbc <= 0) 0 else (((1+KHbCO2*(CHbrbc-TCO2Crbc))^2 + 4*KHbCO2*TCO2Crbc)^0.5 - (1+KHbCO2*(CHbrbc-TCO2Crbc)))/(2*KHbCO2); //----------------------------------------------------------------------------- // PDEs for HCO3- ions in plasma, RBCs, ISF, and parenchymal cells. HCO3mCpl:t = - (Fpl/Vpl)*L*(HCO3mCpl:x) + (HCO3mPSrbc/VWpl)*(HCO3mCrbc-Rrbc*HCO3mCpl) - (HCO3mPScap/VWpl)*(Rcap*HCO3mCpl-HCO3mCisf) + HCO3mDpl*(HCO3mCpl:x:x) + CFpl*(kp1*CO2Cpl-(km1/KH2CO3)*HCO3mCpl*HpCpl); HCO3mCrbc:t = - (Frbc/Vrbc)*L*(HCO3mCrbc:x) - (HCO3mPSrbc/VWrbc)*(HCO3mCrbc-Rrbc*HCO3mCpl) + HCO3mDrbc*(HCO3mCrbc:x:x) + CFrbc*(kp1*CO2Crbc-(km1/KH2CO3)*HCO3mCrbc*HpCrbc); HCO3mCisf:t = (HCO3mPScap/VWisf)*(Rcap*HCO3mCpl-HCO3mCisf) - (HCO3mPSpc/VWisf)*(Rpc*HCO3mCisf-HCO3mCpc) + HCO3mDisf*(HCO3mCisf:x:x) + CFisf*(kp1*CO2Cisf-(km1/KH2CO3)*HCO3mCisf*HpCisf); HCO3mCpc:t = (HCO3mPSpc/VWpc)*(Rpc*HCO3mCisf-HCO3mCpc) + HCO3mDpc*(HCO3mCpc:x:x) + CFpc*(kp1*CO2Cpc-(km1/KH2CO3)*HCO3mCpc*HpCpc); //----------------------------------------------------------------------------- // PDEs for H+ ions in plasma, RBCs, ISF, and parenchymal cells. HpCpl:t = - (Fpl/Vpl)*L*(HpCpl:x) + (HpPSrbc/VWpl)*(Rrbc*HpCrbc-HpCpl) - (HpPScap/VWpl)*(HpCpl-Rcap*HpCisf) + HpDpl*(HpCpl:x:x) + (2.303/BCpl)*HpCpl * CFpl*(kp1*CO2Cpl-(km1/KH2CO3)*HCO3mCpl*HpCpl); HpCrbc:t = - (Frbc/Vrbc)*L*(HpCrbc:x) - (HpPSrbc/VWrbc)*(Rrbc*HpCrbc-HpCpl) + HpDrbc*(HpCrbc:x:x) + (2.303/BCrbc)*HpCrbc * CFrbc*(kp1*CO2Crbc-(km1/KH2CO3)*HCO3mCrbc*HpCrbc); HpCisf:t = (HpPScap/VWisf)*(HpCpl-Rcap*HpCisf) - (HpPSpc/VWisf)*(HpCisf-Rpc*HpCpc) + HpDisf*(HpCisf:x:x) + (2.303/BCisf)*HpCisf * CFisf*(kp1*CO2Cisf-(km1/KH2CO3)*HCO3mCisf*HpCisf); HpCpc:t = (HpPSpc/VWpc)*(HpCisf-Rpc*HpCpc) + HpDpc*(HpCpc:x:x) + (2.303/BCpc)*HpCpc * CFpc*(kp1*CO2Cpc-(km1/KH2CO3)*HCO3mCpc*HpCpc); } //-----------------------------------------------------------------------------