Cellular cardiac electrophysiology modelling with Chaste and CellML
This section contains pages generated automatically from the source code accompanying “Cellular cardiac electrophysiology modelling with Chaste and CellML”, our paper in Frontiers in Physiology.
Before running these examples you will need to install Chaste’s dependencies and the source code for version 3.3. The easiest way to do this is using an Ubuntu machine (or an Ubuntu virtual machine) as discussed on InstallGuides/UbuntuPackage. Note that cardiac Chaste is not supported on Windows, so users of Windows will need to follow the virtual machine route. For manual installation of each dependency, on any version of Linux, see DeveloperInstallGuide.
The benchmark simulations from the paper are explained and annotated below. For further information on using Chaste to solve these and related problems, see our extensive guide material.
Cellular electrophysiology benchmarks
The steps required to reproduce the study are:
- Generate accurate reference traces and calculate an acceptable level of error for each model (Generating Reference Data)
- Work out the timesteps for each numerical method that are required to meet this error tolerance (Calculate Required Timesteps)
- Benchmark solvers with these timesteps (Ode Solving Times)
You may if you wish run just the final step to benchmark the solvers on your system against our reference data and suggested timesteps.
Tissue electrophysiology benchmarks
The preliminary study examining convergence properties in space and time for the different models was run separately. We then hardcoded suitable space and time steps for the PDE in the following steps, which can be followed to reproduce the study:
- Calculate the required ODE solver timesteps to meet target PDE accuracy (Monodomain Calculate Required Timesteps)
- Benchmark monodomain tissue simulation solving times with different numerical methods (Monodomain Solving Times)
Again, you may if you wish run just the final step to benchmark the solvers on your system against our reference data and suggested timesteps.
Sample commands to install and run everything
If you wish to install the latest versions Chaste and this project direct from our repository, you may do so from the command line as follows:
#!sh
git clone -b release_3.3 https://chaste.cs.ox.ac.uk/git/chaste.git Chaste
cd Chaste/projects
git clone https://github.com/Chaste/project_Frontiers2014.git Frontiers2014To run all the steps listed above, exploiting multiple cores on your machine where appropriate, use:
#!sh
cd path/to/Chaste
## Change the occurrences of 8 below to match the number of cores available
scons chaste_libs=1 brief=1 build=GccOptNative_8 -j8 projects/Frontiers2014/test/TestGeneratingReferenceDataLiteratePaper.hpp
scons chaste_libs=1 brief=1 build=GccOptNative_8 -j8 projects/Frontiers2014/test/TestCalculateRequiredTimestepsLiteratePaper.hpp
scons chaste_libs=1 brief=1 build=GccOptNative_8 -j8 projects/Frontiers2014/test/TestOdeSolvingTimesLiteratePaper.hpp
## Note the change in build= option: these simulations cannot run in parallel
scons chaste_libs=1 brief=1 build=GccOptNative -j8 projects/Frontiers2014/test/TestMonodomainCalculateRequiredTimestepsLiteratePaper.hpp
scons chaste_libs=1 brief=1 build=GccOptNative -j8 projects/Frontiers2014/test/TestMonodomainSolvingTimesLiteratePaper.hpp
## To run the preliminary study on PDE convergence, use
scons chaste_libs=1 brief=1 build=GccOptNative -j8 projects/Frontiers2014/test/TestMonodomainConvergenceLiteratePaper.hpp run_time_flags="--timestep 0.001 --spacestep 0.001 --reset"
## Other values for timestep & spacestep can be given, as desired.
## The --reset flag says to reset CVODE fully at each PDE time step.Section contents
- ↳ Generate accurate reference traces and record a target error metric
- ↳ Calculate the required ODE solver timesteps to meet target accuracy
- ↳ Benchmark ODE solving times with different numerical methods
- ↳ Study the convergence of reference monodomain tissue simulation solutions
- ↳ Calculate the required ODE solver timesteps to meet target PDE accuracy
- ↳ Benchmark monodomain tissue simulation solving times with different numerical methods
