Matlab implementation of the computer model of atrial fibrillation originally published by Gordon Moe and colleagues in [American Heart Journal 1964; 67(2):200-220.] To run the simulation, just type the function name (afib). It accepts no input or output arguments. Several model parameters can be changed by editing lines of the function. This is explained in the comments preceding the body of the function.
The function is basically a cellular automata model simulating atrial flutter/fibrillation due to the mechanism of dispersion of refractory periods.
A cluster of (4) cells is rapidly stimulated causing periodic waves
of activation to spread across the model surface. Due to variation in refractory periods across the surface, the wavefronts are broken up as they collide with regions that are still refractory. The rapid stimulation is terminated after 80 steps yet activation wavefronts still travel throughout the model surface. The authors carefully chose the cluster of cells to stimulate by looking for adjacent cells with short refractory periods. I do not do that here; rather I just keep varying the initial state of the random number generator used to asign the K value until I get self-sustaining activity.
In the figure window containing the simulation, three discrete states are plotted: activated or scheduled (blue),
refractory (light blue), and resting/excitable (white). The time step
number of the simulation is displayed below the activation pattern. To modulate the speed of the simulation, change the input argument to the pause statement (time, in seconds, to pause during each step).
Along with plotting the activation across the surface with time, a
second plot is generated showing the "pseudo-electrogram". This reproduces one of the plots from the original paper. (See paper cited above for details.)
Peter Hammer (2023). Model of atrial fibrillation/flutter. (https://www.mathworks.com/matlabcentral/fileexchange/19855-model-of-atrial-fibrillation-flutter), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!