Example b122: Luo-Rudy

Example b122 - Luo-Rudy This example solves the Luo-Rudy 2 ionic current model for a single cell (one grid point). The results are written to a CMISS binary signal file, before being exported to a UnEMAP signal file.


The comfile run by this example is as follows:

# Example b122: Solve the Luo-Rudy 2 model for a single cell, 
# represented by a single grid point

fem define para;r;test;example

#Define geometry of the problem
#  Define underlying geometry
fem define base;d
fem define node;d
fem define elem;d
#  Define grid geometry
fem define grid;d
fem update grid geometry
fem update grid metric

#Define equation to solve
#  Define monodomain with LR2 kinetics
fem define equa;r;test;example

#Define material properties for the problem

#  Define cellular material properties
fem define cell;r;lr;example
#    Define cell variants and spatially varying material parameters
fem define mate;r;test;example cell
#  Define the continuum material parameters
fem define mate;r;test;example
fem update grid material

#Define continuum initial conditions
#  Set no-flux boundary condition
fem define init;r;test;example

#Define the explicit solve, using the adams integrator
fem def solv;r;test;example

#Solve the problem

#  Set the number of threads to use when using a multiprocessing 
#  executable
set num_threads 16

#  Initialise the solve
fem solve to 0

#  Open a binary history file to store the state variables
fem open history;test write variables yqs niqslist 1..14 binary

#  Loop through time

for $HUN ( 0..2 ) 
{
for $TEN ( 0..9 ) 
{
for $UNIT ( 0..9 ) 
{


#  Solve for the current time
fem solve restart to "${HUN}${TEN}$UNIT"


#  Write the membrane potential to the history file
fem write history time "${HUN}${TEN}$UNIT" variables yqs binary
}
}
}



#  Close the history file
fem close history binary

#  Calculate the binary signal file from the history file
fem evaluate electrode;test history test from grid yqs iy 1..14 binary

#  Define UnEmap export properties
fem define export;r;test;example

#  Export the binary signal file to UnEmap
fem export signal;test electrode signal test names cell

if ($TESTING) {
    fem compare signal;test basis both masterfile $example/test comparefile test binary;
}

Files used by this example are:

Name                  Modified     Size

example_b122.com 21-Jan-2003 1.9k example_b122.com.old 13-Apr-2000 1.8k lr.ipcell 25-Aug-2000 4.6k test.binsig 21-Jan-2003 27k test.ipcell 10-Apr-2000 13k test.ipequa 26-May-2003 1.4k test.ipexpo 10-Apr-2000 659 test.ipinit 10-Apr-2000 212 test.ipmatc 29-Jan-2003 695 test.ipmate 10-Apr-2000 3.2k test.ippara 12-Nov-2002 5.9k test.ipsolv 03-Oct-2001 1.3k test.ipsolv.old 10-Apr-2000 1.3k

Download the entire example:

Name                           Modified     Size

examples_b_b1_b12_b122.tar.gz 19-Aug-2006 26k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:03:02 20162
cm-debugSuccessSat Mar 5 00:13:30 20164
mips-irix
cmSuccessSun Aug 19 01:52:32 200722
cm-debugSuccessWed Aug 15 01:49:14 200752
cm-debug-clear-mallocSuccessSat Aug 18 01:59:32 200758
cm-debug-clear-malloc7SuccessMon Aug 20 01:51:46 200756
cm64SuccessSun Aug 19 01:52:32 200721
cm64-debugSuccessTue Aug 21 01:49:23 200756
cm64-debug-clear-mallocSuccessThu Apr 1 11:09:10 200424
rs6000-aix
cmSuccessWed Mar 4 01:08:34 20092
cm-debugSuccessMon Mar 2 01:09:41 200914
cm64SuccessWed Mar 4 01:08:34 20092
cm64-debugSuccessTue Mar 3 01:16:31 200914
x86_64-linux
cmSuccessSun Mar 6 00:01:10 20161
cm-debugSuccessSat Mar 5 00:01:50 20163

Testing status by file:


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

Input last modified: Mon May 26 18:03:30 2003


CMISS Help / Examples / b / b1 / b12 / b122