Ion concentrations

Note

This documentation is work in progress. Currently, the extension of Documenter.jl in my package MoST.jl is still experimental. As the package evolves further, this documentation will increase in readability.

InaMo.Concentrations

The models in this package mainly concern the Ca2+ handling by the sarcoplasmic reticulum and various Ca2+ buffers, but the package InaMo.Concentrations.Interfaces also contains some general models that can be used in ion currents, whose associated ion concentrations are variable.

Interfaces

InaMo.Concentrations.Interfaces.SubstanceSite

connector SubstanceSite "general connector for transferring substances"
  SI.AmountOfSubstance amount(nominal = 1e-21) "amount of substance";
  flow SI.MolarFlowRate rate(nominal = 1e-17) "molar flow rate of substance";
  annotation(
    Icon(graphics = {Ellipse(origin = {0, 0}, extent = {{-100, -100}, {100, 100}}, fillColor = {145, 204, 255}, fillPattern = FillPattern.Solid)}));
end SubstanceSite;

InaMo.Concentrations.Interfaces.SubstanceTransport

This is a base class for models that represent a substance transfer from one compartment to another.

If both src and dst are also connected to an instance of InaMo.Concentrations.Basic.Compartment, models inheriting from this subclass will ensure conservation of mass between these compartments.

partial model SubstanceTransport "base model for transport of an amount of substance between two compartments"
  InaMo.Concentrations.Interfaces.SubstanceSite dst "destination of transport (for positive rate)" annotation(
    Placement(transformation(extent = {{-15, 85}, {15, 115}})));
  InaMo.Concentrations.Interfaces.SubstanceSite src "source of transport (for positive rate)" annotation(
    Placement(transformation(extent = {{-15, -115}, {15, -85}})));
  SI.MolarFlowRate rate "rate of change in substance amount";
  // NOTE: due to a bug in OpenModelica, this currently has to come last
equation
  src.rate + dst.rate = 0 "conservation of mass";
  src.rate = rate;
  annotation(
    Documentation(info = "<html>
    <p>This is a base class for models that represent a substance transfer
    from one compartment to another.</p>
    <p>If both <code>src</code> and <code>dst</code> are also connected to
    an instance of InaMo.Concentrations.Basic.Compartment, models inheriting
    from this subclass will ensure conservation of mass between these
    compartments.</p>
  </html>"),
    Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = false), graphics = {Line(origin = {-100, 2145.04}, points = {{100.05, -2157.01}, {100.05, -2133.08}}, thickness = 0.5), Line(origin = {-100, 2145.04}, points = {{94.67, -2138.60}, {100.05, -2133.08}, {105.71, -2138.60}}, thickness = 0.5)}));
end SubstanceTransport;

InaMo.Concentrations.Interfaces.InactiveChemicalTransport

partial model InactiveChemicalTransport "substance transport along chemical concentration gradient"
  extends InaMo.Concentrations.Interfaces.SubstanceTransport;
  parameter SI.Volume vol_src "volume of source compartment";
  parameter SI.Volume vol_dst "volume of destination compartment";
  parameter SI.Volume vol_trans = min(vol_src, vol_dst) "volume of substance that is transferred between compartments over 1/coeff seconds";
  Real coeff(quantity = "reaction rate coefficient", unit = "1/s") "coefficient of transport";
equation
  rate = coeff * (src.amount / vol_src - dst.amount / vol_dst) * vol_trans;
end InactiveChemicalTransport;

InaMo.Concentrations.Interfaces.ElectricalIonTransport

model ElectricalIonTransport "transport of ions across a boundary due to a current"
  extends InaMo.Concentrations.Interfaces.SubstanceTransport;
  extends InaMo.Concentrations.Basic.ECAdapter(i = i_ion);
  outer SI.Current i_ion "current responsible for moving ions";
end ElectricalIonTransport;

InaMo.Concentrations.Interfaces.EITransportConst

This model allows to define transmembrane currents, which only change the intracellular concentration but keep the extracellular concentration constant.

It should not be used on its own. Instead, InaMo.Concentrations.Interfaces.TransmembraneCaFlow and similar models should be used in order to clearly define the type of ion that is transported.

model EITransportConst "ElectricalIonTransport with constant destination concentration"
  InaMo.Concentrations.Interfaces.ElectricalIonTransport trans;
  InaMo.Concentrations.Basic.ConstantConcentration con;
equation
  connect(con.substance, trans.dst);
  annotation(
    Documentation(info = "<html>
  <p>This model allows to define transmembrane currents, which only change
  the intracellular concentration but keep the extracellular concentration
  constant.</p>
  <p>It should not be used on its own.
  Instead, InaMo.Concentrations.Interfaces.TransmembraneCaFlow and similar
  models should be used in order to clearly define the type of ion that is
  transported.</p>
</html>"));
end EITransportConst;

InaMo.Concentrations.Interfaces.TransmembraneCaFlow

This model can be used via an extends clause in models which define an ion current for a variable intracellular Ca2+ concentration. The inheriting model only needs to define an inner SI.Current i_ion to match the outer definition in InaMo.Concentrations.Interfaces.ElectricalIonTransport.

model TransmembraneCaFlow "mixin for components that transport Ca2+ ions from or to the extracellular compartment"
  extends InaMo.Concentrations.Interfaces.EITransportConst(trans(n = n_ca, z = 2), con.c_const = ca_ex);
  SubstanceSite ca "intracellular Ca2+ concentration" annotation(
    Placement(visible = true, transformation(origin = {35, -100}, extent = {{-17, -17}, {17, 17}})));
  parameter Real n_ca = 1 "stoichiometric ratio of transport";
  outer parameter SI.Concentration ca_ex "extracellular concentration of Ca2+ ions";
equation
  connect(ca, trans.src);
  annotation(
    Documentation(info = "<html>
  <p>This model can be used via an extends clause in models which define an
  ion current for a variable intracellular Ca2+ concentration.
  The inheriting model only needs to define an
  <code>inner SI.Current i_ion</code> to match the <code>outer</code>
  definition in InaMo.Concentrations.Interfaces.ElectricalIonTransport.</p>
</html>"));
end TransmembraneCaFlow;

InaMo.Concentrations.Interfaces.CaConst

Although this model only contains a single inner parameter definition, its name makes its use more intuitive than copying said parameter definition into all models that need it.

partial model CaConst "model used to set all parameters required to keep intracellular Ca2+ constant"
  inner parameter SI.Volume v_sub = 1;
  annotation(
    Documentation(info = "<html>
  <p>Although this model only contains a single inner parameter definition,
  its name makes its use more intuitive than copying said parameter definition
  into all models that need it.</p>
</html>"));
end CaConst;

InaMo.Concentrations.Interfaces.NoACh

partial model NoACh "model used to set all parameters required to deactivate ACh influence"
  inner parameter Boolean use_ach = false;
  inner parameter SI.Concentration ach = 0;
end NoACh;

Basic components

InaMo.Concentrations.Basic.Compartment

This model can be used to combine multiple influences on a single substance concentration/amount in a compartment. Individual effects can be introduced by adding a connection to the connector substance.

model Compartment "compartment that holds an ion concentration"
  extends InaMo.Icons.Compartment;
  InaMo.Concentrations.Interfaces.SubstanceSite substance "substance in the compartment" annotation(
    Placement(transformation(extent = {{-15, -115}, {15, -85}})));
  parameter SI.Volume vol "volume of the compartment";
  parameter SI.Concentration c_start = 1 "initial value of concentration";
  SI.Concentration con = substance.amount / vol "concentration of substance in compartment";
initial equation
  substance.amount = c_start * vol;
equation
  der(substance.amount) = substance.rate;
  annotation(
    Documentation(info = "<html>
    <p>This model can be used to combine multiple influences on a single
    substance concentration/amount in a compartment.
    Individual effects can be introduced by adding a connection to the
    connector <code>substance</code>.</p>
  </html>"),
    Icon(graphics = {Text(origin = {-54, 67}, extent = {{104, -25}, {-2, 3}}, textString = "%name")}));
end Compartment;

InaMo.Concentrations.Basic.ConstantConcentration

This model is similar to InaMo.Concentrations.Basic.Compartment, but ignores all rate changes introduced due to connections to substance in order to hold the concentration constant.

model ConstantConcentration "ion concentration with constant value"
  extends InaMo.Icons.Compartment;
  InaMo.Concentrations.Interfaces.SubstanceSite substance annotation(
    Placement(transformation(extent = {{-15, -115}, {15, -85}})));
  parameter SI.Concentration c_const = 1 "fixed concentration";
  parameter SI.Volume vol = 1 "volume of the compartment";
equation
  substance.amount = c_const * vol;
  annotation(
    Documentation(info = "<html>
    <p>This model is similar to InaMo.Concentrations.Basic.Compartment, but
    ignores all rate changes introduced due to connections to
    <code>substance</code> in order to hold the concentration constant.</p>
  </html>"),
    Icon(graphics = {Text(origin = {-54, 67}, extent = {{104, -25}, {-2, 3}}, textString = "%name"), Text(origin = {-81, 0}, rotation = -90, extent = {{-99, 10}, {99, -12}}, textString = "%c_const mM")}));
end ConstantConcentration;

InaMo.Concentrations.Basic.Diffusion

model Diffusion "simple linear diffusion with time constant"
  extends InaMo.Concentrations.Interfaces.InactiveChemicalTransport;
  extends InaMo.Icons.Diffusion;
  parameter SI.Duration tau "time constant of diffusion";
equation
  coeff = 1 / tau;
end Diffusion;

InaMo.Concentrations.Basic.ReversibleAssociation

model ReversibleAssociation "reversible association reaction with stoichiometry 1:1:1"
  extends InaMo.Icons.ReversibleAssociation;
  InaMo.Concentrations.Interfaces.SubstanceSite free "free macromolecule" annotation(
    Placement(transformation(origin = {-100, 50}, extent = {{-15, -15}, {15, 15}})));
  InaMo.Concentrations.Interfaces.SubstanceSite occupied "occupied macromolecule" annotation(
    Placement(transformation(origin = {100, 0}, extent = {{-15, -15}, {15, 15}})));
  InaMo.Concentrations.Interfaces.SubstanceSite ligand "ligand" annotation(
    Placement(transformation(origin = {-100, -50}, extent = {{-15, -15}, {15, 15}})));
  parameter Real k(unit = "mol-1s-1") "association constant";
  parameter Real kb(unit = "s-1") "dissociation constant";
protected
  SI.MolarFlowRate rate = k * ligand.amount * free.amount - kb * occupied.amount "turnover rate";
equation
  free.rate = rate;
  occupied.rate = -rate;
  ligand.rate = rate;
end ReversibleAssociation;

InaMo.Concentrations.Basic.Buffer

model Buffer "buffer that only binds to a single ligand"
  extends InaMo.Icons.Buffer;
  InaMo.Concentrations.Interfaces.SubstanceSite site "binding site for ligand" annotation(
    Placement(transformation(extent = {{-45, 57}, {-11, 91}})));
  parameter SI.AmountOfSubstance n_tot "total amount of buffer";
  parameter Real f_start(unit = "1") "initial value for f";
  parameter Real k(unit = "mol-1s-1") "association constant";
  parameter Real kb(unit = "s-1") "dissociation constant";
  parameter SI.Volume vol = 1 "volume of compartment in which buffer resides";
  ReversibleAssociation assoc(k = k, kb = kb) annotation(
    Placement(transformation(origin = {35, 0}, extent = {{-20, -20}, {20, 20}})));
  Compartment free(c_start = (1 - f_start) * n_tot / vol, vol = vol) annotation(
    Placement(transformation(origin = {24, 60}, extent = {{-20, -20}, {20, 20}})));
  Compartment occupied(c_start = f_start * n_tot / vol, vol = vol) annotation(
    Placement(transformation(origin = {80, 30}, extent = {{-20, -20}, {20, 20}})));
equation
  connect(assoc.ligand, site) annotation(
    Line(points = {{-28, 74}, {-28, -10}, {18, -10}}));
  connect(assoc.free, free.substance) annotation(
    Line(points = {{18, 10}, {6, 10}, {6, 30}, {24, 30}, {24, 40}}));
  connect(assoc.occupied, occupied.substance) annotation(
    Line(points = {{58, 0}, {80, 0}, {80, 8}}));
  annotation(
    Icon(graphics = {Text(origin = {-110, 0}, extent = {{-100, -10}, {100, 10}}, textString = "%name", rotation = 90)}));
end Buffer;

InaMo.Concentrations.Basic.Buffer2

model Buffer2
  extends InaMo.Icons.Buffer;
  InaMo.Concentrations.Interfaces.SubstanceSite site_a "binding site for ligand A" annotation(
    Placement(transformation(extent = {{-45, 57}, {-11, 91}})));
  InaMo.Concentrations.Interfaces.SubstanceSite site_b "binding site for ligand B" annotation(
    Placement(transformation(extent = {{105, 85}, {135, 115}})));
  parameter SI.AmountOfSubstance n_tot "total amount of buffer";
  parameter Real f_a_start(unit = "1") "initial value for f";
  parameter Real f_b_start(unit = "1") "initial value for f";
  parameter Real k_a(unit = "mol-1s-1") "association constant for binding to ligand A";
  parameter Real k_b(unit = "mol-1s-1") "association constant for binding to ligand B";
  parameter Real kb_a(unit = "s-1") "dissociation constant for binding to ligand A";
  parameter Real kb_b(unit = "s-1") "dissociation constant for binding to ligand B";
  parameter SI.Volume vol = 1 "volume of compartment in which buffer resides";
  ReversibleAssociation assoc_a(k = k_a, kb = kb_a) annotation(
    Placement(transformation(origin = {-46, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
  ReversibleAssociation assoc_b(k = k_b, kb = kb_b) annotation(
    Placement(transformation(origin = {46, 10}, extent = {{-10, 10}, {10, -10}})));
  Compartment free(c_start = (1 - f_a_start - f_b_start) * n_tot / vol, vol = vol) annotation(
    Placement(transformation(origin = {0, 20}, extent = {{-10, -10}, {10, 10}})));
  Compartment occupied_a(c_start = f_a_start * n_tot / vol, vol = vol) annotation(
    Placement(transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}})));
  Compartment occupied_b(c_start = f_b_start * n_tot / vol, vol = vol) annotation(
    Placement(transformation(origin = {90, 10}, extent = {{-10, -10}, {10, 10}})));
equation
  connect(site_a, assoc_a.ligand) annotation(
    Line(points = {{-30, 74}, {-20, 74}, {-20, 14}, {-36, 14}}));
  connect(assoc_a.free, free.substance) annotation(
    Line(points = {{-36, 4}, {2, 4}, {2, 10}}));
  connect(occupied_a.substance, assoc_a.occupied) annotation(
    Line(points = {{-90, 0}, {-90, -8}, {-68, -8}, {-68, 10}, {-56, 10}}));
  connect(site_b, assoc_b.ligand) annotation(
    Line(points = {{105, 100}, {26, 100}, {26, 15}, {36, 15}}));
  connect(free.substance, assoc_b.free) annotation(
    Line(points = {{2, 10}, {2, 4}, {36, 4}}));
  connect(assoc_b.occupied, occupied_b.substance) annotation(
    Line(points = {{56, 10}, {70, 10}, {70, -8}, {90, -8}, {90, 0}}));
  annotation(
    Icon(graphics = {Line(origin = {94, 99}, points = {{-6, -5}, {-2, -3}, {3, -8}, {10, -11}, {16, -7}}, thickness = 0.5), Text(origin = {-110, 0}, extent = {{-100, -10}, {100, 10}}, textString = "%name", rotation = 90)}));
end Buffer2;

InaMo.Concentrations.Basic.ECAdapter

This model can be used as component in models that need to convert between chemical ion flow rates and the current introduced through this flow. If a defining equation for i is provided, rate will contain the corresponding ion flow rate and vice versa.

model ECAdapter "adapter between electrical current and chemical substance flow rate"
  extends InaMo.Icons.Adapter;
  SI.Current i "current due to substance transport";
  SI.MolarFlowRate rate "flow rate of substance transport";
  parameter Real n(unit = "1") "stoichiometric ratio of ion transport";
  parameter Integer z "valence of ion";
equation
  rate = n * i / (z * Modelica.Constants.F);
  annotation(
    Documentation(info = "<html>
  <p>This model can be used as component in models that need to convert
  between chemical ion flow rates and the current introduced through this flow.
  If a defining equation for <code>i</code> is provided, <code>rate</code>
  will contain the corresponding ion flow rate and vice versa.</p>
</html>"));
end ECAdapter;

Ca2+ handling

InaMo.Concentrations.Atrioventricular.RyanodineReceptor

model RyanodineReceptor "ryanodine receptor kinetics for Ca2+ release by the SR"
  extends InaMo.Icons.InsideBottomOutsideTop;
  extends InaMo.Icons.LipidBilayerWithGap;
  extends InaMo.Icons.Activatable;
  extends InaMo.Concentrations.Interfaces.InactiveChemicalTransport;
  extends InaMo.Icons.Current(current_name = "RyR");
  parameter Real p(quantity = "reaction rate coefficient", unit = "1/s") "rate coefficient (inverse of time constant)";
  parameter SI.Concentration ka "concentration producing half occupation";
  parameter Real n(unit = "1") "Hill coefficient";
equation
  coeff = p * hillLangmuir(dst.amount / vol_dst, ka, n);
end RyanodineReceptor;

InaMo.Concentrations.Atrioventricular.SERCAPump

model SERCAPump "SERCA kinetics for Ca2+ uptake by the SR"
  extends InaMo.Icons.InsideTopOutsideBottom;
  extends InaMo.Concentrations.Interfaces.SubstanceTransport;
  extends InaMo.Icons.LipidBilayerWithGap;
  extends InaMo.Icons.SERCA;
  extends InaMo.Icons.Current(current_name = "SERCA");
  parameter SI.Volume vol_src "volume of source compartment";
  parameter SI.MolarFlowRate p "maximum flow rate";
  parameter SI.Concentration k "Michaelis constant";
equation
  rate = p * michaelisMenten(src.amount / vol_src, k);
end SERCAPump;

InaMo.Concentrations.Atrioventricular.CaHandlingK

Kurata et al. model the intracellular calcium concentration based on four compartments:

  • the cytoplasm (cyto)
  • the junctional sarcoplasmic reticulum (JSR)
  • the network sarcoplasmic reticulum (NSR)
  • the "subspace" subspace (sub), i.e. the "functionally restricted intracellular space accessible to the NaCa exchanger as well as to the L-type Ca2+ channel and the Ca2+-gated Ca2+ channel in the SR.

The model includes the transfer between these compartments by diffusion reactions (cytoplasm <-> subspace and JSR <-> NSR), the uptake of Ca2+ in the SR via the SERCA pump, and the release of Ca2+ from the SR via the ryanodine receptors. Additionally, the effect of several Ca2+ buffers is modeled:

  • troponin-Ca
  • troponin-Mg
  • calmodulin (in subspace and cytosol)
  • calsequestrin
model CaHandlingK "handling of Ca concentation by Kurata 2002"
  extends InaMo.Icons.SarcoplasmicReticulum;
  parameter SI.Concentration tc_tot = 0.031 "total concentration of troponin-Ca";
  parameter SI.Concentration tmc_tot = 0.062 "total concentration of troponin-Mg binding to Ca2+";
  parameter SI.Concentration cm_tot = 0.045 "total concentration of calmodulin";
  parameter SI.Concentration cq_tot = 10 "total concentration of calsequestrin";
  outer parameter SI.Volume v_sub "volume of subspace";
  outer parameter SI.Volume v_cyto "volume of cytosol";
  outer parameter SI.Volume v_nsr "volume of network SR";
  outer parameter SI.Volume v_jsr "volume of junctional SR";
  InaMo.Concentrations.Interfaces.SubstanceSite ca_sub "connector exposing Ca2+ in subspace to external influences by membrane currents" annotation(
    Placement(transformation(origin = {-100, 0}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.ConstantConcentration mg(c_const = 2.5, vol = v_cyto) "Mg2+ concentration" annotation(
    Placement(transformation(origin = {80, -26}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Compartment sub(vol = v_sub) "Ca2+ in subspace" annotation(
    Placement(transformation(origin = {-86, 82}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Compartment cyto(vol = v_cyto) "Ca2+ in cytosol" annotation(
    Placement(transformation(origin = {20, -28}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Compartment jsr(vol = v_jsr) "Ca2+ in JSR" annotation(
    Placement(transformation(origin = {-16, 70}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Compartment nsr(vol = v_nsr) "Ca2+ in NSR" annotation(
    Placement(transformation(origin = {62, 54}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Diffusion sub_cyto(vol_src = sub.vol, vol_dst = cyto.vol, tau = 0.04e-3) "diffusion from subspace to cytosol" annotation(
    Placement(transformation(origin = {-58, -38}, extent = {{17, -17}, {-17, 17}}, rotation = -90)));
  // tau = tau_diff,Ca
  InaMo.Concentrations.Atrioventricular.SERCAPump cyto_nsr(vol_src = cyto.vol, p = 0.005e3 * v_nsr, k = 0.0006) "transport from cytosol to NSR via SERCA" annotation(
    Placement(transformation(origin = {48, 12}, extent = {{-17, -17}, {17, 17}})));
  // p = P_up, k = K_up
  InaMo.Concentrations.Basic.Diffusion nsr_jsr(vol_src = nsr.vol, vol_dst = jsr.vol, tau = 60e-3) "diffusion from NSR to JSR" annotation(
    Placement(transformation(origin = {16, 42}, extent = {{-17, -17}, {17, 17}}, rotation = 90)));
  // tau = tau_tr
  InaMo.Concentrations.Atrioventricular.RyanodineReceptor jsr_sub(vol_src = jsr.vol, vol_dst = sub.vol, p = 5e3, ka = 0.0012, n = 2) "transport from JSR to subspace via RyR" annotation(
    Placement(transformation(origin = {-50, 62}, extent = {{-17, -17}, {17, 17}}, rotation = 90)));
  // p = P_rel, k = K_rel
  InaMo.Concentrations.Basic.Buffer tc(n_tot = tc_tot * v_cyto, k = 88.8e3 / v_cyto, kb = 0.446e3) "troponin-Ca" annotation(
    Placement(transformation(origin = {-36, -74}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Buffer2 tm(n_tot = tmc_tot * v_cyto, vol = v_cyto, k_a = 227.7e3 / v_cyto, kb_a = 0.00751e3, k_b = 2.277e3 / v_cyto, kb_b = 0.751e3) "troponin-mg" annotation(
    Placement(transformation(origin = {46, -72}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Buffer cm_cyto(n_tot = cm_tot * v_cyto, k = 227.7e3 / v_cyto, kb = 0.542e3) "calmodulin in cytosol" annotation(
    Placement(transformation(origin = {4, -74}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Buffer cm_sub(n_tot = cm_tot * v_sub, k = cm_cyto.k * v_cyto / v_sub, kb = cm_cyto.kb) "calmodulin in subspace" annotation(
    Placement(transformation(origin = {-74, 28}, extent = {{-17, -17}, {17, 17}})));
  InaMo.Concentrations.Basic.Buffer cq(n_tot = cq_tot * v_jsr, k = 0.534e3 / v_jsr, kb = 0.445e3) "calsequestrin" annotation(
    Placement(transformation(origin = {-18, 18}, extent = {{-17, -17}, {17, 17}})));
equation
  connect(sub.substance, ca_sub) annotation(
    Line(points = {{-86, 66}, {-96, 66}, {-96, 0}, {-100, 0}}));
  connect(ca_sub, sub_cyto.src) annotation(
    Line(points = {{-100, 0}, {-96, 0}, {-96, -38}, {-74, -38}, {-74, -38}}));
  connect(sub_cyto.dst, cyto.substance) annotation(
    Line(points = {{-40, -38}, {0, -38}, {0, -44}, {20, -44}, {20, -44}}));
  connect(cyto.substance, cyto_nsr.src) annotation(
    Line(points = {{20, -44}, {48, -44}, {48, -4}, {48, -4}}));
  connect(cyto_nsr.dst, nsr.substance) annotation(
    Line(points = {{48, 30}, {62, 30}, {62, 38}, {62, 38}}));
  connect(nsr.substance, nsr_jsr.src) annotation(
    Line(points = {{62, 38}, {40, 38}, {40, 42}, {34, 42}, {34, 42}}));
  connect(nsr_jsr.dst, jsr.substance) annotation(
    Line(points = {{0, 42}, {-16, 42}, {-16, 54}, {-16, 54}}));
  connect(jsr.substance, jsr_sub.src) annotation(
    Line(points = {{-16, 54}, {-32, 54}, {-32, 62}, {-32, 62}}));
  connect(jsr_sub.dst, sub.substance) annotation(
    Line(points = {{-66, 62}, {-86, 62}, {-86, 66}, {-86, 66}}));
  connect(tc.site, cyto.substance) annotation(
    Line(points = {{-40, -62}, {-40, -62}, {-40, -48}, {20, -48}, {20, -44}}));
  connect(tm.site_a, cyto.substance) annotation(
    Line(points = {{42, -60}, {42, -48}, {20, -48}, {20, -44}}));
  connect(tm.site_b, mg.substance) annotation(
    Line(points = {{66, -55}, {66, -48}, {80, -48}, {80, -42}}));
  connect(cm_cyto.site, cyto.substance) annotation(
    Line(points = {{0, -62}, {0, -48}, {20, -48}, {20, -44}}));
  connect(sub.substance, cm_sub.site) annotation(
    Line(points = {{-86, 66}, {-86, 66}, {-86, 48}, {-78, 48}, {-78, 40}, {-78, 40}}));
  connect(jsr.substance, cq.site) annotation(
    Line(points = {{-16, 54}, {-16, 54}, {-16, 30}, {-22, 30}, {-22, 30}}));
  annotation(
    Documentation(info = "<html>
    <p>Kurata et al. model the intracellular calcium concentration based on
    four compartments:</p>
    <ul>
      <li>the cytoplasm (cyto)</li>
      <li>the junctional sarcoplasmic reticulum (JSR)</li>
      <li>the network sarcoplasmic reticulum (NSR)</li>
      <li>the &quot;subspace&quot; subspace (sub), i.e. the &quot;functionally
      restricted intracellular space accessible to the NaCa exchanger as well
      as to the L-type Ca2+ channel and the Ca2+-gated Ca2+ channel in the SR.
      </li>
    </ul>
    <p>The model includes the transfer between these compartments by
    diffusion reactions (cytoplasm <-> subspace and JSR <-> NSR), the uptake
    of Ca2+ in the SR via the SERCA pump, and the release of Ca2+ from the
    SR via the ryanodine receptors.
    Additionally, the effect of several Ca2+ buffers is modeled:</p>
    <ul>
      <li>troponin-Ca</li>
      <li>troponin-Mg</li>
      <li>calmodulin (in subspace and cytosol)</li>
      <li>calsequestrin</li>
    </ul>
  </html>"),
    Diagram(graphics = {Polygon(origin = {12, 0}, fillColor = {213, 213, 213}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-68, -100}, {-70, -74}, {-70, -54}, {-70, -16}, {-62, 8}, {-66, 100}, {-44, 100}, {88, 100}, {88, 100}, {88, -100}, {88, -100}, {-51, -100}, {-68, -100}}, smooth = Smooth.Bezier), Polygon(origin = {-90, 142}, points = {{171.31, -71}, {157.99, -71}, {115.86, -71}, {105.58, -71}, {105.58, -49.41}, {40.28, -49.41}, {40.28, -77}, {40.28, -121}, {40.28, -148.59}, {103.58, -148.59}, {103.58, -129}, {115.86, -129}, {157.99, -129}, {171.31, -129}, {171.31, -108}, {171.31, -92}, {171.31, -71}}, smooth = Smooth.Bezier)}));
end CaHandlingK;

InaMo.Concentrations.Atrioventricular.CaHandling

This model is an extension to the Ca2+ handling in Kurata 2002 by Inada et al.. It includes an additional calmodulin concentration in the sarcolemma.

NOTE: Unfortunately, the total value of this concentration (cm_sl_tot) is not given in Inada et al. (where it is called SL_tot). In the C++ implementation by Inada et al., cm_sl_tot has a value of 31/1.2 mM (av_node_2.cpp:508), which seems to be the wrong order of magnitude compared to, the other calmodulin concentrations which use a total concentration of 0.045 mM. This is probably the reason why the C++ code multiplies the whole equation for der(cm_sl.f) with 0.0001, effectively reducing cm_sl.k and cm_sl.kb and thus cancelling out the increase in cm_sl_tot by the same factor. The CellML version attempts to correct the value for cm_sl_tot, but keeps the already corrected values for cm_sl.k and cm_sl.kb, effectively introducing an error. In InaMo, we use a reduced cm_sl_tot, but also increase cm_sl.k and cm_sl.kb accordingly to achieve the same numerical result as the C++ code.

model CaHandling "extension of Ca handling by Inaada 2009"
  extends CaHandlingK;
  parameter SI.Concentration cm_sl_tot = 0.031 / 1.2 "total concentration of calmodulin in sarcolemma";
  InaMo.Concentrations.Basic.Buffer cm_sl(n_tot = cm_sl_tot * v_sub, k = 0.115e3 / v_sub, kb = 1e3) "calmodulin in sarcolemma" annotation(
    Placement(transformation(origin = {-82, -78}, extent = {{-17, -17}, {17, 17}})));
equation
  connect(cm_sl.site, sub.substance) annotation(
    Line(points = {{-86, -66}, {-86, -66}, {-86, -56}, {-96, -56}, {-96, 0}, {-100, 0}}));
  annotation(
    Documentation(info = "<html>
  <p>This model is an extension to the Ca2+ handling in Kurata 2002 by Inada
  et al..
  It includes an additional calmodulin concentration in the sarcolemma.</p>
  <p>NOTE: Unfortunately, the total value of this concentration (cm_sl_tot) is not
  given in Inada et al. (where it is called SL_tot).
  In the C++ implementation by Inada et al., cm_sl_tot has a value of
  31/1.2 mM (av_node_2.cpp:508), which seems to be the wrong order of magnitude
  compared to, the other calmodulin concentrations which use a total
  concentration of 0.045 mM.
  This is probably the reason why the C++ code multiplies the whole equation
  for der(cm_sl.f) with 0.0001, effectively reducing cm_sl.k and cm_sl.kb and
  thus cancelling out the increase in cm_sl_tot by the same factor.
  The CellML version attempts to correct the value for cm_sl_tot, but keeps
  the already corrected values for cm_sl.k and cm_sl.kb, effectively
  introducing an error.
  In InaMo, we use a reduced cm_sl_tot, but also increase cm_sl.k and cm_sl.kb
  accordingly to achieve the same numerical result as the C++ code.</p>
</html>"));
end CaHandling;