Example cellml/hodgkin_huxley_1952: Hodgkin-Huxley

This example solves the Hodgkin-Huxley ionic current model defined by a CellML version of the model.

NOTE: This example requires a CellML 1.0 enabled version of CMISS to run.

The comfile run by this example is as follows:

# Example showing how to use a cellml model

# Will hopefully soon be able to use the example variable in specifying
# the cellml model's URI in the ipcell file.

# If the example path is not set, default to current directory
if (! defined $example) {
    $example = "./";
# Drop off the trailing / in the example path
$chopped = chop $example;
if ($chopped ne "/") {
    $example .= $chopped;

fem define parameters;r;$example/hh;

# default nodes, elements and grids to get a single grid point
fem define node;d;
fem define bas;d;
fem define elem;d;
fem define grid;d;
fem update grid geometry;
fem update grid metric;

# Define the a user defined CellML electrophysiological model
fem define equation;r;$example/hh;

# Define the CellML model to use and map the parameters to CMISS and
# specify initial/boundary conditions for the cell model.
# Note: the "save temporary files" question is set to yes for testing
#       of the generated code. You might want to turn this off if you
#       are not running this as a test example.
fem define cell;r;$example/hh;

# Initialise the spatial properties of the model (there are none).
fem define material;r;$example/hh cell;
fem define material;r;$example/hh;
fem update grid material;

# Define the zero transmembrane flux boundary condition.
fem define initial;r;$example/hh;

# Define an explicit Adams integrator.
fem define solve;r;$example/hh;

# Initialise the solve.
fem solve to 0;

# Create a history file to store output variables of interest.
fem open history;hh write variables yqs niqslist 1..8 binary;

# Loop through time integrating the cellular model.
$Tend = 200;
$dt = 1.0;
for ($time=0;$time<$Tend;$time+=$dt) {
    fem solve restart to $time;
    fem write history time $time variables yqs binary;

fem close history binary;

# Evaluate signals for the variables from the history file.
fem evaluate electrode;hh history hh from gvariables yqs iy 1,2,3,4,5,6,7,8 electrodes 1 binary;

# Define an export of the CMISS signals to UnEMAP signals..
fem define export;r;$example/hh;

# ..and define names for each of the signals..
fem define leads;r;$example/hh;

# ..and export the signals to a UnEMAP signal file.
fem export signal;hh leads signal hh;

# For testing we compare the generated CMISS signal files
if ($TESTING) {
    fem compare signal;hh basis both masterfile $example/hh comparefile hh binary;

Files used by this example are:

Name                     Modified     Size

hodgkin_huxley_1952.com 23-Mar-2003 2.3k hh.binsig 25-Mar-2003 13k hh.cml 21-Jun-2003 37k hh.ipcell 11-Jun-2003 3.6k hh.ipequa 26-May-2003 1.5k hh.ipexpo 23-Mar-2003 658 hh.ipinit 23-Mar-2003 214 hh.iplead 23-Mar-2003 2.2k hh.ipmatc 23-Mar-2003 356 hh.ipmate 23-Mar-2003 3.2k hh.ippara 23-Mar-2003 5.9k hh.ipsolv 23-Mar-2003 1.3k

Download the entire example:

Name                                        Modified     Size

examples_cellml_hodgkin_huxley_1952.tar.gz 19-Aug-2006 16k

Testing status by version:

StatusTestedReal time (s)
cmSuccessSun Mar 6 00:02:31 20161
cm-debugSuccessSat Mar 5 00:04:42 20161
cmSuccessSun Aug 19 01:44:20 200712
cm-debugSuccessWed Aug 15 01:32:38 200721
cm-debug-clear-mallocSuccessSat Aug 18 01:42:25 200731
cm-debug-clear-malloc7SuccessMon Aug 20 01:39:23 200735
cm64SuccessSun Aug 19 01:44:29 200713
cm64-debugSuccessTue Aug 21 01:31:52 200724
cm64-debug-clear-mallocSuccessThu Apr 1 11:46:07 200412
cmSuccessWed Mar 4 01:08:16 20092
cm-debugSuccessMon Mar 2 01:07:59 20093
cm64SuccessWed Mar 4 01:08:45 20091
cm64-debugSuccessTue Mar 3 01:13:09 20093
cmSuccessSun Mar 6 00:01:06 20160
cm-debugSuccessSat Mar 5 00:01:44 20161

Testing status by file:

Html last generated: Sun Mar 6 05:51:20 2016

Input last modified: Sat Jun 21 15:11:01 2003

CMISS Help / Examples / cellml / hodgkin_huxley_1952