Examples
The following examples are intended to showcase Myokit's capabilities.
For more examples, download and convert any file from the CellML Model Repository.
Suggestions or comments can be posted on the issues page or emailed 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.
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.
Clancy and Rudy 1999
This is a Markov model of the cardiac fast sodium current INa.
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.
Decker 2009
This is a model of canine ventricular cells based on code published with:
The following version uses the 2009 model to show some of the benchmarking features in myokit.
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
.
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:
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.
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).
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.
The following version uses more modern conventions:
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).
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.
The next example uses automatic differentiation to investigate the model's stability.
The last example uses a simulation that calculates the sensitivity to changes in initial conditions or parameters.
ORd 2011
The 2011 O'Hara-Rudy dynamical model simulates epicardial, endocardial and mid-myocardial ventricular cells based on human data.
The next example shows two different ways to calculate the action potential duration.
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.
Stewart 2009
The 2009 model by Stewart et al. simulates a Purkinje fiber cell.
This example runs without a pacing protocol and shows the purkinje cell's auto-excitation.
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.