Speed comparisons with MATLAB¶
Solution speed is important for complex computational models and here we compare the performance of OpenCOR with MATLAB1. Nine representative CellML models were chosen from the PMR model repository. For the MATLAB tests we used the MATLAB code, generated automatically from CellML, that is available on the PMR site. These comparisons are based on using the default solvers (listed below) available in the two packages.
Testing environment¶
MacBook Pro (Retina, Mid 2012).
Processor: 2.6 GHz Intel Core i7.
Memory: 16 GB 1600 MHz DDR3.
Operating system: OS X Yosemite 10.10.3.
OpenCOR¶
Version: 0.4.1.
Solver: CVODE with its default settings, except for its Maximum step parameter, which is set to the model’s stimulation duration, if needed.
MATLAB¶
Version: R2013a.
Solver: ode15s (i.e. a solver suitable for stiff problems and which has low to medium order of accuracy) with both its RelTol and AbsTol parameters set to 1e7 and its MaxStep parameter set to the stimulation duration, if needed.
Testing protocol¶
Run a model for a given simulation duration.
Generate simulation data every milliseconds.
Only keep track of all the simulation data (i.e. no graphical output).
Run a model 7 times, discard the 2 slowest runs (to account for unpredictable slowdowns of the testing machine) and average the resulting computational times.
Computational times are obtained directly from OpenCOR and MATLAB (through a couple of calls to cputime in the case of MATLAB).
Results¶
CellML model (from PMR on 18/6/2015) 
Duration (s) 
OpenCOR time (s) 
MATLAB time (s) 
Time ratio (MATLAB/OpenCOR) 

10 
1.16 
140.14 
121 

100 
0.998 
45.720 
46 

50 
0.717 
29.010 
40 

100 
0.996 
48.180 
48 

200 
0.666 
70.070 
105 

1000 
1.42 
310.02 
218 

100 
0.834 
42.010 
50 

100 
0.824 
31.370 
38 

100 
0.969 
59.080 
61 
^{*}The value of membrane.stim_end was increased so as to get action potentials for the duration of the simulation
Conclusions¶
For this range of tests, OpenCOR is between 38 and 218 times faster than MATLAB. A more extensive evaluation of these results is available on GitHub2.
Footnotes
 1
 2
https://github.com/opencor/speedcomparison. These tests were carried out by Alan Garny.