The Brain Dynamics Toolbox

The Brain Dynamics Toolbox is an open-source software tool for simulating systems of Ordinary Differential Equations (ODEs), Delay Differential Equations (DDEs) and Stochastic Differential Equations (SDEs) in Matlab. It combines the power of Matlab's numerical solvers with an intuitive graphical interface for rapid visualisation and parameter exploration. It is intended for researchers, engineers and students who wish to construct and explore mathematical models of brain function.

Heitmann & Breakspear (2017) Handbook for the Brain Dynamics Toolbox: Version 2017c. QIMR Berghofer Medical Research Institute. ISBN 978-1-5497-2070-3

Mathematics informs optogenetic stimulation of brain tissue

Optogenetic techniques allow neurophysiologists to directly stimulate neurons with light. It is often assumed that the dynamical behaviour of the neural tissue is unchanged. However recent observations of optogenetically-induced travelling waves provide a clue that this may not be the case. Lu et al (2015) found that constant stimulation of macaque cortex elicited 40-80 Hz oscillations in the local field potential in a manner consistent with Type II neural excitability. Furthermore, those oscillations propagated far into the surrounding cortical tissue well beyond the reach of the stimulation.

Mathematical theory suggests that only neural tissue with Type I excitability can sustain propagating waves. So how can cortical tissue simultaneously exhibit both Type I and Type II excitability? We investigated the apparent contradiction by modelling the cortex as recurrently-connected excitatory and inhibitory neurons. Such models exhibit either Type I or Type II excitability depending upon the choice of parameters. We found that optogenetic stimulation can locally transform Type I excitability into Type II excitability by preferentially targeting inhibitory cells. The findings shed new light on how optogenetic stimulation can alter the response dynamics of neural tissue.

Space-time plots of the cortical model in one spatial dimension. Optogenetic stimulation was applied focally at position x=0.  Panels A-C show cases of weak, medium, and strong stimulation respectively. 40-80 Hz oscillations arose gradually from the stimulation site via Type II excitability. Waves were emitted from the stimulation site via Type I excitability once the simulation reached a critical threshold. The simulated medium thus exhibited co-existing Type I and Type II excitability in agreement with neurophysiological observations.

Heitmann, Rule, Truccolo, Ermentrout (2017) Optogenetic stimulation shifts the excitability of cerebral cortex from Type I to Type II: Oscillation onset and wave propagation. PLOS Computational Biology. 13(1): e1005349. doi: 10.1371/journals.pcbi.1005349

Lu, Truccolo, Wagnerm Varas-Irwin, Ozden, Zimmermann, May, Agha, Wang, Nurmikko (2015) Optogenetically induced spatiotemporal gamma oscillations and neuronal spiking activity in primate motor cortex. J Neurophysiol 113: 3574-3587.

The cortical origin of visual hallucinations

Geometric patterns of spirals, honeycombs and checker-boards are common themes in visual hallucinations. They are thought to originate from the neural circuitry of the primary visual cortex -- the region of the brain which processes visual shapes.

Geometric visual hallucinations.  A-D: LSD flashbacks painted by Oster (1970).  E-F: Hallucinations by THC intoxication (Siegel & Jarvik, 1975).  G: Hallucinations by occular pressure (Tyler, 1978).  H: Migraine aura (Richards, 1971). Adapted from Billock & Tsou (2012)
Our collaborators at the University of New South Wales devised a clever method for objectively measuring the visual hallucinations seen in stroboscopic flicker. In particular, they measured the spatial wavelength and speed of illusory blobs that appear to race around a ring-shaped stimulus when it is flickered at 10-20 Hz. As part of this study, we constructed a mathematical model of the visual cortex that reproduces much of the perceptual behaviour of the hallucinations.


Journal paper
Pearson J, Chiou R, Rogers S, Wicken M, Heitmann S, Ermentrout GB (2016) Sensory dynamics of visual hallucinations in the normal population. eLife Vol 5. e17072.

Selected Media reports

Pattern Formation in Neural Oscillators

The prevalence of synchronized neural spiking in the brain suggests a role in normal brain function. Neural synchronization can be modelled with coupled oscillators where the phase of each oscillator represents the timing of the neural spike. These models generate planar waves and spirals which resemble those observed in neural tissue. We recently characterized a new synchronization solution that we call ripple. Ripple is topologically distinct from waves and spirals and constitutes another possibility in neural synchronization.

Breakspear M, Heitmann S, Daffertshofer A (2010). Generative models of cortical oscillations: Neurobiological implications of the Kuramoto model. Frontiers in Human Neuroscience 4:190.

Heitmann S, Ermentrout GB (2015) Synchrony, waves and ripple in spatially coupled Kuramoto oscillators with Mexican hat connectivity. Biological Cybernetics 109:3.

Motor Commands as Spatial Oscillation Patterns

Beta-band (15-30 Hz) neural oscillations are routinely observed in the human motor system but their purpose is unknown. We conjectured that the spatial arrangement of beta oscillations in cortex could serves as the neural substrate for encoding motor commands. We constructed a model of the descending motor system which shows how oscillatory patterns in cortex can be translated into specific muscle movements. The model demonstrates a functional role for beta oscillations that also replicates the known physiological changes of beta-band cortico-muscular coherence during movement.


Heitmann S, Boonstra T, Gong P, Breakspear M, Ermentrout GB (2015) The rhythms of steady posture: Motor commands as spatially organized oscillation patterns. Neurocomputing. Special Issue on Advances on Biological Rhythmic Pattern Generation 170.

Heitmann S, Boonstra T, Breakspear M (2013) A dendritic mechanism for decoding traveling waves: Principles and applications to motor cortex. PLOS Computational Biology.

Heitmann S, Gong P, Breakspear M (2012) A computational role for bistability and traveling waves in motor cortex. Frontiers in Computational Neuroscience 6:67.

Co-contraction of Antagonist Muscles

Co-contraction refers to the simultaneous contraction of antagonist muscles. It has no impact on joint torque but it does increase joint damping because of the non-linear force-velocity properties of muscle tissue.

We analysed the stability of co-contracting muscle in a simulated biomechanical limb with realistic force-length-velocity relationships. We found that co-contraction not only modulates joint damping but that it also effects postural stability. Under certain conditions, co-contracting muscles can even induce multiple stable equilibrium points.

Heitmann S, Ferns N, Breakspear M (2012). Muscle co-contraction modulates damping and joint stability in a three-link biomechanical limb. Frontiers in Neurorobotics 5:5.