Iion = INa + IK1 + Ito + IKr + IKs + ICaL + INaCa + INaK + IpCa + IpK + IbCa + IbNa
where INa is fast Na+ current, ICaL is L-type Ca 2+ current, Ito is transient outward current, IKr is rapid delayed rectifier current, IKs is slow delayed rectifier current, IK1 is inward rectifier K+ current, INaCa is Na+/ Ca 2+ exchanger current, INaK is Na+/ K+ pump current, IpCa and IpK are plateau Ca 2+ and K+ currents, and IbCa and IbK are background Ca 2+ and K+ currents.
Ex = (RT/zF) log(Xo / Xi ) for X = Na+, K+, Ca 2+
EKs = (RT/F) log[(Ko + pKNa Nao ) / (Ki + pKNa Nai )]
Fast Na+ current INa.
The three gates formulation first introduced by Beeler and Reuter is used
INa = GNa m3h j(V - ENa )
where m is an activation gate, h is a fast inactivation gate, and j is a slow inactivation gate. Each of these gates is governed by Hodgkin-Huxley-type equations for gating variables and characterized by a steady-state value (m∞ , j∞ , h∞ ) and a time constant for reaching this steady-state value (τm , τj , τh ), which are functions of membrane potential V.
m∞ (V), h∞ (V) ≡ j∞(V) and 7τm (V), τh (V)/50, τj (V)/400 (ms)
are ploted for -100 ≤ V ≤ 50 (mV) (here 0 ≤ y ≤ 1 ). Note, that τm (-85) = 0.0011 ms is very small, therefore we have to use Rush and Larsen integration scheme for temporal dynamics simulations. τh (20) = 0.18 and τj (20) = 0.54 ms.
L-type Ca 2+ current ICaL 
ICaL = GCaL d f f2 fCaSS 4 ((V - 15)F2/RT) (0.25 CaSS e2(V - 15)F/RT - Cao ) / (e2(V - 15)F/RT - 1),
fCaSS∞ = 0.4 + 0.6/(1 + (CaSS/0.05)2), τCaSS = 2 + 80/(1 + (CaSS/0.05)2),
where d is a voltage-dependent activation gate, f is a slow voltage inactivation gate, f2 is a fast voltage inactivation gate, fCaSS is an intracellular calcium-dependent inactivation gate.
d∞ , f∞, f2 ∞ and τd /2, τf /1500, τf2 /600.
Transient outward current Ito
Ito = Gto r s (V - EK )
where r is a voltage-dependent activation gate and s is a voltagedependent inactivation gate.
r∞ , s∞ (mid) and τr /12, τs /100.
Slow delayed rectifier current IKs 
IKs = GKs xs2 (V - EKs )
where xs is an activation gate and EKs is a reversal potential determined by a large permeability to potassium and a small permeability to sodium ions.
Inward rectifier K+ current IK1
IK1 = GK1 (Ko / 5.4)1/2xK1 ∞ (V - EK )
where xK1 ∞ is a time-independent inward rectification factor that is a function of voltage V - EK .
Rapid delayed rectifier current IKr
IKr = GKr (Ko /5.4)1/2 xr1 xr2 (V - EK )
where xr1 is an activation gate and xr2 is an inactivation gate.
xr1 ∞ , xr2 ∞, xs ∞, xK1 ∞ and τxr1 /1250, τxr2 /3.5, τxs /1200.
Na+/ Ca 2+ exchanger current INaCa
INaCa = kNaCa (e γ VF/RTNai3 Cao - e (1 - γ) VF/RTNao3 Cai α) /
[(KmNai3 + Nao3 ) (KmCa + Cao ) (1 + ksat e (1 - γ) VF/RT)].
Na+/ K+ pump current INaK
INaK = RNaK KoNai / [(Ko + KmK )(Nai + KmNa )(1 + 0.1245 e-11VF/RT + 0.0353 e-VF/RT)].
Intracellular ion dynamics
The changes in the intracellular sodium Nai and potassium
Ki concentrations are governed by the following equations
dNai /dt = -(INa + IbNa + 3INaK + 3INaCa ) / Vc F
dKi /dt = -(IK1 + Ito + IKr + IKs - 2INaK + IpK + Istim - Iax ) /Vc F.
The model contains a description of calcium dynamics in the subspace CaSS , cytoplasm Cai and sarcoplasmic reticulum CaSR
Jleak = Vleak (CaSR - Cai ),
Jup = Vmax up /(1 + Kup2/Cai2)
Jrel = Vrel O (CaSR - CaSS )
Jxfer = Vxfer (CaSS - Cai )
O = k1 CaSS2 R / (k3 + k1 CaSS2),
dR/dt = -k2 CaSS R + k4 (1 - R), k1 = k1'/kcasr , k2 = k2' kcasr ,
Cai buf c = (Cai Bufc) / (Cai + Kbufc)
dCai total / dt = - (IbCa + IpCa - 2 INaCa )/2VcF + (Jleak - Jup ) Vsr /Vc + Jxfer
Casr buf sr = (Casr Bu fsr) / (Casr + Kbufsr)
dCaSRtotal /dt = (Jup - Jleak - Jrel )
CaSSbufSS = (Cass Bufss) / (Cass + Kbufss)
dCaSStotal /dt = - ICaL /2Vss F + Jrel Vsr / Vss - Jxfer Vc / Vss
where Jleak is a leakage current from the sarcoplasmic reticulum to the cytoplasm, Jup is a pump current taking up calcium in the SR, Jrel is the calcium-induced calcium release (CICR) current, Caitotal is the total calcium in the cytoplasm, it consists of Caibufc, the buffered calcium in the cytoplasm, and Cai, the free calcium in the cytoplasm. Similarly, CaSR is the total calcium in the SR, it consists of Casrbufsr, the buffered calcium in the SR, and CaSR, the free calcium in the SR.
The TNNP model scripts are based on Kirsten H.W.J. ten Tusscher's kirstennew2d.f codes (AJP 2006).
 Ten Tusscher K.H.W.J.,
D. Noble, P.J. Noble, and A.V. Panfilov.
A model for human ventricular tissue.
Am J Physiol Heart Circ Physiol 286 H1573 (2004).
 Ten Tusscher K.H., Panfilov A.V. Alternans and spiral breakup in a human ventricular tissue model. Am.J.Physiol., 90 326-345 (2006).