//Created by libAntimony v2.4 model heldt_lpc_2002__lpc(hrf) // Assignment Rules: Elv := (Emaxlv - Eminlv) * ylv + Eminlv; Erv := (Emaxrv - Eminrv) * yrv + Eminrv; Era := (Emaxra - Eminra) * yra + Eminra; Ela := (Emaxla - Eminla) * yla + Eminla; Vlvr := (1 - ylv) * (Vlvrd - Vlvrs) + Vlvrs; Vrvr := (1 - yrv) * (Vrvrd - Vrvrs) + Vrvrs; Vlar := (1 - yla) * (Vlard - Vlars) + Vlars; Vrar := (1 - yra) * (Vrard - Vrars) + Vrars; Fra := piecewise( (Prac - Prvc) / Rra , Prac > Prvc , 0 ); Frv := piecewise( (Prvc - Ppapc) / Rpuv , Prvc > Ppapc , 0 ); Fla := piecewise( (Plac - Plvc) / Rla , Plac > Plvc , 0 ); Flv := piecewise( (Plvc - Paopc) / Rav , Plvc > Paopc , 0 ); Pra := (Vra - Vrar) * Era - (Px2 * 1) / (exp(Vra / Vx8) - 1); Prac := Pra + Ppcdc; Prv := (Vrv - Vrvr) * Erv - (Px2 * 1) / (exp(Vrv / Vx8) - 1); Prvc := Prv + Ppcdc; Pla := (Vla - Vlar) * Ela - (Px2 * 1) / (exp(Vla / Vx8) - 1); Plac := Pla + Ppcdc; Plv := (Vlv - Vlvr) * Elv - (Px2 * 1) / (exp(Vlv / Vx8) - 1); Plvc := Plv + Ppcdc; SV := (COutput / HR) * 60; P_QRSwave := piecewise( 5 , ( t > beattime) && (t < beattime + 0.02 ), 10 , ( t > beattime + PRint) && (t < beattime + PRint + 0.02 ), 0 ); Tsv := TsvK * root((1 * 1) / HR) * 7.745966692414832; Tsa := TsaK * root(1 / HR) * 7.745966692414832; trela := beattime; trelv := beattime - PRint; Rvc := KR * power(Vmax_vc / Vvc, 2) + Ro; Rsa := Rsao + Kr * exp(4 * F_vaso) + Kr * power(Vsa_max / Vsa, 2); Paop := Paopc - Pplc; Paod := Paodc - Pbs; Paodc := (((((Rtaod * Rcrb * Faop - Rtaod * Rcrb * Faod * 0.059999999999999984) + ((Vaod * Rcrb) / Caod) * 0.060000000000000005) - ((Rcrb * Px2) / (exp(Vaod / Vx8) - 1)) * 0.059999999999999984) + Pvcc * Rtaod * 0.059999999999999984) / (Rcrb + Rtaod)) * 16.66666666666667; Psa_a := Kc * log((Vsa - Vsa_o) / Do + 1); Psa_p := Kp1 * exp(tau_p * (Vsa - Vsa_o)) + Kp2 * power(Vsa - Vsa_o, 2); Psa := F_vaso * Psa_a + (1 - F_vaso) * Psa_p; Psap := Vsap / Csap - (Px2 * 1) / (exp(Vsap / Vx8) - 1); Psc := Vsc / Csc_ - (Px2 * 1) / (exp(Vsc / Vx8) - 1); Psv := Kv * log(Vmax_sv / Vsv - 0.99) * -(1); Pvc := piecewise( (D2 + K2 * exp(Vo / Vmin_vc) + (K1 * (Vvc - Vo)) / 1) - Px2 / (exp(Vvc / Vx8) - 1) , Vvc > Vo , (D2 + K2 * exp(Vvc / Vmin_vc)) - Px2 / (exp(Vvc / Vx8) - 1) ); Pvcc := Pvc + Pplc; Fsap := (Psap - Psa) / Rsap; Fsa := (Psa - Psc) / Rsa; Fsc := (Psc - Psv) / Rsc; Fsv := (Psv - Pvcc) / Rsv; Fvc := (Pvcc - Prac) / Rvc; Fcrb := (Paodc - Pvcc) / Rcrb; Vtot := Vra + Vrv + Vpap + Vpad + Vpa + Vpc + Vpv + Vla + Vlv + Vaop + Vaod + Vsa + Vsap + Vsc + Vsv + Vvc + perifl + Vcorcirc; SysArtVol := Vaop + Vaod + Vsa + Vsap; SysVenVol := Vsv + Vvc; PulArtVol := Vpap + Vpad + Vpa; PulVenVol := Vpv; VBcirc := Vtot - perifl; Ppl := Pplc - Pbs; Ppapc := piecewise( Ppapc1 , Prvc > Ppapc1 , Ppapc2 ); Ppapc1 := (((((Rpuv * Vpap) / Ctpap - (Rpuv * Px2 * 1) / (exp(Vpap / Vx8) - 1)) + Prvc * Rtpap) - Rpuv * Rtpap * Fpap * 16.666666666666668) + Pplc * Rpuv) / (Rtpap + Rpuv); Ppapc2 := ((Vpap / Ctpap + Pplc) - Rtpap * Fpap * 16.666666666666668) - (Px2 * 1) / (exp(Vpap / Vx8) - 1); Ppap := Ppapc - Pplc; Ppad := Ppadc - Pplc; Ppadc := (d(Vpad)/ d(unknown- element) * Rtpad + Pplc + Vpad / Ctpad) - (Px2 * 1) / (exp(Vpad / Vx8) - 1); Ppa := Vpa / Cpa - (Px2 * 1) / (exp(Vpa / Vx8) - 1); Ppac := Ppa + Pplc; Ppc := Vpc / Cpc - (Px2 * 1) / (exp(Vpc / Vx8) - 1); Ppcc := Ppc + Pplc; Ppv := Vpv / Cpv - (Px2 * 1) / (exp(Vpv / Vx8) - 1); Ppvc := Ppv + Pplc; Fps := (Ppac - Ppvc) / Rps; Fpa := (Ppac - Ppcc) / Rpa; Fpc := (Ppcc - Ppvc) / Rpc; Fpv := (Ppvc - Plac) / Rpv; Ppcd := K_pcd * exp((Vpcd - Vpcd_o) / phi_pcd) - (Px2 * 1) / (exp(Vpcd / Vx75) - 1); Ppcdc := Ppcd + Pplc; Vpcd := Vrv + Vra + Vlv + Vla + perifl + Vmyo + Vcorcirc; Pcorisfc := abs((Plvc - Ppcdc) / 2); Pcoraoc := Paopc; Pcoreac := Pcorea + Ppcdc; Pcorlac := Pcorla + Pcorisfc; Pcorsac := Pcorsa + Pcorisfc; Pcorcapc := Pcorcap + Pcorisfc; Pcorsvc := Pcorsv + Ppcdc; Pcorlvc := Pcorlv + Ppcdc; Pcorevc := Pcorev + Ppcdc; Pcorao := Paop; Pcorea := Vcorea / Ccorea - (Px1 * 1) / (exp(Vcorea / Vx1) - 1); Pcorla := Vcorla / Ccorla - (Px1 * 1) / (exp(Vcorla / Vx1) - 1); Pcorsa := Vcorsa / Ccorsa - (Px1 * 1) / (exp(Vcorsa / Vx1) - 1); Pcorcap := Vcorcap / Ccorcap - (Px1 * 1) / (exp(Vcorcap / Vx1) - 1); Pcorsv := Vcorsv / Ccorsv - (Px1 * 1) / (exp(Vcorsv / Vx1) - 1); Pcorlv := Vcorlv / Ccorlv - (Px1 * 1) / (exp(Vcorlv / Vx1) - 1); Pcorev := Vcorev / Ccorev - (Px2 * 1) / (exp(Vcorev / Vx8) - 1); Vcorcirc := Vcorao + Vcorea + Vcorla + Vcorsa + Vcorcap + Vcorsv + Vcorlv + Vcorev; Fcorao := (Pcoraoc - Pcoreac) / Rcorao; Fcorea := (Pcoreac - Pcorlac) / Rcorea; Fcorla := (Pcorlac - Pcorsac) / Rcorla; Fcorsa := (Pcorsac - Pcorcapc) / Rcorsa; Fcorcap := (Pcorcapc - Pcorsvc) / Rcorcap; Fcorsv := (Pcorsvc - Pcorlvc) / Rcorsv; Fcorlv := (Pcorlvc - Pcorevc) / Rcorlv; Fcorev := (Pcorevc - Prac) / Rcorev; beattime := t - floor(t / hrf) * hrf; yla := piecewise( (1 - cos((pi * trela) / Tsa)) / 2 , ( geq(trela, 0)) && (trela <= Tsa ), (1 + cos((2 * pi * (trela - Tsa)) / Tsa)) / 2 , ( trela < 1.5 * Tsa) && (geq(trela, Tsa) ), 0 ); yra := yla; ylv := piecewise( (1 - cos((pi * trelv) / Tsv)) / 2 , ( geq(trelv, 0)) && (trelv <= Tsv ), (1 + cos((2 * pi * (trelv - Tsv)) / Tsv)) / 2 , ( trelv < 1.5 * Tsv) && (geq(trelv, Tsv) ), 0 ); yrv := ylv; hrf := 60 / HR; // Rate Rules: Vra' = (Fvc - Fra) + Fcorev; Vrv' = Fra - Frv; Vla' = Fpv - Fla; Vlv' = Fla - Flv; Paopc' = (((Flv - d(Vaop)/ d(unknown- element)) - Faop * 16.66666666666667) - Fcorao) * (1 / Ccorao + ((Px2 / 1) * exp(Vcorao / Vx1)) / power(exp(Vcorao / Vx1) - 1, 2)); MAP' = (Psa - MAP) / COtau; Faop' = (((Paopc - Faop * Raop * 16.66666666666667) - Paodc) / Laop) * 0.059999999999999984; Faod' = ((Paodc - Faod * Raod) - Psap) / Laod; Vaop' = ((Paopc - Vaop / Caop) + (Px2 * 1) / (exp(Vaop / Vx8) - 1)) / Rtaop; Vaod' = ((Faop - Faod * 0.059999999999999984) - Fcrb * 0.059999999999999984) * 16.66666666666667; Vsa' = Fsap - Fsa; Vsap' = Faod - Fsap; Vsc' = Fsa - Fsc; Vsv' = Fsc - Fsv; Vvc' = (Fsv + Fcrb) - Fvc; Vpap' = Frv - Fpap * 16.66666666666667; Vpad' = (Fpap - Fpad * 0.059999999999999984) * 16.66666666666667; Vpa' = (Fpad - Fps) - Fpa; Vpc' = Fpa - Fpc; Vpv' = (Fpc + Fps) - Fpv; Fpap' = (((Ppapc - Ppadc) - Fpap * Rpap * 16.66666666666667) / Lpa) * 0.059999999999999984; Fpad' = ((Ppadc - Ppac) - Fpad * Rpad) / Lpad; Vcorao' = ((Flv - d(Vaop)/ d(unknown- element)) - Faop * 16.66666666666667) - Fcorao; Vcorea' = Fcorao - Fcorea; Vcorla' = Fcorea - Fcorla; Vcorsa' = Fcorla - Fcorsa; Vcorcap' = Fcorsa - Fcorcap; Vcorsv' = Fcorcap - Fcorsv; Vcorlv' = Fcorsv - Fcorlv; Vcorev' = Fcorlv - Fcorev; // Variable initializations: t = ; Vlvrd = 72; Vlvrs = 23; Vrvrd = 103; Vrvrs = 53; Vlard = 10; Vlars = 8; Vrard = 10; Vrars = 8; Rra = 0.001; Rla = 0.001; PRint = 0.12; Emaxlv = 5.6; Eminlv = 0.186874659; Emaxrv = 0.67; Eminrv = 0.1041640922; Emaxra = 0.1091675077; Eminra = 0.0992431888; Emaxla = 0.1446191772; Eminla = 0.1314719793; Pbs = 0; Vmyo = 238; TsvK = 0.35; TsaK = 0.2; HR = 77; Vra = 78.2537; Vrv = 167.4806; Vla = 85.9126; Vlv = 125.360568; COutput = 108.56912706; Rav = 1e-4; Raop = 1e-4; Rcrb = 6.8284472205; Raod = 0.025; Rtaop = 0.2; Rtaod = 0.3; Rsap = 0.025; Rsc = 0.1545054945; Rsv = 0.1381298227; Rsao = 0.5508058134; Caop = 0.3445734208; Caod = 1.4544677036; Csap = 1.4843409851; Csc_ = 7.9822364317; Laop = 3.5e-4; Laod = 3.5e-4; Kc = 497.7852450367; Do = 50; Vsa_o = 485.7624931891; Vsa_max = 577.7106000108; Kp1 = 0.03; Kp2 = 0.05; Kr = 0.01; tau_p = 0.1; Kv = 21.83; Vmax_sv = 3379.545; D2 = -5; K1 = 0.0968305478; K2 = 0.4; KR = 0.001; Ro = 0.025; Vo = 129.6486; Vmax_vc = 350.5314; Vmin_vc = 50.010747; COtau = 15; Pplc = -5.6; Px2 = 2; Vx8 = 8; Vx75 = 75; Vx1 = 1; Px1 = 1; F_vaso = 0.5; Paopc = 87.93968; MAP = 90.6179; Faop = 0.698577; Faod = 23.5957; Vaop = 31.1705; Vaod = 138.4476; Vsa = 519.7915; Vsap = 129.6439; Vsc = 256.8555; Vsv = 2961.6507; Vvc = 232.46638962; Rpuv = 1e-4; Rtpap = 0.05; Rtpad = 0.05; Rpap = 1e-4; Rpad = 0.03; Rps = 4.2958026137; Rpa = 0.0565149137; Rpc = 0.0309026688; Rpv = 1e-4; Ctpap = 1.5365929068; Ctpad = 2.6893667388; Cpa = 3.1321449506; Cpc = 7.7147; Cpv = 27.87028922; Lpa = 1.801907e-4; Lpad = 1.932239e-4; Vpap = 33.1398; Vpad = 60.11203897; Vpa = 58.926; Vpc = 107.57022; Vpv = 293.0398; Fpap = 1.2282; Fpad = 57.1876; K_pcd = 1; phi_pcd = 40; Vpcd_o = 785; perifl = 15; Rcorao = 2.642367; Rcorea = 2.642367; Rcorla = 5.073345; Rcorsa = 5.073345; Rcorcap = 4.227788; Rcorsv = 0.4932479; Rcorlv = 0.4932479; Rcorev = 0.4932479; Ccorao = 0.13; Ccorea = 0.05507; Ccorla = 0.09129; Ccorsa = 0.15602; Ccorcap = 1.8; Ccorsv = 0.58155; Ccorlv = 0.68372; Ccorev = 0.832299; Vcorao = 2.76087; Vcorea = 4.41135; Vcorla = 4.992799; Vcorsa = 4.22047; Vcorcap = 8.55228; Vcorsv = 7.8362; Vcorlv = 8.213955; Vcorev = 8.76758; d = ; unknown = ; element = ; end model *heldt_lpc_2002____main() // Sub-modules, and any changes to those submodules: lpc: heldt_lpc_2002__lpc(hrf); end