Example b132: HMT Cardiac Mechanics - with Cai specified through time

Example b132 - HMT Cardiac Mechanics Model This example solves the HMT model for a single cell. It outputs each of the state variables (Vm, Cai, Cab, lambda, To, T, z) to a UnEMAP signal file. This example also uses a time variable to set two time varying boundary conditions - namely the time course of the extension ratio (lambda) and the value of the intracellular Ca++ concentration.


The comfile run by this example is as follows:

# Example b132 - HMT
#
# Solves the HMT model for a single cell, with a step change in
# length defined by a time varying boundary condtion set by using
# a time variable. The value of [Ca]i is also set via a time variable.

sub hmtCaiTransient {
    # Routine to define a time variable describing the [Ca]i transient
    # from the HMT paper
    $Cai_init = 0.0001;  # mM
    $Cai_max = 0.001; # mM
		$Cai_Tinit = 50.0;# ms
    $Tau = 60;        # ms
    $numPoints=1000;
    $variableName = "cai";

	CORE::open(IPTIME,">tmp-cai-HMT.iptime") || die "Cannot open iptime file: $!\n";
    print IPTIME " CMISS Version 1.21 iptime File Version 3\n";
    print IPTIME " Heading:\n";
    print IPTIME "\n";
    print IPTIME " Enter the name of the time variable [EXIT]: $variableName\n";
    print IPTIME "\n";
    print IPTIME " Do you want this time variable to be periodic [N]? N\n";
    print IPTIME "\n";
    print IPTIME " Enter the number of time points to be set [2]: $numPoints\n";
    print IPTIME " Enter the time variable value before time point 1 [0.0]: $Cai_init\n";
    for ($point=1;$point<=$numPoints;$point++){
        $time=1000/$numPoints*($point-1);
				if ($time < $Cai_Tinit) {
						$Cai = $Cai_init;
				} else {
						$t = $time - $Cai_Tinit;
						$Cai = $Cai_init+($Cai_max-$Cai_init)*($t/$Tau)*exp(1-$t/$Tau);
				}
        print IPTIME " Enter the time for time point $point [0.0]: $time\n";
        print IPTIME " Enter the time variable value at time point $point [0.0]: $Cai\n";
    }
    print IPTIME " Enter the time variable value after time point $numPoints [0.0]: $Cai_init\n";
    print IPTIME "\n";
    print IPTIME " The type of interpolation is [2]:\n";
    print IPTIME "   (1) Constant\n";
    print IPTIME "   (2) Linear Lagrange\n";
    print IPTIME "  *(3) Quadratic Lagrange\n";
    print IPTIME "  *(4) Cubic Lagrange\n";
    print IPTIME "  *(5) Cubic Hermite\n";
    print IPTIME "    2\n";
    print IPTIME " Enter the name of the time variable [EXIT]: EXIT\n";
	CORE::close IPTIME;
    fem define time;r;tmp-cai-HMT;
    unlink "tmp-cai-HMT.iptime";
} # sub hmtCaiTransient

# 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/hmt

fem define node;d
fem define base;d
fem define element;d
fem define grid;d
fem update grid geometry
fem update grid metric

fem define equation;r;$example/hmt

fem define cell;r;$example/hmt
fem define material;r;$example/hmt cell
# Need to define the material conductivities even though they are not 
# really used
fem define material;r;$example/hmt
fem update grid material

# read in the time variable describing the step length change
fem define time;r;$example/step
# and the concentration of intracellular Ca++
&hmtCaiTransient();
# assign the time variable to use for the time varying boundary 
# condition
fem define initial;r;$example/hmt

fem define solve;r;$example/hmt

fem solve to 0

fem open history;hmt write variables yqs niqslist 1,2,3,4,5,6,7 binary

for $time ( 0..999 ) 
{
#  Solve for the current time
fem solve restart to $time

#  Write the membrane potential to the history file
fem write history time $time variables yqs binary
}

# Close the history file
fem close history binary


# Write out signal files for all the state variables.
fem evaluate electrode;hmt_all history hmt from grid yqs iy 1..7 binary
fem define export;r;$example/hmt_all
fem export signal;hmt_all electrode signal hmt_all names cell

Additional testing commands:

fem list signal signal hmt_all binary

fem list time

Files used by this example are:

Name              Modified     Size

example_b132.com 18-Jul-2002 3.5k hmt.ipcell 18-Jul-2002 3.5k hmt.ipequa 26-May-2003 1.2k hmt.ipexpo 12-Jul-2000 657 hmt.ipinit 12-Jul-2000 716 hmt.ipmatc 29-Jan-2003 431 hmt.ipmate 05-Mar-2001 1.8k hmt.ippara 12-Nov-2002 5.9k hmt.ipsolv 18-Jul-2002 900 hmt.ipsolv.old 12-Jul-2000 854 hmt_all.ipexpo 12-Jul-2000 657 step.ipinit 12-Jul-2000 535 step.iptime 18-Jul-2002 1.0k test_output.com 20-Apr-2001 53

Download the entire example:

Name                           Modified     Size

examples_b_b1_b13_b132.tar.gz 19-Aug-2006 66k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmFailureSun Mar 6 00:07:08 20162
last breakSun Mar 16 00:19:00 20088
last successSun Mar 9 00:13:00 20088
cm-debugFailureSun Mar 6 00:15:01 20163
last breakWed Mar 12 00:47:00 200810
last successTue Mar 11 00:42:00 200810
mips-irix
cmSuccessSun Aug 19 02:09:12 200740
cm-debugSuccessWed Aug 15 01:50:44 200759
cm-debug-clear-mallocSuccessSat Aug 18 02:04:37 200763
cm-debug-clear-malloc7SuccessMon Aug 20 01:57:57 200764
cm64SuccessSun Aug 19 02:10:35 200740
cm64-debugSuccessTue Aug 21 01:51:22 200761
cm64-debug-clear-mallocSuccessThu Apr 1 11:09:55 200428
rs6000-aix
cmFailureWed Mar 4 01:12:46 20091
last breakWed Mar 12 01:10:00 20082
last successSun Mar 9 01:19:00 20082
cm-debugFailureWed Mar 4 01:19:20 20098
last breakFri Mar 14 01:08:00 20088
last successMon Mar 10 01:10:00 20088
cm64FailureWed Mar 4 01:10:39 20091
last breakWed Mar 12 01:10:00 20082
last successSun Mar 9 01:20:00 20082
cm64-debugFailureWed Mar 4 01:19:20 20097
last breakThu Mar 13 01:08:00 20088
last successTue Mar 11 01:08:00 20087
x86_64-linux
cmFailureSun Mar 6 00:01:50 20161
last breakSun Mar 16 00:08:00 20083
last successSun Mar 9 00:07:00 20084
cm-debugFailureSun Mar 6 00:01:50 20161
last breakWed Mar 12 00:22:00 20084
last successTue Mar 11 00:23:00 20084

Testing status by file:


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

Input last modified: Mon May 26 18:04:18 2003


CMISS Help / Examples / b / b1 / b13 / b132