a locally adaptive time stepping algorithm for the...

25
A Locally Adaptive Time Stepping Algorithm for the Solution to Reaction Diffusion Equations on Branched Structures ,✩✩ Richard A Kublik a,, David L Chopp a a Department of Engineering Sciences and Applied Mathematics, Northwestern University. 2145 Sheridan Road, Evanston IL 60208, USA Abstract In this paper, we present a numerical method for solving reaction-diffusion equations on one dimensional branched structures. Through the use of a simple domain decomposition scheme, the many branches are decoupled so that the equations can be solved as a system of smaller problems that are tri-diagonal. This technique allows for localized adaptive time stepping, in which the time step used in each branch is determined by local activity. Though the method is presented in the specific context of electrical activity in neural systems, it is sufficiently general that it can be applied to other classes of reaction- diffusion problems and higher dimensions. Information in neurons, which can be effectively modeled as one-dimensional branched structures, is carried in the form of electrical impulses called action potentials. The model equations, based on the Hodgkin-Huxley cable equations [1] are a set of reaction equations coupled to a single diffusion process. Localized adaptive time stepping schemes are well suited to neural simulations due to the spatial localization of activity. The algorithm significantly reduces the computational cost compared to existing methods, especially for large scale simulations. Keywords: Reaction-diffusion equation, finite difference methods, computational algorithm, locally adaptive time stepping 1. Background Adaptive time stepping schemes have long been used for solving problems in or- dinary differential equations, and have been effective in concentrating computational power where it is most needed. The widely used package by Gear [2, 3] utilized the fixed- coefficient Backward Differentiation Formula (BDF) method for stiff problems. When using the BDF scheme of order p, Gear’s algorithm allowed for changes in step size following p + 1 steps and used interpolation to obtain the needed history data at the new step size. The errors introduced by repeated interpolations lead to instabilities in This document is a collaborative effort. ✩✩ This work is supported by NIH/NINDS under contract number R01 NS046064. * Corresponding author Preprint submitted to Elsevier August 19, 2011

Upload: others

Post on 25-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

A Locally Adaptive Time Stepping Algorithm for the Solution

to Reaction Diffusion Equations on Branched Structures ✩,✩✩

Richard A Kublika,∗, David L Choppa

aDepartment of Engineering Sciences and Applied Mathematics, Northwestern University. 2145Sheridan Road, Evanston IL 60208, USA

Abstract

In this paper, we present a numerical method for solving reaction-diffusion equations onone dimensional branched structures. Through the use of a simple domain decompositionscheme, the many branches are decoupled so that the equations can be solved as a systemof smaller problems that are tri-diagonal. This technique allows for localized adaptivetime stepping, in which the time step used in each branch is determined by local activity.Though the method is presented in the specific context of electrical activity in neuralsystems, it is sufficiently general that it can be applied to other classes of reaction-diffusion problems and higher dimensions.

Information in neurons, which can be effectively modeled as one-dimensional branchedstructures, is carried in the form of electrical impulses called action potentials. The modelequations, based on the Hodgkin-Huxley cable equations [1] are a set of reaction equationscoupled to a single diffusion process. Localized adaptive time stepping schemes are wellsuited to neural simulations due to the spatial localization of activity. The algorithmsignificantly reduces the computational cost compared to existing methods, especiallyfor large scale simulations.

Keywords: Reaction-diffusion equation, finite difference methods, computationalalgorithm, locally adaptive time stepping

1. Background

Adaptive time stepping schemes have long been used for solving problems in or-dinary differential equations, and have been effective in concentrating computationalpower where it is most needed. The widely used package by Gear [2, 3] utilized the fixed-coefficient Backward Differentiation Formula (BDF) method for stiff problems. Whenusing the BDF scheme of order p, Gear’s algorithm allowed for changes in step sizefollowing p + 1 steps and used interpolation to obtain the needed history data at thenew step size. The errors introduced by repeated interpolations lead to instabilities in

✩This document is a collaborative effort.✩✩This work is supported by NIH/NINDS under contract number R01 NS046064.

∗Corresponding author

Preprint submitted to Elsevier August 19, 2011

Page 2: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

some cases, and prompted development of the CVODE [4–6] package. As in the case ofGear’s method, CVODE employs the BDF methods for stiff problems, and the Adams-Bashforth-Moulton predictor-corrector schemes for non-stiff problems. In the case ofCVODE, however, the fixed-coefficient variants of the methods are replaced by variablecoefficient schemes that allow for arbitrarily spaced solution points.

Many of the methods for solving partial differential equations are based on ODEmethods and applied through the method of lines. Adaptive time stepping methods canbe used for solving PDEs and the simplest application relies on a globally chosen timestep size. The time step is determined by the level of activity in the fastest region inspace, even if it accounts for only a small subset of the domain. For these methods, theglobally selected time step means that activity in a small region of space will cause theentire system to be evolved with a small time step, even though most of the system couldbe accurately resolved with a much larger step.

In some cases, domain decomposition schemes have been effective in the solutionof PDE problems. The spatial domain is divided into smaller subdomains which areupdated independently and coupled through boundary conditions. As the subdomainsare independent, it is also possible for them to be updated in parallel, and many ofthese schemes have been advanced to take advantage of parallel computer architecture.A commonly used domain decomposition method is the the Explicit-Implicit (EIDD)scheme [7–9]. The spatial domain is split into non-overlapping subdomains togetherwith the dividing interface. The interface is updated with an explicit method, followedby an update of the interior of the subdomains using an implicit method and the justcomputed interface values as boundary data. It was found that the stability of the EIDDschemes could be improved by following the implicit update of the subdomains withan implicit correction update of the interface values, leading to the so-called CorrectedExplicit-Implicit (CEIDD) methods [10–12].

Domain decomposition techniques allow the computational cost of solving PDEs tobe split among many processors, however, all subdomains are still updated with the sametime step size. In finite element methods with a variable spatial grid, the global timestep restriction can be prohibitive for large problems. In these cases, multi-time-step orsubcycling methods have been employed to update different spatial subdomains using atime step appropriate to the local CFL condition. Belytschko et al. [13–15] utilized anexplicit time stepping scheme, computing the large step updates first. Boundary data forthe subdomains using a smaller step size is then obtained through interpolation. Dawsonet al. [8] employed an EIDD method where the interface is updated with a step size thatis a multiple of the step sizes used in each of the neighboring subdomains. Boundarydata for the subdomains is then obtained by interpolating the solution in time at theinterface. Smolinski and Wu [16] developed a fully implicit scheme, where boundary datais assumed to be piecewise constant in time.

In this paper we propose an extension of the subcycling idea, allowing adaptive timestepping in each subdomain to be independent of the step sizes elsewhere in the spatialdomain. In this way, computational effort is concentrated where most needed, and isproportional to the level of activity in the system rather than the physical size.

To present our locally adaptive time stepping scheme, we will focus on modeling theelectrical activity in nerve cells. Section 2 describes the computational problem, andpresents the main innovations in solving the Hodgkin-Huxley equations on a branchedneuron, the details of which are presented in section 2.1. In section 3 we present the basic

2

Page 3: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

numerical scheme, which is applied to the specific neuroscience problem in section 4.Following a demonstration of the convergence, stability and accuracy of our methodin section 5, we present examples of simulations involving the localized adaptive timestepping scheme, and compare its performance to two other methods.

2. Numerical Schemes in Computational Neuroscience

Current research in computational neuroscience is particularly suited to localizedadaptive time stepping, and we will present our algorithm in the context of modelingthe propagation of electrical impulses through nerve cells. The electrical signal, calledan action potential, was originally described by Hodgkin and Huxley [1] and is modeledby a reaction diffusion equation of the from

∂V

∂t= ξ

∂2V

∂x2−R(V ), (1)

where V (x, t) is the voltage across the cell membrane, and R(V ) is a nonlinear function.

Figure 1: A typical neuron. Notice the tree like branching structure.

When written out in its entirety, this system is referred to as the Hodgkin-Huxley cableequation. Individual neurons are highly branched structures closely resembling trees,and may have hundreds of branches, called dendrites. Figure 1 shows a representativeexample of a pyramidal cell taken from the subiculum region of rat hippocampus, stainedand reconstructed on a computer. Notice that the cell is made up of long slender branches,with the length much greater than the diameter. In this cell, aside from the large cell

3

Page 4: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

body, branches range in length from 4.5 to 250 µm, with radii between 0.2 and 1.2 µm. Asa result, it is reasonable to model the geometry of the cell as a network of one-dimensionalbranches. At present there are numerous software packages, such as NEURON [17, 18],that take this approach to solve the Hodgkin-Huxley equations on realistic models ofbranched neurons. These simulation packages are based on the work of Cooley andDodge [19], who were the first to utilize a second order method for the solution of theHodgkin-Huxley equations, combining the Crank-Nicolson method [20] for the diffusionterm with an iterative procedure for the non-linear reaction terms.

Hines [21] presented several innovations on the method of Cooley and Dodge thatdramatically improved the efficiency of simulations, especially on branched structures.By staggering the update of the reaction terms with the diffusion term, it is possibleto maintain the full second order accuracy of the Crank-Nicolson method in an efficientway. Additionally, Hines showed that by numbering the branches, and constituent com-partments of the structure in a specific way, the resulting linear system for the voltage inthe entire branched cell can easily be made almost tri-diagonal and solved as efficientlyas in the case of an unbranched cable. However, this method employs a single linearsystem for the entire structure, and is not easily parallelized or applicable to localizedadaptive time stepping.

Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition methodson the branched structure, separating the single large linear system into a set of smallsystems, one for each branch. In the algorithm presented by Mascagni, the domaindecomposition results in a tri-diagonal system for each branch, and a dense system cor-responding to the voltages at the branch points, coupling all the branches together. Incontrast, the CEIDD scheme used by Rempe and Chopp uncouples the cell, so that thesolution in a single branch only depends on the nearest neighbors.

In neural simulations, it is common for large regions of the network to be at or nearequilibrium with only a small region expressing any activity. As a result of this spatiallocalization, Rempe and Chopp developed a method of spatial adaptation. Becausetheir method of domain decomposition uncouples the cell, spatial adaptivity is relativelystraight-forward: branches are updated only if they are active, and are turned off as theyreturn to the equilibrium state. In addition to the spatial adaptivity, the CEIDD scheme,like the method of Mascagni, is easily parallelized, and can handle structures containingclosed loops, which lead to a non-invertible system in previous algorithms.

The electrical signal in a neuron, called an action potential, is characterized by a largefast deviation from the resting voltage followed by a slower return to rest. Depending onthe type of cell and the electrophysiological properties of the membrane, the return torest can be of varying duration. In some cases, when the recovery is very long, the spatialadaptivity of Rempe and Chopp can be improved on. Following an action potential, largeregions of the cell will be evolving very slowly, but will be too far from rest to be ignored,and therefore cannot be turned off. This particular situation motivated us to developa method for localized adaptive time stepping, leading to a further gain in efficiency inneural simulations. However, the method itself is not dependent on the unique behaviorof the action potential, and is applicable to other classes of problems and adaptable tohigher dimensions as well.

4

Page 5: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

2.1. Hodgkin-Huxley Mathematical Model

The Hodgkin-Huxley cable equation is as follows:

Cm∂V

∂t=

a

2Ra

∂2V

∂x2−R(V ) (2a)

where:

R(V ) = gNam3h(V − ENa) + gKn

4(V − EK) + gleak(V − Eleak)−Ie2πa

δ(x− x0) (2b)

dm

dt= αm(V )(1 −m)− βm(V )m

dn

dt= αn(V )(1 − n)− βn(V )n (2c)

dh

dt= αh(V )(1 − h)− βh(V )h

αm(V ) =0.1(25− V )

e(25−V)/10 − 1βm(V ) = 4e−V/18

αn(V ) =0.1(10− V )

e(10−V)/10 − 1βn(V ) = 0.125e−V/80 (2d)

αh(V ) = 0.07e−V/20 βh(V ) =1

e(30−V)/10 + 1

In these equations, Cm is the membrane capacitance, Ra is the resistance, a the radiusand gNa, gK, gleak, ENa, EK, Eleak are constants related to the flow of ions throughchannels in the membrane. The final term in (2b) represents the current (Ie) due to anexternal stimulating electrode at location x0. The variablesm, n, and h are dimensionlessand evolve according to (2c). Finally, (2d) gives the form of α(V ), and β(V ) used in(2c). R(V ) is a current and each of the terms in (2b) model the flow of current throughthe membrane due to the movement of ions through channels. The Hodgkin-Huxleymodel includes currents through channels specific to sodium (Na) and potassium (K), aswell as a non-specific current commonly referred to as a “leak” current. The Hodgkin-Huxley model presented here provides a framework that has been extended to modelmany different channel types, leading to additional equations of the type given in (2c &2d) and extra terms in the reaction R(V ) [24].

3. Numerical Method

Most commonly, numerical solutions to (2a) are found using an implicit method,either Backward Euler or Crank-Nicolson for the linear diffusion term. The nonlinearreaction terms are then updated using an iterative procedure [19, 25] or with the trape-zoidal rule and a staggered time step [21]. These methods are appealing since they aresimple, stable and efficient, while maintaining the full accuracy of the underlying nu-merical method. However, the Backward Euler method is only first order, and is highlydiffusive. The Crank-Nicolson method has dispersive error, leading to oscillations in the

5

Page 6: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

solution when a large time step is used. Under normal circumstances these oscillationsdecay in time, thus the method remains unconditionally stable. However, when com-bined with our domain decomposition scheme and locally adaptive time stepping theseoscillations created instabilities at the branching points. We have therefore chosen tobase our scheme on the second order Backwards Differentiation Formula (BDF) method,utilizing a predictor-corrector approach that is no more expensive than those proposedfor either the Crank-Nicolson or Backward Euler schemes, while maintaining the superiorstability properties of the BDF methods.

3.1. Second Order Backward Differentiation Formula

The backward differentiation formulas are a family of linear multistep methods forsolving ordinary differential equations of the form y′(t) = f(y, t). Due to their stabilityproperties, these methods are well suited to stiff systems, and have been incorporatedinto the CVODE [6] solver package. The nth order BDF scheme is derived from theLagrange interpolating polynomial of order n to y(t). The second order method is givenby:

yq+1 =4

3yq −

1

3yq−1 +

2

3∆tf(yq+1, tq+1). (3)

The adaptive time stepping variant of the BDF methods are again derived from theinterpolating polynomial, using unequally spaced data points. This leads to a schemewhere the coefficients are non-constant and depend on the ratio of step sizes. If we define∆tq+1 = tq+1 − tq and ρ = ∆tq+1/∆tq, then the adaptive second order BDF scheme is:

(2ρ+ 1)yq+1 = (ρ+ 1)2yq − ρ2yq−1 + (ρ+ 1)∆tq+1f(yq+1, tq+1). (4)

From this point on, we will refer to the adaptive scheme, as the corresponding fixedstep scheme can be obtained by setting the ratio of step sizes (ρ) to 1. The BackwardDifferentiation Formulas are a family of methods developed for the solution of ordinarydifferential equations (ODEs), but can be easily applied to partial differential equationsthrough the method of lines. In the next sections, we present our algorithm in the contextof the generic one dimensional reaction-diffusion equation (1).

3.2. Predictor-Corrector Update in a One Dimensional Domain

Typically, when solving nonlinear partial differential equations, an iterative procedure(e.g. Newton Iteration) is employed to handle the nonlinearities. It can be shown thata single predictor-corrector update results in a method with the same order of accuracyas the base method. Iteration to completion is done to retain the stability propertiesof the fully implicit scheme rather than increase the accuracy [26]. In the case of theHodgkin-Huxley equations, the predictor-corrector scheme we use here retains sufficientstability for our purposes, as shown in section 5.2. For a one dimensional problem,the computational domain is divided into a number of subdomains that we refer to assections, as shown in Figure 2, each of which is updated sequentially.

We now describe the algorithm for updating a section of unbranched cable fromtime tq to tq+1. As the BDF methods are multi-step methods, a starting procedure isrequired. We have chosen to compute the first three update steps using the BackwardEuler method, and focus our attention on later updates. Utilizing the adaptive secondorder BDF scheme presented in (4), and having solution history data at times tq, tq−1

6

Page 7: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

Figure 2: One Dimensional Domain. Schematic representation of a one dimensional domain, show-ing the interface between neighboring sections, and the location of computational grid points relative tothe interface.

and tq−2 with ∆tq = tq − tq−1 we define ρ = ∆tq+1/∆tq and η = ∆tq/∆tq−1. The firststep is to predict the voltage at time tq+1 using the second order Lagrange interpolatingpolynomial of the solution, to obtain

V ∗

i =

(

ρ+ 1

η + 1

)

(ρη + η + 1)V qi − ρ(ρη + η + 1)V q−1

i + ρη2(

ρ+ 1

η + 1

)

V q−2i . (5)

The second step is to obtain the value of the reaction term at tq+1, using the predictedvalue V ∗, giving R∗ = R(V ∗, tq+1).

Finally, the voltage is corrected at time tq+1 using R∗. In the interior of a section,the update is given by:

− ξ(ρ+ 1)∆tq+1

∆x2V q+1i−1 +

[

(2ρ+ 1) + 2ξ(ρ+ 1)∆tq+1

∆x2

]

V q+1i − ξ(ρ+ 1)

∆tq+1

∆x2V q+1i+1

= (ρ+ 1)2V qi − ρ2V q−1

i − (ρ+ 1)∆tq+1R∗. (6)

At the ends of sections, boundary data for the update is obtained from the solutionin the neighboring section. In the case of V1 in Figure 2, we have the corrector update:

[

(2ρ+ 1) + 2ξ(ρ+ 1)∆tq+1

∆x2

]

V q+11 − ξ(ρ+ 1)

∆tq+1

∆x2V q+12

= (ρ+ 1)2V q1 − ρ2V q−1

1 + ξ(ρ+ 1)∆tq+1

∆x2V0 − (ρ+ 1)∆tq+1R∗, (7)

where V0 is either the computed value of V q+10 , when the branch containing V0 has

already been updated to time tq+1, or else an approximation obtained through linearextrapolation in time is used.

There are a few details regarding the order in which sections are updated, but thesewill be dealt with in the next section, when we present the localized time stepping scheme.

3.3. Localized Adaptive Time Stepping

One of the main benefits of the domain decomposition scheme employed here is thatthe resultant method is well suited for localized adaptive time stepping. Since eachsection is updated independently of the others, regions experiencing high levels of activitycan be updated using a small ∆t while the remainder of the system takes larger timesteps, thus concentrating computational power where it is most needed, as determined by

7

Page 8: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

local activity. As our primary goal is to reduce the computational cost while retaining areasonable solution for comparison to empirical observations, we have chosen to eliminatethe additional computations required to obtain an estimate of the local error. Insteadwe utilize an inexpensive measure of local activity in each section:

ǫ =∥

∥Vq+1 −Vq∥

2, (8)

where ‖V‖2 is the L2 norm of the vector of values V over the entire length of the section.The activity level is then compared to the specified tolerance, τ , and as in CVODE [4–6],the section chooses the step size for the next step to be

∆t∗ = 0.8(τ

ǫ

)1

3

∆tq+1. (9)

In the case ǫ > τ, the update is discarded, and the section is updated again from tq

using a step of ∆t∗. Following each successful update, in which ǫ < τ, the size of thenext step is also taken to be ∆t∗ and the section is placed in a queue to ensure thatthe next update occurs at the correct time relative to the other sections of the cell. Ouralgorithm then proceeds in a time-marching manner. When the simulation reaches timetq+1j , corresponding to the end of an update interval for section j, the update for section

j from tqj to tq+1j is performed as outlined in section 3.2. We update sections at the end

of the update step rather than the beginning to ensure that the most accurate boundarydata possible is available. In cases where multiple branches have a common scheduledtime of update, they are updated sequentially in order of decreasing levels of activity.That is, sections with larger ∂V

∂t are updated first.

3.4. Summary of Algorithm

We have presented the details for the update of a single section of the computationaldomain. The time evolution of the entire system is obtained by computing individualupdates for each section, ordered in an update queue by time of update and level of localactivity. The algorithm steps through the queue, performing the following steps.

1. Select section from update queue with the earliest next update time.

2. Obtain predictor value V ∗, from the Lagrange interpolating polynomial using(5).

3. Update reactions using the predicted solution V ∗ at time tq+1.

4. Compute the corrector value using the updated reaction term as in (6) forinterior points. Grid points at the ends of the section are updated as in (7) usingan approximation for the boundary data at time tq+1, either a computed solutionat the neighboring grid point, or an approximation obtained through extrapolation.

5. Determine new time step as in (9) using the activity measure ǫ given in (8),and the user specified activity tolerance τ .

6. Schedule next update. If the local activity in the completed step is below thetolerance, determine the section’s place in the update queue and add it. In thecase the activity is too large, immediately recompute the update using the newlydetermined (smaller) time step.

At the successful completion of the update for a single section, the above steps arerepeated until all sections have been updated to the terminal time of the simulation.

8

Page 9: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

3.5. Extension to Higher Dimensions

We have presented our algorithm for localized adaptive time stepping to reaction-diffusion problems in one dimension.. It should be straightforward, however, to adaptour method to other problems in higher dimensions.

Consider the two dimensional reaction-diffusion equation

du

dt= ∇2u+R(u),

where u = u(x, y, t) and ∇2u = ∂2u∂x2 + ∂2u

∂y2 is the Laplacian operator. In this case, thespatial derivative is computed using a 5 point stencil:

∇2u =1

h2(u(xi−1, yi) + u(xi+1, yi) + y(xi, yi−1) + y(xi, yi+1)− 4u(xi, yi)),

where h is the uniform grid spacing in both the x and y directions. If the spatial domainis divided into rectangular subdomains, these cells can be treated similarly to the sectionsof unbranched cable presented here. Each cell is then updated using an independentlyselected time step appropriate for the level of local activity. The cells are updated at theend of their update step, and ordered based on the level of local activity. Boundary datais easily obtained from the computed solution in neighboring cells or from extrapolationof previously computed solutions in cells that have not yet been updated.

4. Application of Generic Algorithm to Neural Simulations

In this section, we apply our time stepping algorithm to the highly branched structuresfound in neuroscience simulations, beginning with a discussion of the spatial discretiza-tion of the branched neural structure.

4.1. Spatial Discretization and Branching

We follow the discretization method used by many of the available neural simulationpackages and approximate the cable equation (2a) as a series of compartments connectedby resistors, as shown in Figure 3 for a section of unbranched cable.

Following this discretization, the Hodgkin-Huxley cable equation (2a) is converted toa system of ordinary differential equations of the form:

CmdVi

dt=

1

A[Gi,i−1(Vi−1 − Vi) +Gi,i+1(Vi+1 − Vi)]− ΓVi + γ, (10a)

where

Gi,k =2

Ra∆xi

πa2

i

+ Ra∆xk

πa2

k

=2πa2i a

2k

Ra(a2i∆xk + a2k∆xi)(10b)

is the conductance along the cable between computational grid points i and k, A =2πai∆xi is the surface area of compartment i, and for notational simplicity we havedefined:

Γ = gNam3h+ gKn

4 + gleak,

γ = gNam3hENa + gKn

4EK + gleakEleak +Ie2πa

δ(x − x0).

9

Page 10: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

(a)

(b)

(c)

Figure 3: Compartmentalization The top figure (a) represents a section of an unbranched dendrite.In our discretization, this is split into a number of compartments, assumed to be of constant radiusas shown in the middle panel (b). The bottom panel (c) shows the equivalent circuit diagram for thesystem. Similar to Figure 3.3 in [17].

At the nodal points where branches connect, an additional condition is imposed toensure conservation of flux:

n∑

b=0

2πa2bRa∆xb

(Vb − VN ) = 0 ⇒ VN =

∑nb=0

a2

b

∆xb

Vb

∑nb=0

a2

b

∆xb

(11)

where VN is the voltage at the node, and the sum is over all branches connected at thenode. An example of a branch point with three connected branches is given in Figure 4.

In this case, the voltage V0 evolves according to the equation:

CmdV0

dt=

1

AG0,−1(V−1 − V0) +

1

AG0(VN − V0)− ΓV0 + γ, (12)

where

G0 =2πa20

Ra∆x0

is the conductance from the center of compartment 0 to the branching nodal point. Notethat the formulation in (12) is valid for an arbitrary number of connected branches,with VN defined as in (11), and that in the case of only 2 branches connected at thenode, G0(VN − V0) = G0,1(V1 − V0). At unconnected ends of branches, VN is equal tothe voltage in the end compartment of the branch, corresponding to a no-flux boundarycondition.

As mentioned previously, most of the available numerical packages for neural simula-tions treat the entire cell network as a single large linear system. As our goal is localized

10

Page 11: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

Figure 4: Three-branch structure An example of a branching pattern in the neural tree structure,showing the computational points and corresponding compartments near the branching nodal point.

time step adaptivity, we reduce the large system into smaller systems corresponding tosections of unbranched cable, coupled through boundary conditions at the branchingnodal points VN as described above. Each section of cable is then updated sequentiallyusing the predictor-corrector approach described in section 4.2.

4.2. Predictor-Corrector Update

We now present the details of the update scheme presented in Section 3.2, for thefull Hodgkin-Huxley cable equation. As in Section 3.2, we define ∆tq = tq − tq−1,ρ = ∆tq+1/∆tq and η = ∆tq/∆tq−1 and assume that the solution is known at theprevious times tq, tq−1, and tq−2. The first step is to predict the voltage at time tq+1

using the second order Lagrange interpolating polynomial of the solution, to obtain

V ∗

i =

(

ρ+ 1

η + 1

)

(ρη + η + 1)V qi − ρ(ρη + η + 1)V q−1

i + ρη2(

ρ+ 1

η + 1

)

V q−2i . (13)

The second step is to solve for the rate constants α(V ∗) and β(V ∗) as given in (2d),and update the gating variables (2c) using the second order BDF method. For example,the update for the variable m is:

(2ρ+1)mq+1 = (ρ+1)2mq−ρ2mq−1+(ρ+1)∆tq+1(

αm(V ∗)(1 −mq+1)− βm(V ∗)mq+1)

.

Solving for mq+1 yields:

mq+1 =(ρ+ 1)2mq − ρ2mq−1 + (ρ+ 1)∆tq+1αm(V ∗)

(2ρ+ 1)− (ρ+ 1)∆tq+1(αm(V ∗) + βm(V ∗)). (14)

The variables h and n are updated in a similar manner, and the resulting values are usedto determine Γq+1 and γq+1.

11

Page 12: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

Finally, the voltage is corrected at time tq+1 using the computed values of the gatingvariables at the new time point. In the interior of a section, the update is given by:

− (ρ+ 1)∆tq+1

Cm

1

AGi,i−1V

q+1i−1

+

[

(2ρ+ 1) + (ρ+ 1)∆tq+1

Cm

(

1

A(Gi,i−1 +Gi,i+1) + Γq+1

)]

V q+1i

− (ρ+ 1)∆tq+1

Cm

1

AGi,i+1V

q+1i+1

= (ρ+ 1)2V qi − ρ2V q−1

i + (ρ+ 1)∆tq+1

Cmγq+1. (15)

At the ends of sections, the boundary data VN is determined using (11) to obtain

VN =

∑nb=0

a2

b

∆xb

Vb

∑nb=0

a2

b

∆xb

, (16)

where Vb is an approximation to the voltage in the neighboring compartments at timetq+1. As the sections are updated sequentially, this approximation will either be thecomputed value for sections that have already been updated or a linear extrapolationfrom the previously computed solutions. If we consider the update for V0 in the threebranch example shown in Figure 4, we obtain:

VN =

a2

0

∆x0

V q+10

∑2b=0

a2

b

∆xb

+

∑2b=1

a2

b

∆xb

Vb

∑2b=0

a2

b

∆xb

, (17)

and the voltage update equation becomes:

− (ρ+ 1)∆tq+1

Cm

1

AG0,−1V

q+1−1

+

(2ρ+ 1) + (ρ+ 1)∆tq+1

Cm

1

A

G0,−1 +G0

1−

a2

0

∆x0

∑2b=0

a2

b

∆xb

+ Γq+1

V q+10

= (ρ+ 1)2V q0 − ρ2V q−1

0 + (ρ+ 1)∆tq+1

Cm

G0

A

∑2b=1

a2

b

∆xb

Vb

∑2b=0

a2

b

∆xb

+ γq+1

. (18)

In the case where V0 is the voltage at the end of an unconnected segment, we obtainVN = V0 and the update:

− (ρ+ 1)∆tq+1

Cm

1

AG0,−1V

q+1−1

+

[

(2ρ+ 1) + (ρ+ 1)∆tq+1

Cm

(

G0,−1

A+ Γq+1

)]

V q+10

= (ρ+ 1)2V q0 − ρ2V q−1

0 + (ρ+ 1)∆tq+1

Cmγq+1. (19)

12

Page 13: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

As in the generic case, sections are updated at the end of their update step, andupdates are scheduled by update time and ordered by activity level, as described inSection 3.3.

4.3. Localized Adaptive Stepping

For neural simulations, localized adaptive time stepping is implemented as describedin Section 3.3, with a few adjustments. To measure the local activity in section j, changesin the gating variables are considered in addition to the voltage, to provide the estimateof activity:

ǫj = max

{∥

∥Vq+1 −Vq∥

2

Vmax − Vmin,∥

∥mq+1 −mq∥

2,∥

∥hq+1 − hq∥

2,∥

∥nq+1 − nq∥

2

}

, (20)

where the voltage has been scaled to be between 0 and 1, to match the range of valuesfound in the gating variables. The step size for the next step is chosen as before to be

∆t∗ = 0.8(τ

ǫ

)1

3

∆tq+1. (21)

In neural simulations, large portions of the cell are at or near rest for long periodsof time. During these rest periods it is possible for the step size chosen by the branchto exceed the duration of the action potentials that propagate through the cell. Dueto the short duration and steep initial rise of the action potential combined with largetime steps in the resting sections it is possible for sections to remain at rest and miss theaction potential that should have propagated through. To compensate for this, we haveimplemented a means for long periods between successive updates to be interrupted andthe sections forced to update with a sufficiently small time step that accurately resolvesthe action potential. This forced updated is based on the spatial adaptivity activationof Rempe and Chopp [23] and occurs when the following conditions are met. Section jis forced to update at time T q+1 if:

1. ∂V∂t > τF in one of the sections, k, connected to section j for some user definedthreshold τF.

2. ∆tq+1j > ∆tF for a user defined ∆tF. We typically choose ∆tF = 0.01ms

3. the next scheduled update for section j, T q+1j > T q+1

k .

In the case that all the above conditions are met, section j is updated from tqj to tq+1j =

T q+1 as in a regular update, with the additional restriction that ∆t∗ ≤ ∆tq+1k . This

limitation on ∆t∗ is maintained for a number of steps to ensure that the action potentialreaches section j before it is free to choose its own ∆t based on local error. We havealso found it beneficial to include an additional restriction on ∆t∗ following a successfulstep. By considering activity levels in the neighboring branches when selecting the nextstep size, the section is less prone to drastic fluctuations in dt. Thus, the local activitycomputed in (20) is modified such that:

ǫj = maxk

{

ǫj ,ǫk∆tqk

}

, (22)

over all connected sections k.13

Page 14: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

5. Analysis of the Method

In this section, we verify the convergence, stability and accuracy of our predictor-corrector and domain decomposition schemes.

5.1. Convergence

1x10-5

1x10-4 0.001 0.01

∆t

1x10-5

1x10-4

1x10-3

0.01

0.1

1

error

(a) Temporal Convergence

1x10-5

1x10-4 0.001 0.01

∆x

1x10-4

1x10-3

0.01

0.1

1

10

100

error

(b) Spatial Convergence

1x10-61x10

-51x10

-40.001 0.01 0.1 1

τ

1x10-8

1x10-7

1x10-6

1x10-5

1x10-4

0.001

0.01

0.1

1

10

100

error

(c) Adaptive Temporal Convergence

Figure 5: Convergence in Time and Space An action potential was propagated down a straightcable consisting of either a single section (open symbol) or five sections (x). In the non adaptive cases((a) & (b)), an O(10−1) reduction in grid size reduces the error by O(10−2) indicating second orderconvergence in both time and space. In the adaptive case (c), the activity tolerance τ was reduced,keeping the spatial grid uniform. As the activity tolerance is reduced, we have a nearly second orderreduction in the error of the adaptive solution (dashed line)

To test the convergence of our method we looked at the propagation of an actionpotential along a single unbranched cable. To test the predictor-corrector scheme intro-duced above, we used a cable consisting of a single section. Another test, in which thecable is made up of five sections allows us to test the effect of our domain decompositionscheme. In all tests, the cable was stimulated at one end to initiate an action potentialthat was then allowed to propagate along the cable. Since the Hodgkin-Huxley cableequation does not have an exact solution, a sequence of simulations with successivelyreduced discretizations (in either time or space) were performed. The solution obtainedwith the most refined grid was then taken to be the exact result and errors in the lessrefined simulations were determined by comparison to the finest grid solution using an

14

Page 15: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

L2 norm. Figure 5(a) shows the temporal convergence of our method for a fixed valueof ∆x = 0.001cm. In both the single and five section tests, we see that a decrease in ∆tby a factor of 2 results in a four-fold reduction in the error, indicating that our methodis indeed second order in time. Similarly, Figure 5(b) confirms that we have retained

second order convergence in space for a fixed value of ∆t = 0.01(

12

)10≈ 9.8 × 10−6ms.

To test the convergence of the adaptive method, rather than decreasing the size of thetemporal grid, we decreased the tolerance for local activity that is used to determinethe appropriate step size. Errors in the solution were computed by comparison to thesolution obtained with the smallest tolerance, using a spline interpolation of the timecourse to obtain solution values at the non-uniform time points. Figure 5(c) shows thatwe have a nearly second order relationship between the activity tolerance, τ , and theerror in the resulting solution, for a fixed spatial grid with ∆x = 1.25× 10−4cm.

5.2. Stability

1x10-4 0.01 1 100

∆t

1x10

-8

1x10-6

1x10-4

0.01

1

err

or

Single Section

large/small ∆t

large/large ∆t

(a)

0 200 400 600 800 1000Position Along Cable (µm)

-84

-82

-80

-78

-76

-74

-72

-70

Vo

lta

ge

(m

V) small ∆t

large ∆t

large/small ∆t

small/small ∆t

(b)

0 200 400 600 800 1000Distance Along Cable (µm)

-66.06

-66.04

-66.02

-66

-65.98

-65.96

Vo

lta

ge

(m

V)

Initial Conditionsmall ∆tlarge/small ∆tsmall/small ∆tAdaptive

(c)

Figure 6: Stability results on an unbranched cable. A cable with only passive (leak) propertieswas simulated for 400 ms during a slow evolution towards rest. The plot in 6(a) shows the error in thevoltage along the cable compared to the evolution of a cable made up of a single section, and evolvedwith ∆t ≈ 1 × 10−4. In the large/small ∆t case, one section was evolved with the ∆t given on thehorizontal axis, while the other section was evolved with the smallest ∆t. In all other cases, the entirecable was evolved with the step size given on the horizontal axis. The plot in 6(b) shows the final voltagesfor the simulations using the largest ∆t, demonstrating that all the solutions are stable, but the caseswith multiple sections are not as accurate for large time steps. 6(c) shows the evolution of noisy initialconditions with the largest ∆t.

15

Page 16: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

The BDF methods are known to have excellent stability properties, however, it isnot obvious that our domain decomposition scheme combined with a single predictor-corrector iteration retains the required level of stability. In our local adaptive timestepping scheme, we require the method to be stable for large step sizes, as step sizes aslarge as 100 ms are possible in simulations run for long times with little activity. Thelocal adaptive time stepping also results in large ratios of step sizes between neighboringsections. Figure 8 shows a typical simulation of an action potential propagating alongan unbranched cable, and the largest ratio in step sizes is 6000, between sections 16 and17.

To verify the stability of our scheme, we performed two tests on a section of un-branched cable containing only passive membrane properties (i.e., only the leak current).The cable was given initial conditions far from the resting voltage and was allowed toevolve toward equilibrium. The leak conductance was chosen so that the return to restwas very slow, and that even after 400 ms of evolution the cable had not reached equi-librium. To determine the stability of our method, this evolution was simulated withincreasingly larger time steps ∆t, up to ∆t =100 ms. We also considered three relatedproblems: we considered the cable as a single section, to verify that a single predictor-corrector iteration provided adequate stability; in the second test, we split the cable intotwo sections that were evolved with the same size ∆t; finally we evolved the two sectionswith different size ∆t. In localized adaptive time stepping, each section evolves with anindependently chosen time step and consequently neighboring sections may have differ-ent step sizes. This last test determines how the ratio of step sizes between neighboringsections effects stability of the overall scheme.

Figure 6(a) shows the relationship between increasing ∆t and error in the final so-lution. The errors in all cases grow in a consistent manner, suggesting that the growthin error is due to accuracy concerns rather than stability. This suspicion is confirmed inFigure 6(b), showing the membrane voltage along the cable at the final time of T=400ms, comparing a solution computed on the cable comprised of a single section with∆t ≈ 1×10−4ms to solutions obtained on a single section with ∆t =100 ms, two sectionsusing ∆t =100 ms, and two sections with one section using the small ∆t ≈ 1× 10−4msand the other section evolving with ∆t =100 ms. In the solutions involving two sec-tions, we see that the solution is still stable, but highly inaccurate, with the greatesterrors occurring at the midpoint of the cable where the two sections are connected, asexpected.

As a second test of stability, the same cable system, including active membraneproperties, was given a noisy initial condition near the resting voltage, as shown inFigure 6(c). We then evolved this system using the same four protocols described abovefor Figure 6(b). Again we see that our method is stable for large time steps and largeratios of time steps in neighboring sections. The largest errors again occur in the twosection cases, due to errors at the interface, and at such large time steps, the solutionin time displays oscillations. However these oscillations decay as the system evolves,indicating that the overall method is stable. Furthermore, the action potential that isof most interest in neural systems has a height of roughly 120 mV, making the errors ofO(10−2) negligible in comparison. Additionally, in practice, our algorithm would onlyemploy such large step sizes in an adaptive case and the user selected tolerance can betuned to make the solution as accurate as desired. Included in Figure 6(c) is a solutionobtained using the localized adaptive stepping scheme and a tolerance τ = 0.01.

16

Page 17: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

5.3. Accuracy

To test the accuracy of our predictor-corrector scheme, we compared it to the mainmethods employed by NEURON: Hines’ variant of the Crank-Nicolson method andCVODE, an adaptive time stepping scheme. In both cases, NEURON utilizes a sin-gle large matrix for the entire tree structure. The branched structure used was thedendritic tree shown in Figure 7(a). This is the distal portion of the dendritic arbor of a

(a)

0 1 2 3 4time (ms)

-80

-60

-40

-20

0

20

40

Voltage (mv)

BDFHinesCVODE

(b)

Figure 7: Accuracy comparison of predictor-corrector method The dendritic tree shown in (a)was stimulated at the base of its trunk with a 1.2 nA stimulus lasting for 0.5 ms. The plot in (b) showstime courses of the voltage recorded at the location marked with the arrow in (a). Our implementationof the second order BDF method with the domain decomposition scheme described in section 4.1 (longdashed) is compared to Hines’ implementation of the Crank-Nicolson method (short dashed) and CVODE(solid trace). There is good agreement between all three methods. Spatial discretization was doneaccording to the dλ rule described by Carnevale and Hines [18]. CVODE was run using relative toleranceof 1× 10−4, and absolute tolerance of 1× 10−2, Hines method and our predictor-corrector scheme used∆t = 0.01 ms.

CA1 pyramidal cell from rat hippocampus. This reconstruction was previously used ina mathematical modeling study that was compared to experimental results [27]. For thecurrent study, Hodgkin-Huxley type channels were distributed throughout the structure,making the entire tree excitable. A stimulating current of 1.2 nA was applied to the baseof the tree for 0.5 ms, leading to the formation of an action potential that then prop-agated through the tree. Figure 7(b) shows the time course for the membrane voltagerecorded mid-tree at the location marked with the arrow in Figure 7(a). Three separatetime courses are plotted in Figure 7(b), one for our predictor-corrector scheme combinedwith the domain decomposition described in section 4.1, along with traces of the solutionobtained using Hines’ implementation of the Crank-Nicolson method and CVODE. Asvisible in the plot, all three methods are in good agreement, indicating that the domaindecomposition has not lead to a loss of accuracy.

6. Results

In this section, we compare our localized adaptive time stepping scheme to othermethods currently used to solve problems in computational neuroscience.

17

Page 18: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

6.1. Localized Adaptive Time Stepping on an Unbranched Cable

Figure 8 demonstrates the localized adaptive time stepping in practice. A straightcable 8000 µm in length was divided into 20 sections and stimulated at the left end.The resulting action potential was allowed to propagate through the cable. The top twopanels show a snapshot in time of the simulation. The top panel shows the membranepotential at each point along the cable at simulation time T = 25.5 ms. The middlepanel shows the corresponding time step size used by each section at that point in time.The bottom panel displays the update history for the entire simulation: the vertical axisis the simulation time and for each section numbered from 1 to 20, there is a horizontalbar at each time the section was updated. Because each section uses an independentlychosen step size, it is possible for the sections at resting voltage or in the recovery phaseto use a significantly larger time step than the sections containing the steep part of theaction potential.

5 10 15 20

Section

0

20

40

60

80

100

Tim

e (

ms

)

(c)

-80

-60-40

-200

20

40

Vo

lta

ge

(m

V)(a)

0 200 400 600 800Distance Along Cable (µm)

1x10-4

1x10-3

0.01

0.1

1

10

∆t

(b)

Figure 8: Localized adaptive time stepping on an unbranched cable. The cable has beendivided into 20 segments, each of which update independently. In (c), each horizontal bar shows thetime at which the corresponding segment was updated during the simulation. The top two panels showa snapshot in time, at T=25.5 ms. The solution in each segment is given in (a), and the step size usedin (b).

18

Page 19: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

0 2000 4000 6000 8000Cable Length (µm)

0

0.1

0.2

0.3

0.4

0.5

0.6

Computational Time (seconds)

BDFHinesSALATS

(a)

0 2000 4000 6000 8000

Cable Length (µm)

0.1

1

10

100

1000

10000

Computational Time (s)

CVODE

(b)

0 100 200 300 400 500Position Along Cable (µm)

-40

-20

0

20

40

Voltage (mV)

HinesBDFSALATSCVODE

(c)

Figure 9: Timing comparison of numerical methods on various length cables. Shown in 9(a)and 9(b) is the computing time in seconds to simulate the propagation of an action potential alongcables of various lengths. Each cable is made up of several sections that are each 100 µm long andconnected as described in section 4.1. Here we compare the simulation times of two classes of schemes.In the case of Hines method, CVODE, and our predictor-corrector scheme (NA), the entire cable isupdated using a globally chosen time step, which is adaptive for CVODE. The second class of methodsexploit the local activity levels in the cell: our localized adaptive time stepping scheme (LATS), and anadaptation for our spatial discretization of the spatial adaptivity of Rempe and Chopp [23] (SA). Inthe non-adaptive methods the computational time grows linearly with the length of the cable simulated,whereas it remains nearly independent of the cable length in the spatially adaptive and localize adaptivetime stepping methods. The adaptive methods concentrate computational resources in the regions ofhighest activity and therefore the computational cost scales with the amount of activity in the systemrather than the physical size. Shown in 9(c) is the spatial solution computed with all methods, showingcomparable accuracy achieved with each method.

19

Page 20: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

6.2. Comparison of Numerical Methods: Action Potential Propagation along Unbranched

Cables

The numerical method we have presented here allows for localized adaptive time step-ping, but at the expense of introducing extra steps into the update algorithm. To de-termine the additional computational cost of our domain decomposition method and therelative savings provided by localized adaptive time stepping we compared our methodto existing schemes for neural simulations. We compared five methods: The methodused by Hines [21], CVODE [6], our predictor-corrector scheme without adaptivity, thelocalized adaptive time stepping scheme presented here, and a variant of the spatialadaptivity of Rempe and Chopp [23] modified to work with our spatial discretization.For each method, we simulated the propagation of an action potential along a series ofunbranched cables with increasing lengths. Each cable consisted of individual sections100µm in length connected as described in section 4.1. Figure 9 shows the computa-tional time for each method plotted against the total length of the cable. In each case,our predictor-corrector method without adaptivity is more costly than the correspondingsimulation done with Hines method. This is expected due to the additional calculationsthat are required at the points where sections connect. Both of these methods scalelinearly with the cable length. CVODE is known to be much slower than Hines’ method,and the simulation time grows at a much greater rate, as shown in Figure 9(b). Incontrast, the computational time for the adaptive methods is not significantly affectedby the problem size, since both focus computational resources on the few sections thatcontain the action potential. CVODE is very expensive, especially for large problemsbecause of the nonlinear, iterative solve that must be done at each update as well as theneed to decrease time step sizes as the problem size increases to maintain constant globalerror. This small time step is then used in every region of the cell, as CVODE is a globaltime stepping scheme. Figure 9(c) shows the final spatial solution of our test problemcomputed with each of the methods tested, verifying that all methods provide solutionswith comparable accuracy.

The cable simulated in this test is artificial, in that realistic neurons do not havesuch long individual processes. However, the total number of sections and grid points iscomparable to that in typical cells. From Figure 9(a), we see that the benefits of adap-tivity (spatial and localized adaptive stepping) appear as the physical size of the problemgrows. For simulations of a single cell, there is no reason to include the added compu-tational overhead of our method, as Hines’ method provides a more efficient solution.There is however a threshold problem size, after which the efficiency gains of adaptivityoutweigh any extra overhead. As seen in Figure 9(a), the computational cost of theadaptive methods remains constant as the size of the problem grows, while the cost ofHines’ method and CVODE continues to grow. Additionally, even though our localizedadaptive time stepping method does not provide the exact control of errors that CVODEdoes, a careful choice of the tolerance τ will produce a solution of comparable accuracyto one obtained by CVODE at a fraction of the cost. Indeed, true error control could beeasily added to the algorithm but as our main goal was increased speed of simulation wehave chosen to avoid the extra computations required.

6.3. Improvement over Spatial Adaptivity

Looking at the results in Figure 9, one may question the benefit of using localizedadaptive time stepping compared to the simpler spatial adaptivity. For the test shown

20

Page 21: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

in Figure 9, the action potential was only allowed to propagate a short distance alongthe cable. The individual sections of the cable were either at the resting potential, orexperiencing the peak of the action potential. This means that in the locally adaptivetime stepping method, sections used either a small ∆t comparable to that used by thenon-adaptive methods, or took very large steps. This is essentially the same as the resultsof the spatially adaptive method, where the first few sections, containing the actionpotential, were updated while the remaining were kept at rest and were not evolved intime. The benefits of localized adaptive time stepping are most pronounced during therecovery phase, when the voltage changes slowly but is far enough from rest that thespatially adaptive scheme must still update the section. At these times, the local timestep adaptivity allows the sections in recovery to evolve with much larger step sizes,allowing for more efficient solution of the problem as will be demonstrated in Section 6.4.

0 5 10 15 20 25Time (ms)

-80

-60

-40

-20

0

20

40

(mV)

-80

-60

-40

-20

0

20

40

(mV)

(c)

-80

-60

-40

-20

0

20

40

(mV)

(b)

-80

-60

-40

-20

0

20

40

(mV)

(a)

(d)

Figure 10: Result of two stimuli on a unbranched cable. A stimulus of 0.19 nA at time T=0initiates an action potential, and a second stimulus at T=15 of 0.18 nA, initiates an action potentialwhen the membrane voltage is above rest. Shown are the numerical results for the non-adaptive BDFscheme (a), the spatially adaptive method with “off” tolerance 0.005 (b) and 0.003 (c), and the locallyadaptive time stepping scheme (d). With the more aggressive tolerance, the spatially adaptive methodfails to capture the second action potential.

21

Page 22: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

An additional benefit of localized adaptive time stepping, is that it is more robustthan the spatial adaptivity of Rempe and Chopp. In neural systems, the kinetics ofindividual types of ion channels can occur on a variety of time scales, and may varybetween problems. As a result, the tolerances associated with the spatial adaptivityneed to be tuned for each problem, as described by Rempe et al. [28]. We now describean instance where the choice of tolerance qualitatively changes the results obtained. Acell consisting of sections forming an unbranched cable, 500 µm in length was stimulatedfor 1 ms with a 0.19 nA current, triggering an action potential. A second stimulus of0.18 nA was applied at time 15 ms. Under normal conditions a stimulus of 0.18nAis insufficient to trigger an action potential. However, due to the initial stimulus, thestimulated section of the cell has a slightly elevated voltage, and the second, smallerstimulus produces a second action potential. Figure 10(a) shows the two action potentialsin a time course recorded from the far end of the cable. The spatial adaptivity algorithmrelies on 3 tolerances. Sections of the cell that are at, or near, the resting voltage arenot updated until activity in a neighboring section increases above the “on” tolerance atwhich point the section is “activated”. Active sections become inactivated when activityin the section falls below the “off” tolerance, provided the membrane voltage is withinthe voltage tolerance, Vtol, of the resting voltage. When a section is inactivated, allstate variables (V, m, h, n in the Hodgkin-Huxley equations (2)) are returned to theirresting values. Figures 10(a) and (b) show the resulting solutions of our test problemutilizing “off” tolerances of 0.005 and 0.003 respectively. When choosing the tolerances,one must balance the desired speed of computation with accuracy, as described by Rempeet al. [28]. Typically, the more aggressive tolerances will result in a faster simulation, but,as shown in Figure 10, may result in an incorrect solution. Figure 10(d) shows the samesimulation computed with the locally adaptive time stepping scheme, using an activitytolerance τ = 0.0075, capturing both action potentials. This use of an error-like activitytolerance provides more robust behavior than the spatially adaptive method, withoutrequiring specialized tuning for each problem.

6.4. Comparison of Numerical Methods: Chains of Cells Connected by Synapses

A branch of current research in neuroscience involves simulation of large scale net-works of cells, evidenced by the development of the Blue Brain Project [29], and exten-sions to the NEURON simulation environment to facilitate large networks of morpholog-ically realistic cells [30]. In the final test of our algorithm, we considered chains of mor-phologically realistic cells connected by synapses, representative of large-scale problems.To make our chain of cells, we took the digital representation of the neuron presentedFigure 1, and copied the morphology as many times as needed to produce the system inquestion. The individual cells were connected together via a single synaptic connectionlinking the end compartment of the axon to the cell body of the next cell in the chain, asshown in Figure 11(a). When an action potential arrives at the presynaptic terminal, atthe end of the axon, the synaptic activity is approximated by a current injection into thepost-synaptic compartment that mimics the excitatory post synaptic potential (EPSP)observed experimentally. For the purposes of our demonstration, the size of the synapticconductance was increased to the point where a single synaptic event was sufficient totrigger an action potential in the post-synaptic cell.

Activity in our system was initiated by a synaptic-like current injection into thecell body of the initial cell in the chain, and simulations were run for 7 ms per cell, a

22

Page 23: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

sufficiently long time to allow the action potential to propagate through the entire systemand reach the end of the axon in the final cell. Because the length of the simulationincreases with the number of cells, the computational cost of the BDF method withoutadaptivity grows quadratically, as shown in Figure 11(b). In the spatially adaptive case,only a fraction of the sections in the computational domain are in the “active” state,providing improved efficiency over the non adaptive method. However, the number ofactive sections increases with the problem size, as shown in Figure 11(c), causing thecomputational time to grow quadratically in this case as well, though more slowly thanin the non adaptive method.

. . .

(a)

0 10 20 30 40 50Number of Cells

0

500

1000

1500

2000

2500

3000

Computational Time (seconds)

BDFSALATS

(b)

0 10 20 30 40 50

Number of Cells

0

500

1000

1500

2000

Mean number of active sections

(c)

Figure 11: Timing comparison of numerical methods for chains of cells connected by

synapses. An increasing number of cells were connected via synapses to form chains (a). Activityin the system was initiated through a synaptic-like current injection into the cell body of the initial cell.Simulations were run for long enough for the action potential to propagate through the entire systemand reach the end of the axon in the terminal cell. The computational time of three methods is presentedin (b): The BDF method with no adaptivity (BDF), the spatially adaptive method of Rempe and Chopp(SA), and the localized adaptive time stepping scheme (LATS). Shown in (c) is the average numberof active sections during each of the simulations for the spatially adaptive method. Since the numberof active sections grows linearly with the size of the problem, and the length of time increases as well,this leads to the computational time growing quadratically. In the same way, the non adaptive BDFscheme demonstrates quadratic growth in computational time. In contrast, the locally adaptive timestepping scheme focuses computational power much more narrowly and consequently the computationaltime grows linearly with the length of the simulation.

For small problems, with fewer than 15 cells in the chain, the locally adaptive timestepping scheme is actually more expensive than the spatially adaptive method. Inaddition to the extra computational overhead involved in adaptive time stepping, the

23

Page 24: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

step size selection method often chooses a much smaller time step during the peak of theaction potential than is used by the fixed step methods. In simulations of short durationthis results in the adaptive time stepping method actually computing the solution at agreater number of (unequally spaced) time points than the fixed step methods. As thelength of the simulation increases, the ratio between the number of small and large stepstaken by the locally adaptive time stepping scheme becomes more favorable, and in totalthe method performs fewer computations than the fixed step methods. Additionally, thelocalized adaptive time stepping method focuses computational resources more narrowlythan the spatially adaptive method, leading to a linear increase in the computationaltime relative to the number of cells in the chain.

7. Discussion

We have presented an algorithm for domain decomposition and locally adaptive timestepping, and applied it to the branched domain present in neural simulations. For largescale problems, this method provides improved efficiency over the spatially adaptivemethod of Rempe and Chopp [23], which in turn provides increased efficiency over thestandard methods incorporated into the NEURON simulation package.

As in the case of Rempe and Chopp’s spatially adaptive method, we employed a do-main decomposition scheme and reduced the large computational problem into smaller,tri-diagonal systems. Our method provides many of the same benefits of the spatiallyadaptive scheme including the ability to handle systems containing closed loops, and suit-ability for parallel implementation. As in the case of the commonly used methods, ouralgorithm requires O(N) updates for each section, where N is the number of grid points,but is stable for a much larger range of step sizes, and provides more robust behaviorthrough the use of an error-like activity tolerance. Our method also represents a refine-ment of the binary “on”-“off” behavior, allocating computational resources according tothe location and intensity of the activity within the system. While we have presentedour algorithm in the context of the neural systems that motivated its development, itcan be applied to more general classes of problems and will be beneficial in any systemthat displays localized activity.

[1] A. L. Hodgkin, A. Huxley, A quantitative description of membrane current and its application toconduction and excitation in nerve, Journal of Physiology 117 (1952) 500 – 544.

[2] C. Gear, Algorithm 407: DIFSUB for solution of ordinary differential equations [D2], Communica-tions of the ACM 14 (1971) 190.

[3] C. Gear, The automatic integration of ordinary differential equations, Communications of the ACM14 (1971) 179.

[4] P. N. Brown, G. D. Byrne, A. C. Hindmarsh, VODE: a variable-coefficient ODE solver, SIAMJournal on Scientific and Statistical Computing 10 (1989) 1038–1051.

[5] G. D. Byrne, A. C. Hindmarsh, A polyalgorithm for the numerical solution of ordinary differentialequations, ACM Transactions on Mathematical Software 1 (1975) 71–96.

[6] S. D. Cohen, A. C. Hindmarsh, CVODE, a stiff/nonstiff ODE solver in C, Computers in Physics10 (1996) 138–143.

[7] D. Amitai, A. Averbuch, M. Israeli, S. Itzikowitz, Implicit-explicit parallel asynchronous solver ofparabolic PDEs, SIAM Journal on Scientific Computing 19 (1998) 1366.

[8] C. Dawson, Q. Du, T. Dupont, A finite difference domain decomposition algorithm for numericalsolution of the heat equation, Mathematics of Computation 57 (1991) 63–71.

[9] Y. A. Kuznetsov, New algorithms for approximate realization of implicit difference schemes,Russian Journal of Numerical Analysis and Mathematical Modelling 3 (1988) 99–114. Doi:10.1515/rnam.1988.3.2.99.

24

Page 25: A Locally Adaptive Time Stepping Algorithm for the Solutionpeople.esam.northwestern.edu/~chopp/papers/KublikChopp.pdf · Mascagni [22], and Rempe and Chopp [23] utilized domain decomposition

[10] H.-S. Shi, H.-L. Liao, Unconditional stability of corrected explicitimplicit domain decompositionalgorithms for parallel approximation of heat equations, SIAM Journal on Numerical Analysis 44(2006) 1584.

[11] Y. Zhuang, X.-H. Sun, Stable, globally non-iterative, non-overlapping domain decomposition par-allel solvers for parabolic problems, Proceedings of the 2001 ACM/IEEE conference on Supercom-puting (CDROM) (2001) 19.

[12] Y. Zhuang, X.-H. Sun, Stabilized explicit-implicit domain decomposition methods for the numericalsolution of parabolic equations, SIAM Journal on Scientific Computing 24 (2002) 335–358.

[13] T. Belytschko, N. D. Gilbertsen, Implementation of mixed time integration techniques on a vector-ized computer with shared memory, Int. J. Numer. Meth. Engng. 35 (1992) 1803–1828.

[14] T. Belytschko, H. Yen, R. Mullen, Mixed methods for time integration, Computer Methods inApplied Mechanics and Engineering 17 (1979) 259–275.

[15] S. Xiao, T. Belytschko, A bridging domain method for coupling continua with molecular dynamics,Computer Methods in Applied Mechanics and Engineering 193 (2004) 1645–1669.

[16] P. Smolinski, Y. Wu, An implicit multi-time step integration method for structural dynamicsproblems, Computational Mechanics 22 (1998) 337–343.

[17] M. L. Hines, N. T. Carnevale, The neuron simulation environment, Neural Computation 9 (1997)1179–1209.

[18] N. T. Carnevale, M. L. Hines, The NEURON Book, Cambridge University Press, New York, NY,USA, 2006.

[19] J. Cooley, F. Dodge, Digital computer solutions for excitation and propagation of the nerve impulse,Biophys. J. 6 (1966) 583–599.

[20] P. Nicolson, J. Crank, A practical method for numerical evaluation of solutions of partial differentialequations of the heat-conduction type, P Camb Philos Soc 43 (1947) 50–67.

[21] M. L. Hines, Efficient computation of branched nerve equations, International Journal of Bio-Medical Computing 15 (1984) 69–76.

[22] M. Mascagni, A parallelizing algorithm for computing solutions to arbitrarily branched cable neuronmodels, Journal of Neuroscience Methods 36 (1991) 105–114.

[23] M. J. Rempe, D. L. Chopp, A predictor-corrector algorithm for reaction-diffusion equations associ-ated with neural activity on branched structures, SIAM Journal on Scientific Computing 28 (2006)2139–2161.

[24] J. Lee, B. Smaill, N. Smith, Hodgkin-Huxley type ion channel characterization: An improvedmethod of voltage clamp experiment parameter estimation, Journal of theoretical Biology (2006).

[25] M. Mascagni, The Backward Euler method for numerical solution of the Hodgkin–Huxley equationsof nerve conduction, SIAM Journal on Numerical Analysis 27 (1990) 941–962.

[26] L. F. Shampine, Numerical Solution of Ordinary Differential Equations, Chapman & Hall, NewYork, NY, 1997.

[27] N. L. Golding, W. L. Kath, N. Spruston, Dichotomy of action-potential backpropagation in CA1pyramidal neuron dendrites, Journal of neurophysiology 86 (2001) 2998–3010.

[28] M. J. Rempe, N. Spruston, W. L. Kath, D. L. Chopp, Compartmental neural simulations withspatial adaptivity, J Comput Neurosci 25 (2008) 465–480.

[29] H. Markram, The blue brain project, Nat Rev Neurosci 7 (2006) 153–160.[30] M. Migliore, C. Cannia, W. W. Lytton, H. Markram, M. L. Hines, Parallel network simulations

with neuron, J Comput Neurosci 21 (2006) 119–129.

25