Examples

The following example files have been tested with myokit 1.25.2. The selection is intended to showcase the capabilities of the software rather than the merits of any particular model.

For more examples, download and convert any file from the CellML Model Repository.

Email any suggestions or comments to
Michael Clerx (michael@myokit.org).

Beeler and Reuter 1977

This is a classic model of ventricular cells based on the work by Beeler and Reuter.

Reconstruction of the action potential of ventricular myocardial fibres G.W. Beeler, H. Reuter 1977 Journal of Physiology 268(1): 177–210

Download br-1977.mmt

The following example shows how to run voltage-step protocols through the myokit API, without changing the model or protocol code in the mmt file.

Download br-1977-step-protocol.mmt

Clancy and Rudy 1999

This is a Markov model of the cardiac fast sodium current INa.

Linking a genetic defect to its cellular phenotype in a cardiac arrhythmia C.E. Clancy, Y. Rudy 1999 Nature 400.6744 (1999): 566-569

The first example shows Myokit's ability to create a linearized, parametrizable Markov model based on its mmt code. We then show how to perform stochastic and deterministic simulations with the resulting markov model object.

Download clancy-1999-stochastic-simulation.mmt

The next example shows how the deterministic simulations can be combined with Myokit's myokit.lib.fit library to perform parameter estimation.

Download clancy-1999-pso.mmt

Decker 2009

This is a model of canine ventricular cells based on code published with:

Properties and Ionic Mechanisms Action Potential Adaptation, Restitution and Accomodation in Canine Epicardium K.F. Decker, J. Heijman, J.R. Silva, T.J. Hund, Y. Rudy 2009 American Journal of Physiology: Heart and Circulatory Physiology 296: H1017-H1026 http://dx.doi.org/10.1152/ajpheart.01216.2008

Download decker-2009.mmt

The following version uses the 2009 model to show some of the benchmarking features in myokit.

Download decker-2009-simulation-times.mmt

DiFrancesco-Noble 1985

This implementation of the 1985 purkinje cell model uses a range testing simulation to show the results of varying the Sodium conductance of the current i_f.

A model of cardiac electrical activity incorporating ionic pumps and concentration changes D. DiFrancesco, D. Noble 1985 Philosophical Transactions of the Royal Society of London. B, Biological Sciences 307.1133: 353-398 http://dx.doi.org/10.1098/rstb.1985.0001

Download dn-1985-if-gna.mmt (Requires OpenCL)

The next example creates a "cumulative current plot" of the unmodified model, and compares it with a similar plot obtained with a reduced Potassium current:

Download dn-1985-iplot.mmt

Fink & Noble 2009

This example shows how you can create complicated step protocols in Myokit and store them in formats usable with patch clamp software.

Markov models for ion channels: versatility vs. identifiability and speed M. Fink, D. Noble 2009 Philosophical Transactions of the Royal Society A http://dx.doi.org/10.1098/rsta.2008.0301

Download fink-2009-protocol.mmt

Heijman 2011

This model extends the Decker2009 one with different types of phosphorylation and includes a signalling component.

The myokit implementation has been verified against the matlab and C versions available online.

Update 2016-09-12: A small bug in the Myokit implementation of the model was found and corrected (see the file itself for details).

Local control of beta-adrenergic stimulation: Effects on ventricular myocyte electrophysiology and Ca2+-transient J. Heijman, P.G.A. Volders, R.L. Westra, Y. Rudy 2011 Journal of Molecular and Cellular Cardiology. Volume 50, Issue 5, Pages 863-871 http://dx.doi.org/10.1016/j.yjmcc.2011.02.007

Download heijman-2011.mmt

Hodgkin-Huxley 1952d

This is an implementation of the famous 1952 model by Hodgkin and Huxley describing the action potential of a giant axon found in the squid genus Loligo. It follows the version given in the paper closely and defines the action potential as a difference from the resting potential, which means it has both an offset and a flipped y-axis compared to modern conventions.

A quantitative description of membrane current and its application to conduction and excitation in nerve A.L. Hodgkin, A.F. Huxley 1952d Journal of Physiology; 117(4): 500–544

Download hh-1952d.mmt

The following version uses more modern conventions:

Download hh-1952d-modern.mmt

LR1991

The well-known Luo Rudy model describes the mammalian ventricular action potential. The myokit implementation given below is based on an updated version by Leonid Livshitz and Yoram Rudy (2006).

A model of the ventricular cardiac action potential. Depolarization, repolarization, and their interaction C.H. Luo, Y. Rudy 1991 Circulation Research 68(6):1501-26

Download lr-1991.mmt

The next example shows how you can use myokit without running simulations. By using the myokit-expression-to-python-function conversion, the activation and inactivation curves of INa are calculated directly.

Download lr-1991-alphas-betas.mmt

The example below uses the simulation engine's APD measuring capabilities.

Download lr-1991-apds.mmt

The next example uses automatic differentiation to investigate the model's stability.

Download lr-1991-jacobian.mmt

Using similar techniques, the last example uses a simulation type that calculates the sensitivity to changes in the initial conditions.

Download lr-1991-sensitivity.mmt

ORd 2011

The 2011 O'Hara-Rudy dynamical model simulates epicardial, endocardial and mid-myocardial ventricular cells based on human data.

Simulation of the Undiseased Human Cardiac Ventricular Action Potential: Model Formulation and Experimental Validation T. O'Hara, L. Virág, A. Varró, Y. Rudy 2011 PLoS Computational Biology 7(5): e1002061 http://dx.doi.org/10.1371/journal.pcbi.1002061

Download ord-2011.mmt

The next example shows two different ways to calculate the action potential duration.

Download ord-2011-apd.mmt

Sampson 2010

The 2010 model by Sampson et al. represents a canine Purkinje cell. The example below simulates a single, paced cell but the model definition can also be used to simulate fibers.

A computational model of Purkinje fibre single cell electrophysiology: implications for the long QT syndrome K.J. Sampson, V. Iyer, A.R. Marks, R.S. Kass 2010 Journal of Physiology http://dx.doi.org/10.1113/jphysiol.2010.187328

Download sampson-2010.mmt

Stewart 2009

The 2009 model by Stewart et al. simulates a Purkinje fiber cell.

Mathematical models of the electrical action potential of Purkinje fibre cells P. Stewart, O.V. Aslanidi, D. Noble, P.J. Noble, M.R. Boyett, H. Zhang 2009 Philosophical Transactions of the Royal Society, 367, 2225-2255 http://dx.doi.org/10.1103/PhysRevLett.102.258103

This example runs without a pacing protocol and shows the purkinje cell's auto-excitation.

Download stewart-2009.mmt

This file uses the same model code as the previous example, but the driver code adds a stimulus current and connects a number of cells together into a cable.

Download stewart-2009-cable.mmt

The final example uses a parallel version of the driver code to run the example on a GPU or multi-core CPU. In this plot, the x-axis is time (in ms), the y-axis is the cell index and the color represents the membrane potential.

Download stewart-2009-cable-opencl.mmt (Requires OpenCL)

Tran 2009

This simplified model by Tran et al. was used to investigate chaotic behaviour leading to early afterdepolarizations.

Bifurcation and Chaos in a Model of Cardiac Early Afterdepolarizations D.X. Tran, D. Sato, A. Yochelis, J.N. Weiss, A. Garfinkel, Z. Qu 2009 Physical Review Letters 102(25): 258103 http://dx.doi.org/10.1103/PhysRevLett.102.258103

Download tran-2009.mmt

Voltage-clamped cho cell (LR1991)

The mmt file below contains a sodium channel model extracted from the updated LR1991 model and a typical voltage-clamp protocol to measure activation.

Download lr-1991-cho-ina-activation.mmt

The next example performs the same kind of test, but this time a full model is used. All necessary changes to the model are made through API calls and the ActivationExperiment class from myokit.lib is used to run the experiment. A Boltzmann curve is fitted to the measured activation using scipy.

Download lr-1991-activation.mmt