^{1}

^{2}

^{*}

^{1}

^{3}

^{1}

^{2}

^{4}

^{1}

^{2}

^{3}

^{4}

Edited by: Arjen van Ooyen, VU University Amsterdam, Netherlands

Reviewed by: Geir Halnes, Norwegian University of Life Sciences, Norway; Mikael Djurfeldt, Royal Institute of Technology, Sweden

This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

Development of credible clinically-relevant brain simulations has been slowed due to a focus on electrophysiology in computational neuroscience, neglecting the multiscale whole-tissue modeling approach used for simulation in most other organ systems. We have now begun to extend the NEURON simulation platform in this direction by adding extracellular modeling. The extracellular medium of neural tissue is an active medium of neuromodulators, ions, inflammatory cells, oxygen, NO and other gases, with additional physiological, pharmacological and pathological agents. These extracellular agents influence, and are influenced by, cellular electrophysiology, and cellular chemophysiology—the complex internal cellular milieu of second-messenger signaling and cascades. NEURON's extracellular reaction-diffusion is supported by an intuitive Python-based

Computational neuroscience has had an historical focus on electrophysiology, with consequent neglect not only of the accompanying chemophysiology that directly underlies neural function, but also of the brain as a complex organ within which neuronal networks are embedded (De Schutter,

NEURON has always allowed modelers to describe arbitrarily complex phenomena with their own “mod” files, optionally including verbatim C-code, thereby permitting arbitrary programming to be done to augment the package. This left the user with complex code which intermingled model specifics with the numerics, making reuse difficult. One of the guiding principles of simulator development, both for NEURON and for other simulators, has been to promote reproducibility, reusability, and credibility by providing a consistent numerics-independent way to specify models. In the reaction-diffusion domain, the NEURON

In the following sections we give details of the development of the extracellular

As with cells of other solid organs, neurons exist in a highly active medium, influenced by bioactive chemicals whose concentrations change rapidly through: (1) passive diffusion, (2) active deposit and clearance from other cells, and (3) binding or other reactions with extracellular species (Syková and Nicholson,

A major focus for both the original

Providing consistent modeling of both intracellular and extracellular space also ensures conservation of mass. The total amount of a substance of interest will be conserved within the simulation, despite moving in and out of subcellular compartments, or in and out of cells, via currents, active transport, or vesicular release.

We present two related examples to demonstrate the use of the

This example shows potassium diffusion through a box of ECS, with spatial uptake represented phenomenologically as a reaction. We demonstrate each of the stages required to specifying a model. First, to use extracellular

We then specify the specific extracellular region;

To create extracellular potassium, we use the same

Where ^{2}/ms for K^{+} (Samson et al.,

Extracellular reactions are specified using ^{+} but would then release K^{+} when ECS levels dropped.
^{+} (in mM), in this phenological model it represents the density of astrocyte uptake/binding sites. These sites are immobile:

The specification of

The preceding simulation framework can be used to develop a model of spreading depression (SD). SD is a wave of near complete depolarizations of neurons that propagates in gray matter at 2–7 mm/min and lasts for ~1 min. This phenomena is highly reproducible and is associated with several pathological conditions, including; migraines, ischemic stroke, traumatic brain injury and epilepsy (Somjen, ^{+} (Grafstein, ^{+} activates cells whose depolarization opens K^{+} channels which release more K^{+} into extracellular space.

To produce this positive feedback between ECS and cellular physiology, we simulate a realistic density of 90,000 cells/mm^{3} embedded in 1mm^{3} of ECS with diffusion of both K^{+} and Na^{+}. Each neuron has a soma and dendrite with the Hodgkin-Huxley complement of channels (naf, kdr, gleak) as well as kleak and nap (persistent Na^{+} channel) with parameters based on Conte et al. (^{2+}-dependent K^{+} currents. More importantly, we omit neurons Na-K-ATPase, a major mechanism for restoring ion gradients. As noted above, glial Na-K-ATPase is partially modeled by the field of K^{+} sink.

An initial spherical bolus of 40 mM K^{+} of radius 100 μm was placed in the center of the ECS to trigger SD. In the absence of astrocytic uptake, the SD wave front propagated at 1.69 mm/min. High astrocyte capacity of 500 mM (Bazhenov et al., ^{+}, preventing SD. At a far lower astrocyte density of 10 mM, SD did occur (Figure

SD wave Time points at 10, 20, 30 s, with concentrations averaged over the depth of 1 mm^{3} of ECS. ^{+} with glial uptake and Dirichlet boundary conditions.

Spreading depression spread faster with edema. ^{+} exceeds 15 mM. The extent was limited by the loss of K^{+} at the Dirichlet boundary.

The volume-averaged macroscopic description of tissue can be characterized by free volume fraction and tortuosity. Both vary across brain regions (Nicholson and Syková,

The characteristics of the ECS were specified with functions:

We repeated the SD simulation in the ischemic context. Although diffusion was slowed by the increased tortuosity, the effect was less than the speed-up obtained due to reduced volume fraction. With the reduced volume fraction, less K^{+} was required to propagate the wave (Figure

This simple model demonstrates the utility and simplicity of the expanded ^{+} and Na^{+}. Other relevant species could be added to make the simulation more closely comparable to the clinical situation. Adding glutamate would produce further depolarization through synaptic receptors and could contribute to both excitotoxicity (cell damage due to excessive depolarization and calcium) and to the propagation of SD (Kager et al., ^{+} homoeostasis via Cl-K cotransport and also regulates cell osmolarity (Hübel and Ullah,

In order to explicitly simulate uptake by astrocytes ^{+} uptake. Such a model could also include spatial buffering, where K^{+} is transported via astrocytes rather than diffusion in the ECS (Gardner-Medwin,

These simulations focused on the wave of cell depolarization and omitted the silencing of electrical activity that follows—looking at the spreading depolarization rather than at the specifics of the spreading depression itself (Dreier,

We provide a Python interface for specifying the model for ease of use and reproducibility; for performance reasons the numerical details are implemented in C and connected to Python using

The concise, declaratory syntax for model specification has been slightly augmented since introduction of the original

We used the Douglas-Gunn Alternating Direction Implicit method (DG-ADI) for diffusion in the ECS (Douglas and Gunn, _{x}×_{y}×_{z}, then there are _{y}×_{z} independent operations for (Equation A1), _{x}×_{z} for (Equation A2) and _{x}×_{y} for (Equation A3). The finite volume method discretization (Equation A15) can be modified to account for heterogeneous diffusion coefficients and free volume fractions (Equation A16), while ensuring conservation of mass (

Reaction-diffusion performance is further improved by using compiled reactions. Reactions are now parsed into C code which is compiled Just-In-Time (JIT). For example, the reaction given in section 3.1.3 produces the following C code;

The

Extracellular reaction-diffusion benefits from two forms of parallelization; multithreading and multiprocessor (Figure

Reduction in runtime with parallelization. ^{3} (15,625,000) extracellular voxels for example in section 3.1. ^{3} tissue, with 250,000 two compartment neurons and 150^{3} (3,375,000) voxels. Electrophysiology accounts for 62% of the runtime with one process (with 38% due to extracellular

A thread pool is created at the start of the simulation; the calculations required for both diffusion (DG-ADI) and reactions are distributed across the available threads in the pool. The

The multiprocessor approach, implemented with the Message Passing Interface (MPI) is primarily intended for large neuronal network models. The network that is embedded within the ECS may in this case be purely electrophysiological or may also include intracellular

We verified the numerical implementation by (1) comparing a simple model with its analytic solution; and (2) confirming conservation of mass, (3) comparing results with FiPy, a finite volume PDE solver (Guyer et al.,

A simple model with an analytic solution is an initial cube of elevated concentration diffusing in a closed boxed. It is solved by integrating the Green's function over the initial conditions and matching the Neumann boundary conditions with the method of images (Appendix B). A direct comparison to the numerical method is obtained by integrating over the central voxel and dividing by volume to obtain the average concentration at the center (Equation A20). There is close agreement between the numerical solution provided by the

Verification against analytic solution. ^{3} cube diffuses in a 21 μm^{3} cube.

When using Neumann (zero flux) boundary conditions the finite volume method will conserve mass. This provides a basic numerical and algorithmic verification that can be applied even to complex models. The example of section 3.2.1 can be modified so ^{+}. The change in total amount of K^{+} (Figure ^{−12}).

Verification and validation. ^{−12} change with currents from 1, 000 neurons in tissue with heterogeneous diffusion. ^{2} constant K^{+} flux from a traced rat hippocampal CA1 pyramidal neuron and Dirichlet boundary conditions, concentrations at 1 s (averaged over depth).

We modeled a morphologically detailed reconstruction of a rat hippocampal CA1 pyramidal neuron obtained from NeuroMorpho.Org ^{2} of K^{+} (Figure

In

The original

The extension to whole-organ simulation in the brain is particularly important for the development of multiscale modeling for clinical applications (Hunt et al.,

Electrophysiological models in NEURON can specify currents either in absolute terms or as current densities. In the latter case, membrane surface area must be used to calculate the current. The ECS

Currently, we support two boundary conditions: Neumann boundary conditions (constant boundary flux) and Dirichlet conditions (constant boundary concentration). Neumann boundary conditions are appropriate for

There are many forms of extracellular extra-synaptic signaling between cells. Here we have illustrated the utility of the module with a simple model for spreading depression, where the “signal” is a change in ion concentration. The extracellular

The ECS simulation developed here will provide the broadest spatial scale for future multiscale models that will add additional methods at smaller scales. These multiple methods will interconnect so as to be used together in single multiscale simulations that coordinate a broad range of spatial and temporal scales, that could not be assessed using a uniform fine discretization, or uniform algorithms throughout. At the finest scales, stochastic methods will be used to better understand the variability seen at small scale, for example in synaptic clefts. Additional simulation method currently being addressed include techniques for understanding bulk tissue current flow to simulate deep and transcranial current stimulation. Whether induced externally or produced by local field potentials (Lindén et al.,

There are a number of other important organ-level processes that are particularly important for brain pathology. These include blood flow which is of importance for understanding stroke, and mechanical properties of importance for understanding traumatic brain injury. Additional processes that are unique to the brain would include CSF production, flow and reuptake; and status of the blood-brain barrier. More controversial is the role of advection—fluid flow. The brain lacks a lymphatic system for waste clearance, and the small spaces between cells, ~40 nm, are too small to support advection (Jin et al.,

All of these processes are currently the subject of multiscale modeling at varying degrees of sophistication (Anderson and Vadigepalli,

The term

WL, MH, RM, and AN expanded the rxd module. WL, RM, and AN created the examples and wrote the paper.

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

We thank Prof. Charles Nicholson, Prof. Sabina Hrabětová and Dr. Jan Hrabe for their advice on modeling the extracellular space. We thank Prof. David Terman who provided the inspiration and channel kinetics for the spreading depression simulations.

The Supplementary Material for this article can be found online at:

^{+}clearance and cell swelling: key roles for cotransporters and pumps

Solving the diffusion equation in 3D with DG-ADI method, involves splitting the problem into 3 linear equations for each time-step;
_{x}, Δ_{y}, Δ_{z} and Δ_{t} are the spatial and temporal discretization step sizes and ^{(j)} and ^{(j+1)} are the concentrations at the ^{2}) for a different dimension (

The diffusion equation (in one dimension) with an inhomogeneous tortuosity (λ) is;
_{i}(_{i}) for ^{th} voxel are;

A similar approach is used for inhomogeneous volume fractions, but it is important to distinguish between the total concentration (_{T}) and the relative concentration (_{R}). _{T} is the amount divided by the volume of the voxel, _{R} is the amount divided by the free volume of the voxel. These quantities are related by α, the volume fraction _{T} = α_{R}. The concentration used in extracellular

Let both the volume fractions and the concentrations be defined at the center of the voxels α_{i} = α(_{i}). Then the relative concentration at the boundary, by linear interpolation is;

It is straightforward to adapt the above formula for when both tortuosity and volume fraction vary, the flux term (Equation A11) is;

The Green's function for a source at location ^{3} at the origin, the concentrations for an unbounded space are found by integrating the Green's function.
^{3} with zero flux boundary conditions, the solution is obtain by the method of images;
^{−m2} so few are needed.