/* * Computational modeling of cardiovascular response to orthostatic * stress * * Model Status * * This CellML model runs in both COR and PCEnv. The units have * been checked and they balance. This is a lumped parameter model * for cardiac activation based on the work of Heldt et al. 2002. * This CellMl model represents a structurally complete model of * a lumped parameter, physiologically-based circulatory system. * It uses the Heldt et al activation function and extends the * lumped parameter circulation model such that the circulation * through organs is represented. The circulation includes pressures, * flows, and transport of a simple substance 'x' which is neither * metabolised or excreted. The parameter values for resistors, * capacitors, or inductors are not quite right as the flows are * not distributed according to other studies and the time-course * of substance around the circuit is not correct either - hence * it is just structurally correct. * * Model Structure * * ABSTRACT: The objective of this study is to develop a model * of the cardiovascular system capable of simulating the short-term * (less than or equal to 5 min) transient and steady-state hemodynamic * responses to head-up tilt and lower body negative pressure. * The model consists of a closed-loop lumped-parameter representation * of the circulation connected to set-point models of the arterial * and cardiopulmonary baroreflexes. Model parameters are largely * based on literature values. Model verification was performed * by comparing the simulation output under baseline conditions * and at different levels of orthostatic stress to sets of population-averaged * hemodynamic data reported in the literature. On the basis of * experimental evidence, we adjusted some model parameters to * simulate experimental data. Orthostatic stress simulations are * not statistically different from experimental data (two-sided * test of significance with Bonferroni adjustment for multiple * comparisons). Transient response characteristics of heart rate * to tilt also compare well with reported data. A case study is * presented on how the model is intended to be used in the future * to investigate the effects of post-spaceflight orthostatic intolerance. * * model diagram * * [[Image file: heldt_2002c.png]] * * Schematic diagram of full body circulation model. * * The original paper reference is cited below: * * Computational modeling of cardiovascular response to orthostatic * stress, T. Heldt, E.B. Shim, R.D. Kamm, and R.G. Mark, 2002, * Journal of Applied Physiology, 92, 1239-1254. PubMed ID: 11842064 */ import nsrunit; // Warning: unit conversion turned off due to unit errors in 4 equation(s) unit conversion off; //Warning: unit mmHg_ renamed from mmHg, as the latter is predefined in JSim with different fundamental units. unit mmHg_=133.322 kilogram^1*meter^(-1)*second^(-2); unit elastance=1.33322E8 kilogram^1*meter^(-4)*second^(-2); unit mL=1E-6 meter^3; unit s=1 second^1; unit Hz=1 second^(-1); unit flow=1E-6 meter^3*second^(-1); unit inductance=1.33322E8 kilogram^1*meter^(-4); unit resistance=1.33322E8 kilogram^1*meter^(-4)*second^(-1); unit capacitance=7.5006376E-9 kilogram^(-1)*meter^4*second^2; unit concentration=1 dimensionless; unit ratepm=60 second^(-1); unit Hz2rpm=60 dimensionless; unit ms=.001 second^1; math main { realDomain realtime ms; realtime.min=0; extern realtime.max; extern realtime.delta; real HR ratepm; HR=77; real hrf Hz; real LATiming.beattime(realtime) ms; real LAElastanceFunction.Esys elastance; LAElastanceFunction.Esys=0.145; real LAElastanceFunction.Edia elastance; LAElastanceFunction.Edia=0.131; real LAElastanceFunction.TsK ms; LAElastanceFunction.TsK=0.2; real LAElastanceFunction.Ts ms; real E_LA(realtime) elastance; real P_PV(realtime) mmHg_; real F_LV(realtime) flow; real P_LA_ext mmHg_; P_LA_ext=0; real V_LA(realtime) mL; when(realtime=realtime.min) V_LA=144.038898121062; real V_LA_0 mL; V_LA_0=15; real P_LA(realtime) mmHg_; real F_LA(realtime) flow; real R_LA resistance; R_LA=0.01; real conc_X_LA(realtime) concentration; real conc_X_PV(realtime) concentration; real sub_X_LA(realtime) mL; when(realtime=realtime.min) sub_X_LA=0; real PRint ms; PRint=0.12; real LVTiming.beattime(realtime) second; real LVElastanceFunction.Esys elastance; LVElastanceFunction.Esys=5.6; real LVElastanceFunction.Edia elastance; LVElastanceFunction.Edia=0.19; real LVElastanceFunction.TsK second; LVElastanceFunction.TsK=0.35; real LVElastanceFunction.Ts second; real E_LV(realtime) elastance; real F_AO(realtime) flow; real F_CO(realtime) flow; real pLVPext mmHg_; pLVPext=0; real V_LV(realtime) mL; when(realtime=realtime.min) V_LV=118.75315693072; real V_LV_0 mL; V_LV_0=30; real P_LV(realtime) mmHg_; real R_LV resistance; R_LV=0.001; real conc_X_LV(realtime) concentration; real sub_X_LV(realtime) mL; when(realtime=realtime.min) sub_X_LV=0; real fiber_stress(realtime) mmHg_; real F_CR(realtime) flow; real F_AR(realtime) flow; real C_AO capacitance; C_AO=1.2; real L_AO inductance; L_AO=5e-5; real R_AO resistance; R_AO=0.01; real V_AO_0 mL; V_AO_0=200; real V_AO(realtime) mL; when(realtime=realtime.min) V_AO=302.714548324312; real F_AOalways(realtime) flow; when(realtime=realtime.min) F_AOalways=-6898.97886842467; real P_AO(realtime) mmHg_; real conc_X_AO(realtime) concentration; real sub_X_AO(realtime) mL; when(realtime=realtime.min) sub_X_AO=0; real P_RA(realtime) mmHg_; real R_CO resistance; R_CO=1; real R_COV resistance; R_COV=0.2; real V_CO_0 mL; V_CO_0=10; real C_CO capacitance; C_CO=0.1; real F_COV(realtime) flow; real V_CO(realtime) mL; when(realtime=realtime.min) V_CO=11.4012164759732; real P_CO(realtime) mmHg_; real conc_X_CO(realtime) concentration; real sub_X_CO(realtime) mL; when(realtime=realtime.min) sub_X_CO=0; real P_VC(realtime) mmHg_; real R_CR resistance; R_CR=5; real R_CRV resistance; R_CRV=0.02; real V_CR_0 mL; V_CR_0=10; real C_CR capacitance; C_CR=1; real F_CRV(realtime) flow; real V_CR(realtime) mL; when(realtime=realtime.min) V_CR=27.2147903053333; real P_CR(realtime) mmHg_; real conc_X_CR(realtime) concentration; real sub_X_CR(realtime) mL; when(realtime=realtime.min) sub_X_CR=0; real conc_X_CRtissue(realtime) concentration; real D_CRtissue flow; D_CRtissue=1; real V_CRtissue mL; V_CRtissue=1; real sub_X_CRtissue(realtime) mL; when(realtime=realtime.min) sub_X_CRtissue=0; real F_AD(realtime) flow; real F_MU(realtime) flow; real F_GI(realtime) flow; real F_LI(realtime) flow; real F_KI(realtime) flow; real F_OT(realtime) flow; real F_SK(realtime) flow; real R_AR resistance; R_AR=1.5; real C_AR capacitance; C_AR=0.5; real V_AR_0 mL; V_AR_0=370; real V_AR(realtime) mL; when(realtime=realtime.min) V_AR=383.557125288364; real P_AR(realtime) mmHg_; real conc_X_AR(realtime) concentration; real sub_X_AR(realtime) mL; when(realtime=realtime.min) sub_X_AR=0; real P_VE(realtime) mmHg_; real C_AD capacitance; C_AD=1.81; real R_AD resistance; R_AD=1; real R_ADV resistance; R_ADV=0.33; real V_AD_0 mL; V_AD_0=75; real V_AD(realtime) mL; when(realtime=realtime.min) V_AD=111.639088723426; real F_ADV(realtime) flow; real P_AD(realtime) mmHg_; real conc_X_AD(realtime) concentration; real sub_X_AD(realtime) mL; when(realtime=realtime.min) sub_X_AD=0; real C_MU capacitance; C_MU=1.81; real R_MU resistance; R_MU=1; real R_MUV resistance; R_MUV=0.33; real V_MU_0 mL; V_MU_0=75; real V_MU(realtime) mL; when(realtime=realtime.min) V_MU=111.639088723426; real F_MUV(realtime) flow; real P_MU(realtime) mmHg_; real conc_X_MU(realtime) concentration; real sub_X_MU(realtime) mL; when(realtime=realtime.min) sub_X_MU=0; real P_LI(realtime) mmHg_; real C_GI capacitance; C_GI=1.81; real R_GI resistance; R_GI=1; real R_GIV resistance; R_GIV=0.33; real V_GI_0 mL; V_GI_0=75; real V_GI(realtime) mL; when(realtime=realtime.min) V_GI=111.639088723426; real F_GIV(realtime) flow; real P_GI(realtime) mmHg_; real conc_X_GI(realtime) concentration; real sub_X_GI(realtime) mL; when(realtime=realtime.min) sub_X_GI=0; real C_LI capacitance; C_LI=1.81; real R_LI resistance; R_LI=1; real R_LIV resistance; R_LIV=0.33; real V_LI_0 mL; V_LI_0=75; real V_LI(realtime) mL; when(realtime=realtime.min) V_LI=111.639088723426; real F_LIV(realtime) flow; real conc_X_LI(realtime) concentration; real sub_X_LI(realtime) mL; when(realtime=realtime.min) sub_X_LI=0; real metabolism flow; metabolism=0; real C_KI capacitance; C_KI=1.81; real R_KI resistance; R_KI=1; real V_KI_0 mL; V_KI_0=75; real R_KIV resistance; R_KIV=0.33; real V_KI(realtime) mL; when(realtime=realtime.min) V_KI=111.639088723426; real F_KIV(realtime) flow; real P_KI(realtime) mmHg_; real conc_X_KI(realtime) concentration; real sub_X_KI(realtime) mL; when(realtime=realtime.min) sub_X_KI=0; real C_SK capacitance; C_SK=1.81; real R_SK resistance; R_SK=1; real R_SKV resistance; R_SKV=0.33; real V_SK_0 mL; V_SK_0=75; real V_SK(realtime) mL; when(realtime=realtime.min) V_SK=111.639088723426; real F_SKV(realtime) flow; real P_SK(realtime) mmHg_; real conc_X_SK(realtime) concentration; real sub_X_SK(realtime) mL; when(realtime=realtime.min) sub_X_SK=0; real C_OT capacitance; C_OT=1.81; real R_OT resistance; R_OT=1; real R_OTV resistance; R_OTV=0.33; real V_OT_0 mL; V_OT_0=75; real V_OT(realtime) mL; when(realtime=realtime.min) V_OT=111.639088723426; real F_OTV(realtime) flow; real P_OT(realtime) mmHg_; real conc_X_OT(realtime) concentration; real sub_X_OT(realtime) mL; when(realtime=realtime.min) sub_X_OT=0; real R_VEV resistance; R_VEV=0.0223; real V_VE(realtime) mL; when(realtime=realtime.min) V_VE=833.291684587657; real C_VE capacitance; C_VE=13.24; real V_VE_0 mL; V_VE_0=596; real F_VE(realtime) flow; real F_VEV(realtime) flow; real conc_X_VE(realtime) concentration; real sub_X_VE(realtime) mL; when(realtime=realtime.min) sub_X_VE=5; real R_VCV resistance; R_VCV=0.0267; real V_VC(realtime) mL; when(realtime=realtime.min) V_VC=1849.93788284599; real V_VC_0 mL; V_VC_0=600; real C_VC capacitance; C_VC=73.88; real F_VC(realtime) flow; real F_VCV(realtime) flow; real conc_X_VC(realtime) concentration; real sub_X_VC(realtime) mL; when(realtime=realtime.min) sub_X_VC=0; real RATiming.beattime(realtime) second; real RAElastanceFunction.Esys elastance; RAElastanceFunction.Esys=0.11; real RAElastanceFunction.Edia elastance; RAElastanceFunction.Edia=0.099; real RAElastanceFunction.TsK second; RAElastanceFunction.TsK=0.2; real RAElastanceFunction.Ts second; real E_RA(realtime) elastance; real F_RV(realtime) flow; real P_RA_ext mmHg_; P_RA_ext=0; real V_RA(realtime) mL; when(realtime=realtime.min) V_RA=152.150765432928; real V_RA_0 mL; V_RA_0=15; real F_RA(realtime) flow; real conc_X_RA(realtime) concentration; real sub_X_RA(realtime) mL; when(realtime=realtime.min) sub_X_RA=0; real PRinterval second; PRinterval=0.12; real RVTiming.beattime(realtime) second; real RVElastanceFunction.Esys elastance; RVElastanceFunction.Esys=0.67; real RVElastanceFunction.Edia elastance; RVElastanceFunction.Edia=0.104; real RVElastanceFunction.TsK second; RVElastanceFunction.TsK=0.35; real RVElastanceFunction.Ts second; real E_RV(realtime) elastance; real F_PA(realtime) flow; real P_RV_ext mmHg_; P_RV_ext=0; real V_RV(realtime) mL; when(realtime=realtime.min) V_RV=154.337916417774; real V_RV_0 mL; V_RV_0=25; real P_RV(realtime) mmHg_; real R_RV resistance; R_RV=0.002; real conc_X_RV(realtime) concentration; real sub_X_RV(realtime) mL; when(realtime=realtime.min) sub_X_RV=0; real F_Pa(realtime) flow; real R_PA resistance; R_PA=0.0227; real C_PA capacitance; C_PA=2.222; real V_PA_0 mL; V_PA_0=50; real V_PA(realtime) mL; when(realtime=realtime.min) V_PA=112.059036699839; real P_PA(realtime) mmHg_; real conc_X_PA(realtime) concentration; real sub_X_PA(realtime) mL; when(realtime=realtime.min) sub_X_PA=0; real F_PC(realtime) flow; real F_SH(realtime) flow; real V_Pa(realtime) mL; when(realtime=realtime.min) V_Pa=66.9910537203609; real C_Pa capacitance; C_Pa=1.481; real R_Pa resistance; R_Pa=0.053; real V_Pa_0 mL; V_Pa_0=30; real P_Pa(realtime) mmHg_; real conc_X_Pa(realtime) concentration; real sub_X_Pa(realtime) mL; when(realtime=realtime.min) sub_X_Pa=0; real R_SH resistance; R_SH=2; real P_PC(realtime) mmHg_; real C_PC capacitance; C_PC=1.778; real R_PC resistance; R_PC=0.0379; real R_PCV resistance; R_PCV=0.0379; real V_PC_0 mL; V_PC_0=53; real V_PC(realtime) mL; when(realtime=realtime.min) V_PC=91.7784213531534; real F_PCV(realtime) flow; real conc_X_PC(realtime) concentration; real sub_X_PC(realtime) mL; when(realtime=realtime.min) sub_X_PC=0; real C_PV capacitance; C_PV=5; real V_PV_0 mL; V_PV_0=150; real V_PV(realtime) mL; when(realtime=realtime.min) V_PV=239.25897115602; real F_PV(realtime) flow; real sub_X_PV(realtime) mL; when(realtime=realtime.min) sub_X_PV=0; // hrf=(HR/(.06 Hz2rpm)); // LATiming.beattime=((realtime-floor(realtime/hrf)*hrf)/1E3); // LAElastanceFunction.Ts=(LAElastanceFunction.TsK*sqrt(hrf/(1E3 Hz))); E_LA=(if ((LATiming.beattime>=(0 ms)) and (LATiming.beattime<=LAElastanceFunction.Ts)) LAElastanceFunction.Edia+(LAElastanceFunction.Esys-LAElastanceFunction.Edia)*(1-cos(3.141592653589793*LATiming.beattime/LAElastanceFunction.Ts))/2 else if ((LATiming.beattime<(1.5*LAElastanceFunction.Ts)) and (LATiming.beattime>=LAElastanceFunction.Ts)) LAElastanceFunction.Edia+(LAElastanceFunction.Esys-LAElastanceFunction.Edia)*(1+cos(2*3.141592653589793*(LATiming.beattime-LAElastanceFunction.Ts)/LAElastanceFunction.Ts))/2 else LAElastanceFunction.Edia); // sub_X_LA:realtime=((conc_X_PV*F_LA-conc_X_LA*F_LV)/1E3); conc_X_LA=(sub_X_LA/V_LA); P_LA=(E_LA*(V_LA-V_LA_0)+P_LA_ext); F_LA=((P_PV-P_LA)/R_LA); V_LA:realtime=((F_LA-F_LV)/1E3); // LVTiming.beattime=((realtime-floor(realtime/hrf)*hrf)/1E3-PRint); // LVElastanceFunction.Ts=(LVElastanceFunction.TsK*sqrt(hrf/(1E3 Hz))); E_LV=(if ((LVTiming.beattime>=(0 second)) and (LVTiming.beattime<=LVElastanceFunction.Ts)) LVElastanceFunction.Edia+(LVElastanceFunction.Esys-LVElastanceFunction.Edia)*(1-cos(3.141592653589793*LVTiming.beattime/LVElastanceFunction.Ts))/2 else if ((LVTiming.beattime<(1.5*LVElastanceFunction.Ts)) and (LVTiming.beattime>=LVElastanceFunction.Ts)) LVElastanceFunction.Edia+(LVElastanceFunction.Esys-LVElastanceFunction.Edia)*(1+cos(2*3.141592653589793*(LVTiming.beattime-LVElastanceFunction.Ts)/LVElastanceFunction.Ts))/2 else LVElastanceFunction.Edia); // fiber_stress=(P_LV*(1+3*V_LV/(200 mL))); sub_X_LV:realtime=((conc_X_LA*F_LV-conc_X_LV*(F_AO+F_CO))/1E3); conc_X_LV=(sub_X_LV/V_LV); P_LV=(E_LV*(V_LV-V_LV_0)+pLVPext); F_LV=(if (P_LA>P_LV) (P_LA-P_LV)/R_LV else (0 flow)); V_LV:realtime=((F_LV-F_AO-F_CO)/1E3); // sub_X_AO:realtime=((conc_X_LV*F_AO-conc_X_AO*(F_CR+F_AR))/1E3); conc_X_AO=(sub_X_AO/V_AO); F_AOalways:realtime=((1/L_AO*(P_LV-P_AO)-R_AO/L_AO*F_AOalways)/1E3); F_AO=(if (P_LV>P_AO) F_AOalways else (0 flow)); V_AO:realtime=((F_AO-F_AR-F_CR)/1E3); P_AO=(1/C_AO*(V_AO-V_AO_0)); // sub_X_CO:realtime=((conc_X_LV*F_CO-conc_X_CO*F_COV)/1E3); conc_X_CO=(sub_X_CO/V_CO); V_CO:realtime=((F_CO-F_COV)/1E3); P_CO=(1/C_CO*(V_CO-V_CO_0)); F_CO=(if (P_LV>P_CO) (P_LV-P_CO)/R_CO else (0 flow)); F_COV=((P_CO-P_RA)/R_COV); // conc_X_CRtissue=(sub_X_CRtissue/V_CRtissue); sub_X_CRtissue:realtime=((conc_X_CR-conc_X_CRtissue)*D_CRtissue/1E3); sub_X_CR:realtime=((conc_X_AO*F_CR-conc_X_CR*F_CRV-(conc_X_CR-conc_X_CRtissue)*D_CRtissue)/1E3); conc_X_CR=(sub_X_CR/V_CR); V_CR:realtime=((F_CR-F_CRV)/1E3); P_CR=(1/C_CR*(V_CR-V_CR_0)); F_CR=((P_AO-P_CR)/R_CR); F_CRV=((P_CR-P_VC)/R_CRV); // sub_X_AR:realtime=((conc_X_AO*F_AR-conc_X_AR*(F_SK+F_AD+F_MU+F_GI+F_LI+F_KI+F_OT))/1E3); conc_X_AR=(sub_X_AR/V_AR); V_AR:realtime=((F_AR-F_AD-F_MU-F_GI-F_LI-F_KI-F_OT-F_SK)/1E3); P_AR=(1/C_AR*(V_AR-V_AR_0)); F_AR=((P_AO-P_AR)/R_AR); // sub_X_AD:realtime=((conc_X_AR*F_AD-conc_X_AD*F_ADV)/1E3); conc_X_AD=(sub_X_AD/V_AD); V_AD:realtime=((F_AD-F_ADV)/1E3); F_ADV=((P_AD-P_VE)/R_ADV); P_AD=(1/C_AD*(V_AD-V_AD_0)); F_AD=((P_AR-P_AD)/R_AD); // sub_X_MU:realtime=((conc_X_AR*F_MU-conc_X_MU*F_MUV)/1E3); conc_X_MU=(sub_X_MU/V_MU); V_MU:realtime=((F_MU-F_MUV)/1E3); F_MUV=((P_MU-P_VE)/R_MUV); P_MU=(1/C_MU*(V_MU-V_MU_0)); F_MU=((P_AR-P_MU)/R_MU); // sub_X_GI:realtime=((conc_X_AR*F_GI-conc_X_GI*F_GIV)/1E3); conc_X_GI=(sub_X_GI/V_GI); V_GI:realtime=((F_GI-F_GIV)/1E3); F_GIV=((P_GI-P_LI)/R_GIV); P_GI=(1/C_GI*(V_GI-V_GI_0)); F_GI=((P_AR-P_GI)/R_GI); // sub_X_LI:realtime=((conc_X_GI*F_GIV+conc_X_AR*F_LI-conc_X_LI*F_LIV+conc_X_LI*metabolism)/1E3); conc_X_LI=(sub_X_LI/V_LI); V_LI:realtime=((F_GIV+F_LI-F_LIV)/1E3); F_LIV=((P_LI-P_VE)/R_LIV); P_LI=(1/C_LI*(V_LI-V_LI_0)); F_LI=((P_AR-P_LI)/R_LI); // sub_X_KI:realtime=((conc_X_AR*F_KI-conc_X_KI*F_KIV)/1E3); conc_X_KI=(sub_X_KI/V_KI); V_KI:realtime=((F_KI-F_KIV)/1E3); F_KIV=((P_KI-P_VE)/R_KIV); P_KI=(1/C_KI*(V_KI-V_KI_0)); F_KI=((P_AR-P_KI)/R_KI); // sub_X_SK:realtime=((conc_X_AR*F_SK-conc_X_SK*F_SKV)/1E3); conc_X_SK=(sub_X_SK/V_SK); V_SK:realtime=((F_SK-F_SKV)/1E3); F_SKV=((P_SK-P_VE)/R_SKV); P_SK=(1/C_SK*(V_SK-V_SK_0)); F_SK=((P_AR-P_SK)/R_SK); // sub_X_OT:realtime=((conc_X_AR*F_OT-conc_X_OT*F_OTV)/1E3); conc_X_OT=(sub_X_OT/V_OT); V_OT:realtime=((F_OT-F_OTV)/1E3); F_OTV=((P_OT-P_VE)/R_OTV); P_OT=(1/C_OT*(V_OT-V_OT_0)); F_OT=((P_AR-P_OT)/R_OT); // sub_X_VE:realtime=((conc_X_SK*F_SKV+conc_X_AD*F_ADV+conc_X_MU*F_MUV+conc_X_LI*F_LIV+conc_X_KI*F_KIV+conc_X_OT*F_OTV-conc_X_VE*F_VEV)/1E3); conc_X_VE=(sub_X_VE/V_VE); F_VE=(F_SKV+F_ADV+F_MUV+F_LIV+F_KIV+F_OTV); V_VE:realtime=((F_VE-F_VEV)/1E3); P_VE=(1/C_VE*(V_VE-V_VE_0)); F_VEV=((P_VE-P_VC)/R_VEV); // sub_X_VC:realtime=((conc_X_VE*F_VEV+conc_X_CR*F_CRV-conc_X_VC*F_VCV)/1E3); conc_X_VC=(sub_X_VC/V_VC); F_VC=(F_CRV+F_VEV); F_VCV=((P_VC-P_RA)/R_VCV); V_VC:realtime=((F_VC-F_VCV)/1E3); P_VC=(1/C_VC*(V_VC-V_VC_0)); // RATiming.beattime=((realtime-floor(realtime/hrf)*hrf)/1E3); // RAElastanceFunction.Ts=(RAElastanceFunction.TsK*sqrt(hrf/(1E3 Hz))); E_RA=(if ((RATiming.beattime>=(0 second)) and (RATiming.beattime<=RAElastanceFunction.Ts)) RAElastanceFunction.Edia+(RAElastanceFunction.Esys-RAElastanceFunction.Edia)*(1-cos(3.141592653589793*RATiming.beattime/RAElastanceFunction.Ts))/2 else if ((RATiming.beattime<(1.5*RAElastanceFunction.Ts)) and (RATiming.beattime>=RAElastanceFunction.Ts)) RAElastanceFunction.Edia+(RAElastanceFunction.Esys-RAElastanceFunction.Edia)*(1+cos(2*3.141592653589793*(RATiming.beattime-RAElastanceFunction.Ts)/RAElastanceFunction.Ts))/2 else RAElastanceFunction.Edia); // sub_X_RA:realtime=((conc_X_VC*F_VCV+conc_X_CO*F_COV-conc_X_RA*F_RV)/1E3); conc_X_RA=(sub_X_RA/V_RA); P_RA=(E_RA*(V_RA-V_RA_0)+P_RA_ext); F_RA=(F_VCV+F_COV); V_RA:realtime=((F_RA-F_RV)/1E3); // RVTiming.beattime=((realtime-floor(realtime/hrf)*hrf)/1E3-PRinterval); // RVElastanceFunction.Ts=(RVElastanceFunction.TsK*sqrt(hrf/(1E3 Hz))); E_RV=(if ((RVTiming.beattime>=(0 second)) and (RVTiming.beattime<=RVElastanceFunction.Ts)) RVElastanceFunction.Edia+(RVElastanceFunction.Esys-RVElastanceFunction.Edia)*(1-cos(3.141592653589793*RVTiming.beattime/RVElastanceFunction.Ts))/2 else if ((RVTiming.beattime<(1.5*RVElastanceFunction.Ts)) and (RVTiming.beattime>=RVElastanceFunction.Ts)) RVElastanceFunction.Edia+(RVElastanceFunction.Esys-RVElastanceFunction.Edia)*(1+cos(2*3.141592653589793*(RVTiming.beattime-RVElastanceFunction.Ts)/RVElastanceFunction.Ts))/2 else RVElastanceFunction.Edia); // sub_X_RV:realtime=((conc_X_RA*F_RV-conc_X_RV*F_PA)/1E3); conc_X_RV=(sub_X_RV/V_RV); P_RV=(E_RV*(V_RV-V_RV_0)+P_RV_ext); F_RV=(if (P_RA>P_RV) (P_RA-P_RV)/R_RV else (0 flow)); V_RV:realtime=((F_RV-F_PA)/1E3); // sub_X_PA:realtime=((conc_X_RV*F_PA-conc_X_PA*F_Pa)/1E3); conc_X_PA=(sub_X_PA/V_PA); F_PA=(if (P_RV>P_PA) (P_RV-P_PA)/R_PA else (0 flow)); V_PA:realtime=((F_PA-F_Pa)/1E3); P_PA=(1/C_PA*(V_PA-V_PA_0)); // sub_X_Pa:realtime=((conc_X_PA*F_Pa-conc_X_Pa*(F_PC+F_SH))/1E3); conc_X_Pa=(sub_X_Pa/V_Pa); V_Pa:realtime=((F_Pa-F_PC-F_SH)/1E3); P_Pa=(1/C_Pa*(V_Pa-V_Pa_0)); F_Pa=((P_PA-P_Pa)/R_Pa); // F_SH=((P_Pa-P_PC)/R_SH); // sub_X_PC:realtime=((conc_X_Pa*F_PC-conc_X_PC*F_PCV)/1E3); conc_X_PC=(sub_X_PC/V_PC); V_PC:realtime=((F_PC-F_PCV)/1E3); P_PC=(1/C_PC*(V_PC-V_PC_0)); F_PC=((P_Pa-P_PC)/R_PC); F_PCV=((P_PC-P_PV)/R_PCV); // sub_X_PV:realtime=((conc_X_PC*F_PCV+conc_X_Pa*F_SH-conc_X_PV*F_LA)/1E3); conc_X_PV=(sub_X_PV/V_PV); F_PV=(F_PCV+F_SH); V_PV:realtime=((F_PV-F_LA)/1E3); P_PV=(1/C_PV*(V_PV-V_PV_0)); }