stochastic simulation of reaction-diffusion...

48
ACTA UNIVERSITATIS UPSALIENSIS UPPSALA 2013 Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty of Science and Technology 1042 Stochastic Simulation of Reaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9 urn:nbn:se:uu:diva-198522

Upload: others

Post on 11-Jul-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

ACTAUNIVERSITATIS

UPSALIENSISUPPSALA

2013

Digital Comprehensive Summaries of Uppsala Dissertationsfrom the Faculty of Science and Technology 1042

Stochastic Simulation ofReaction-Diffusion Processes

STEFAN HELLANDER

ISSN 1651-6214ISBN 978-91-554-8667-9urn:nbn:se:uu:diva-198522

Page 2: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

Dissertation presented at Uppsala University to be publicly examined in Room 2446,Polacksbacken, Lägerhyddsvägen 2D, Uppsala, Wednesday, June 5, 2013 at 10:15 for thedegree of Doctor of Philosophy. The examination will be conducted in English.

AbstractHellander, S. 2013. Stochastic Simulation of Reaction-Diffusion Processes. Acta UniversitatisUpsaliensis. Digital Comprehensive Summaries of Uppsala Dissertations from the Faculty ofScience and Technology 1042. 46 pp. Uppsala. ISBN 978-91-554-8667-9.

Numerical simulation methods have become an important tool in the study of chemical reactionnetworks in living cells. Many systems can, with high accuracy, be modeled by deterministicordinary differential equations, but other systems require a more detailed level of modeling.Stochastic models at either the mesoscopic level or the microscopic level can be used for caseswhen molecules are present in low copy numbers.

In this thesis we develop efficient and flexible algorithms for simulating systems at themicroscopic level. We propose an improvement to the Green's function reaction dynamicsalgorithm, an efficient microscale method. Furthermore, we describe how to simulateinteractions with complex internal structures such as membranes and dynamic fibers.

The mesoscopic level is related to the microscopic level through the reaction rates at therespective scale. We derive that relation in both two dimensions and three dimensions and showthat the mesoscopic model breaks down if the discretization of space becomes too fine. For asimple model problem we can show exactly when this breakdown occurs.

We show how to couple the microscopic scale with the mesoscopic scale in a hybrid method.Using the fact that some systems only display microscale behaviour in parts of the system, wecan gain computational time by restricting the fine-grained microscopic simulations to only apart of the system.

Finally, we have developed a mesoscopic method that couples simulations in three dimensionswith simulations on general embedded lines. The accuracy of the method has been verifiedby comparing the results with purely microscopic simulations as well as with theoreticalpredictions.

Keywords: stochastic simulation, microscale, mesoscale, Smoluchowski's equation, hybridmethods

Stefan Hellander, Uppsala University, Department of Information Technology, Division ofScientific Computing, Box 337, SE-751 05 Uppsala, Sweden. Department of InformationTechnology, Numerical Analysis, Box 337, SE-751 05 Uppsala, Sweden.

© Stefan Hellander 2013

ISSN 1651-6214ISBN 978-91-554-8667-9urn:nbn:se:uu:diva-198522 (http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-198522)

Page 3: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9
Page 4: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9
Page 5: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

List of papers

This thesis is based on the following papers, which are referred to in the textby their Roman numerals.

I S. Hellander and P. Lötstedt. Flexible single molecule simulation ofreaction-diffusion processes. J. Comput. Phys., 230(10):3948-3965,2011.

II A. Hellander, S. Hellander, and P. Lötstedt. Coupled mesoscopic andmicroscopic simulation of stochastic reaction-diffusion processes inmixed dimensions. Multiscale Model. Simul., 10(2):585-611, 2012.

III M. H. Bani-Hashemian, S. Hellander, and P. Lötstedt. Efficientsampling in event-driven algorithms for reaction-diffusion processes.Commun. Comput. Phys., 13(4):958-984, 2013.

IV S. Hellander, A. Hellander, and L. Petzold. Reaction-diffusion masterequation in the microscopic limit. Phys. Rev. E., 85(4):042901, 2012.

V S. Wang, J. Elf, S. Hellander, and P. Lötstedt. Stochasticreaction-diffusion processes with embedded lower dimensionalstructures. Revision of Technical report 2012-034, Department ofInformation Technology, Uppsala University, 2012.

VI S. Hellander. Single molecule simulations in complex geometries withembedded dynamic one-dimensional structures. Technical report2013-009, Department of Information Technology, Uppsala University,2013.

VII M. B. Flegg, S. Hellander, and R. Erban. Convergence of methods forcoupling of microscopic and mesoscopic reaction-diffusionsimulations. Technical report 2013-010, Department of InformationTechnology, Uppsala University, 2013.

Reprints were made with permission from the publishers.

Page 6: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9
Page 7: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 The microscopic level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1 The Smoluchowski model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 Green’s function reaction dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.1 Updating pairs of molecules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.3 Operator splitting approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4 Interactions with lower dimensional structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.4.1 Interaction between a molecule and a plane . . . . . . . . . . . . . . . . . . 182.4.2 Interaction between a molecule and a straight line . . . . . . . 19

2.5 Dynamic lines and active transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.6 Efficient sampling of random numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.6.1 Three dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.6.2 Two dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.7 Numerical example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3 The mesoscopic level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.1 NSM in the limit of small subvolumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.1.1 Mesh-dependent reaction rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2 Embedded one-dimensional structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

3.2.1 Interaction with a polymer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

4 Hybrid methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.1 Splitting of the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.2 Numerical examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

4.2.1 MAPK pathway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314.2.2 Translocation into the cell nucleus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

6 Summary in Swedish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

7 Author’s contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

8 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Page 8: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9
Page 9: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

1. Introduction

The use of numerical simulations to study complex biochemical reaction net-works is a methodology that has gained a lot of popularity over the last coupleof decades. Although the classical, deterministic ODE model is still the mostwidely used model, it has been demonstrated that a deterministic model canbe unsuitable for systems where some species are present in low copy num-bers [15, 16, 40, 52]. This is often the case for reaction networks in livingcells, where certain macromolecules, for instance DNA, only exist in a fewcopies. For these cases discrete stochastic models are required. The focus ofthis thesis is on developing efficient and flexible methods for simulation ofsuch stochastic models.

Normally two levels of stochastic modeling are considered in systems biol-ogy: the mesoscopic level and the microscopic level. At the spatially homo-geneous mesoscopic level, the position of every molecule is assumed to havea uniform distribution in the simulation volume. Thus we only need to con-sider the discrete number of molecules of each species in the system, ratherthan their position. The dynamics of a system at this level of approximation isgoverned by the chemical master equation (CME), and we can generate exactsamples of the probability distribution that solves the CME with the stochasticsimulation algorithm (SSA) by Gillespie [24].

At the spatially inhomogeneous mesoscopic level, the spatial domain is di-vided into subvolumes such that the system is close to spatially homogeneousin each subvolume. Each subvolume is therefore governed by the CME, butmolecules are allowed to diffuse between subvolumes by discrete jumps on thelattice defined by the nodes of the subvolumes. The governing equation is nowcalled the reaction-diffusion master equation (RDME), and exact trajectoriesof the system can be generated with the next subvolume method (NSM) [27].

The microscopic level includes models that track the continuous positionof molecules in space rather than just the number of molecules in a subvol-ume. There are two microscopic models for the reactions, the Smoluchowskimodel [50] and the Doi model [10, 11], that have been studied in the contextof numerical simulations. In this thesis we will only consider the Smolu-chowski model, in which molecules are approximated by hard spheres ratherthan as pure point particles with a soft interaction radius as in the Doi model.In both models the motion of molecules is modeled with Brownian motion.Numerical simulations of the Smoluchowski model involve sampling randomnumbers from fairly complex probability density functions (PDFs), and partof this thesis deals with methods to simplify and make that particular step of

9

Page 10: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

the simulations more efficient. In Paper I we show how to solve the Smolu-chowski equation for pairs of particles in two steps via operator splitting (inboth two and three dimensions), hence introducing an error but ending upwith two equations that are simpler to solve than the full equation. In Paper IIIwe investigate different methods and strategies for sampling from the PDFs:Tabulating the PDFs, sampling from the analytical expressions on the fly, orsolving the equations with a finite difference scheme rather than evaluating theanalytical expressions.

Eukaryotic cells are full of internal structure; two-dimensional membraneswith complex topology and one-dimensional structures such as the cytoskele-ton play an important role in many processes in the cell. Molecules in threedimensions may move first by pure diffusion, then bind to a fiber which ispart of the cytoskeleton, and then get actively transported, e.g. towards thenucleus of the cell or towards the outer membrane of the cell. These internalstructures are also highly dynamic, and the cytoskeleton changes configurationover time; actin and microtubules both grow and shrink and move around inspace [41]. Simulation of such processes requires highly flexible algorithms.In Paper V we develop an algorithm for simulating reactions with embeddedgeneral one-dimensional structures at the mesoscopic level. In Paper II weshow how to simulate reactions with general membranes at the microscopiclevel, and in Paper VI we consider the simulation of embedded general linesat the microscopic level. We show how to simulate reactions with the lines,how to couple this with molecules diffusing and reacting on the lines, andhow to simulate active transport along the lines while the lines move aroundin space.

Although there now exists efficient methods for simulations at the micro-scopic level [2, 3, 34, 57, 58], they are still significantly more expensive thanmethods that simulate systems at the mesoscopic level. However, some sys-tems require a microscopic model to capture important macroscopic dynamics,and in Paper IV we show that the mesoscopic simulations cannot be made arbi-trarily accurate by refining the mesh, since the model actually breaks down forsmall enough subvolumes. This is a problem also studied in [18, 20, 30, 32].We derive new mesh-dependent reaction rates in two as well as three dimen-sions, and show how they relate to other reaction rates suggested in [18, 20].

Even though the mesoscopic model has limitations, we could consider hy-brid methods that couple different levels of approximation. Some systemsmay not require the same accuracy everywhere, and splitting the system intoa mesoscopic and a microscopic part, depending on the properties of the sys-tem, can be an attractive middle way. In Paper II we develop a method thatcouples microscopic and mesoscopic simulations, both by splitting the do-main in two parts but also by splitting the species into mesoscopic and mi-croscopic species. The system is then propagated using an operator splitting,where the mesoscopic degrees of freedom are advanced a time step followedby the propagation of the microscopic degrees of freedom. The method has

10

Page 11: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

been successfully applied to a system that has microscale features that affectthe macroscopic behavior. In Paper VII we compare the accuracy of severalhybrid methods.

This thesis is organized as follows. In Section 2 we review the Smolu-chowski model and simulation methods at this scale. In Section 3 the meso-scopic model is reviewed, and we discuss how to simulate interactions be-tween molecules and embedded lines at the mesoscopic level. In Section 4 weconsider hybrid methods coupling the mesoscopic level with the microscopiclevel.

11

Page 12: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

2. The microscopic level

The microscopic level is usually defined to include models in which the con-tinuous positions of individual molecules are tracked, in contrast to merelytracking the number of molecules at the mesoscopic level of approximation.Two such models that have received significant attention in the scientific litera-ture in the context of numerical simulations are the Smoluchowski model [50]and the Doi model [10, 11]. The diffusive motion of molecules is modeledwith Brownian motion in both the Doi model and the Smoluchowski model,but reactions are treated differently. In the Smoluchowski model molecules areapproximated by hard spheres, and reactions are modeled with a mixed bound-ary condition at the reaction radius of the molecules. In the Doi model reac-tions instead occur with a prescribed probability per unit time when moleculesare located within each others reaction radius.

There exist several methods and software packages for simulations of bio-chemical systems at the microscopic level. Smoldyn [2] and MCell [34] bothimplement methods that approximate the Smoluchowski model by discretizingtime, and Green’s function reaction dynamics (GFRD) is an efficient methodthat is continuous in both time and space [57, 58]. In eGFRD, the originalGFRD algorithm has been combined with the first-passage kinetic Monte-Carlo (FPKMC) algorithm [47, 52]. The eGFRD algorithm has been imple-mented in the software E-Cell [53]. Another approach is to discretize space.In Spatiocyte [3] molecules diffuse on a hexagonal packing of spheres andreact with some probability when in neighboring spheres.

This thesis has its main focus on the Smoluchowski model. In Paper I wedevise an efficient and simple method to solve the Smoluchowski equation forpairs of molecules. Paper III also focuses on this problem, and investigatesthe efficiency of using analytical solutions of the Smoluchowski equation insimulations, compared to solving the equation using numerical methods ortabulating the solution of the equation. Paper VI concerns an algorithm com-bining simulations of diffusing and reacting molecules in space with diffusingand reacting molecules on moving, growing, and shrinking embedded one-dimensional manifolds.

2.1 The Smoluchowski modelConsider a system of N diffusing and reacting molecules with positions givenby x1n, . . . ,xNn at time tn inside some reaction volume. The full Smoluchowski

12

Page 13: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

equation, though possible to write down, would be intractable to solve forN > 2 as the problem becomes an N-body problem with a combined PDF,p(x1, . . . ,xN , t|x1n, . . . ,xNn, tn), in 3N dimensions plus time. The equation fora single molecule with diffusion constant D can be solved; the equation for thePDF p(x1, t|x1n, tn) is simply the diffusion equation

∂ p∂ t

= D∆p (2.1)

with initial condition given by p(x1, tn|x1n, tn)= δ (x1−x1n) and in the far-fieldp(‖x1‖→∞, t|x1n, tn) = 0. The solution to this equation is a three-dimensionalGaussian

p(x1, t|x1n, tn) =1

(4πD∆t)3/2 exp(−‖x1−x1n‖2

4D∆t

), (2.2)

where ∆t = t− tn. The Smoluchowski equation for two molecules is given by

pt = D1∆x1 p+D2∆x2 p, (2.3)

where D1 and D2 are the diffusion coefficients of the two molecules and thePDF p(x1,x2, t|x1n,x2n, tn) governs the positions x1 and x2 of the moleculesat time t, given the positions x1n and x2n at time tn. As it turns out, also thisequation can be solved analytically [8, 57]. To this end, we first introduce thenew variables

Y =√

D2/D1x1 +√

D1/D2x2, y = x2−x1. (2.4)

so that p can be written as

p(x1,x2, t|x1n,x2n, tn) = pY(Y, t|Yn, tn)py(y, t|yn, tn). (2.5)

Now (2.3) can be split into two independent equations

∂t pY = D∆Y pY (2.6)∂t py = D∆y py, (2.7)

where D is the sum of the diffusion coefficients D1 and D2 of the two molecules.The diffusion in the Y direction will be in free space, but the equation for they variable will have a boundary condition at the sum of the reaction radius, σ ,of the two molecules

4πσ2D

∂ py

∂n

∣∣∣‖y‖=σ

= kr py(‖y‖= σ , t|yn, tn)− kd (1−S(t|yn, tn)) , (2.8)

where kr is the association rate and kd the dissociation rate. For kr = kd = 0,the molecules will be non-reactive and will always be reflected upon collision.If kr > 0, kd = 0 the molecules react but never dissociate, and if kr > 0 and

13

Page 14: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

kd > 0 the molecules both react and dissociate and thus undergo a reversiblereaction. For kr→ ∞ the molecules always react upon collision. The functionS in (2.8) is the survival probability, that is, the probability that the moleculesare unbound at time t. It is given by (see [35, 36])

S(t|yn, tn) = 1−∫ t

tn4πσ

2D∂ py

∂n

∣∣∣‖y‖=σ

dτ. (2.9)

Given the initial condition

py(y, tn|yn, tn) = δ (y−yn) (2.10)

and with a condition at infinity given by py(‖y‖ → ∞, t|yn, tn) = 0, (2.7) canbe solved analytically for the case kd = 0, see [8, 58].

2.2 Green’s function reaction dynamicsGiven that the full N-body problem cannot be solved for N > 2, we realizethat we need to reduce the problem into smaller and simpler problems. Oneapproach is to approximate the full system with simple one-body problems bychoosing a time step ∆t such that each molecule moves only a short distanceduring this time step. If molecules collide, they would react with some prob-ability or otherwise be reflected [2, 19, 34, 46]. However, in order to resolvecollisions correctly, the time step has to be small and therefore this approachcan be slow. Given that the analytical solution to the Smoluchowski equa-tion for two molecules is available, a natural approach would be to not onlyconsider one-body problems but rather divide the full problem into one- andtwo-body problems.

This can be achieved in two steps. First, divide the molecules into sub-sets of one or two molecules by letting molecules that are each other’s near-est neighbors be subsets consisting of two molecules, while the remainingmolecules are subsets consisting of one molecule, and let the subsets be de-noted by S1, . . . ,SM. Second, choose a time step ∆t such that each subset isunlikely to interact with another subset during ∆t. This is accomplished byfirst computing pairwise distances di j between all the subsets, where di j is theshortest distance between any of the molecules in the subset Si and the subsetS j, and then by computing ∆ti given by

∆ti =

(min j, j 6=i di j

)2

K ·6D, (2.11)

where K is a constant chosen large enough to make the probability for thesubsets Si and S j to interact during the time step ∆ti small. Note that (2.11) isrelated to the standard deviation of the three-dimensional normal distribution,√

6D∆t. The global time step is chosen to be ∆t = mini ∆ti. The full N-body

14

Page 15: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

problem can be approximated during ∆t by the independent one- and two-bodyproblems defined by the subsets S1, . . . ,SM. The approach outlined above iscalled the Green’s function reaction dynamics [57, 58]. Similar algorithmshave also been considered in [14, 48]. The GFRD algorithm is more efficientand accurate than the methods implemented in Smoldyn [2] and MCell [34]for systems that are not crowded. However, for dense systems the time steps inGFRD become small and GFRD will then be outperformed by Smoldyn andMCell, as the cost per time step is much smaller in those algorithms.

2.2.1 Updating pairs of moleculesThe position of single molecules are updated by sampling new positions froma normal distribution with the standard deviation

√2D∆t in each direction

(unless they are close to some internal structure, see Section 2.4, or dissociateduring the time step). Pairs of molecules are updated according to the PDFobtained by solving the Smoluchowski equation for pairs of molecules (2.3).

Given two molecules with positions x1n and x2n at time tn we sample thetime tr when they react according to the flux over the boundary at the reactionradius, given by

q(t|yn, tn) = kr py(‖y‖= σ , t|yn, tn), (2.12)

see [57, 58].If tr ≤ ∆t, the reaction fires at tr and the product is updated as a single

molecule for the remainder of the time step. If, on the other hand, tr > ∆t wesample new positions from the distribution p. This is done in two steps. Firstwe update Y by sampling from a normal distribution with standard deviation√

2D∆t in all directions and next we update the y-coordinate by samplingrandom numbers from the random variable with PDF given by py.

Though the analytical solution for the case kd = 0 is available, it is fairlycomplicated and expensive to evaluate. In Paper I we solve the equation in twosteps with an operator splitting scheme [38], introducing an error, but makingeach equation simpler than the full equation. This approach also makes itpossible to consider the case kd > 0 which can speed up simulations in thecase of molecules rebinding and dissociating quickly.

2.3 Operator splitting approachConsider (2.7) in a spherical coordinate system r = (r,θ ,φ) rotated such thatrn = (rn,0,0). Then the equation becomes

∂ pr

∂ t= D

((∂ 2 pr

∂ r2 +2r

∂ pr

∂ r

)+

1r2

(1

sinθ

∂θ

(sinθ

∂ pr

∂θ

)+

1sin2

θ

∂ 2 pr

∂φ 2

))(2.13)

15

Page 16: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

with boundary condition

4πσ2D

∂ pr

∂ r

∣∣∣r=σ

= kr pr(r = σ ,θ ,φ , t|rn, tn)− kd (1−S(t|rn, tn)) , (2.14)

initial condition

pr(r,θ ,φ , tn|rn, tn) =δ (r− rn)δ (θ)

r2 sinθ, (2.15)

and with p vanishing at infinity; p(‖r‖ → ∞, t|rn, tn) = 0. This equation, asmentioned above, can be solved analytically for the case kd = 0:

pr(r,θ ,φ , t|rn, tn) =1

4π√

rrn

∑n=0

(2n+1)Pn(cosθ)· (2.16)

·∫

0exp(−2u2

∆t)Fn+1/2(ur)Fn+1/2(urn)udu,

(2.17)

where ∆t = t− tn, Pn is a Legendre polynomial, and

Fn(ur) =(2σkr +1)A−2uσB

(C2 +D2)12

, (2.18)

where A = Jn(ur)Yn(uσ)−Yn(ur)Jn(uσ)

B = Jn(ur)Y ′n(uσ)−Yn(ur)J′n(uσ)

C = (2σkr +1)Jn(uσ)−2uσJ′n(uσ)

D = (2σkr +1)Yn(uσ)−2uσY ′n(uσ),

(2.19)

and where Jn and Yn are Bessel functions of first and second kind.This expression is difficult and expensive to sample random numbers from.

We could potentially precompute and tabulate pr, but since there are four pa-rameters (r, θ , rn and t− tn) to tabulate for, it is hard to get a high accuracywithout having very large tables. As an alternative we have suggested an ap-proach where the equation is solved in two steps instead of solving the fullequation directly. First we solve for the radial part of (2.13)

∂ pr

∂ t= D

(∂ 2 pr

∂ r2 +2r

∂ pr

∂ r

), (2.20)

with boundary condition given by (2.14), initial condition pr(r, tn|rn, tn) =δ (r− rn), and with pr(r→ ∞, t|rn, tn) = 0. The analytical solution is derivedin [35] and is given by

pr(r, t|rn, tn)4πrrn√

D =1√

4π∆t

(exp(−R2

1)+ exp(−R22))+B(α,β ,γ,∆t)+

+B(β ,γ,α,∆t)+B(γ,α,β ,∆t),(2.21)

16

Page 17: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

where∆t = t− tnR1 =

(r−rn)2

4D∆tR2 =

r+rn−2σ√4D∆t

B(α,β ,γ,∆t) = α(γ+α)(α+β )(γ−β )(α−β ) exp(2αR2

√∆t +α2∆t)erfc(R2 +α

√∆t),

(2.22)

and where −α , −β and −γ solves

σx3 +√

D(

1+kr

4πσD

)x2 +σkdx+

√Dkd = 0. (2.23)

The second step is to solve for the angular part

∂ pθφ

∂ t=

Dr2

(1

sinθ

∂θ

(sinθ

∂ pθφ

∂θ

)+

1sin2

θ

∂ 2 pθφ

∂φ 2

)(2.24)

with the initial condition pθφ (θ ,φ , tn|0,0, tn) = δ (θ)/(r2 sinθ). As it turnsout, pθφ will be independent of φ (see e.g. [54, 56])

pθφ (θ ,φ , t|0,0, tn) =∞

∑l=0

2l +14πr2 exp

(−l(l +1)D(t− tn)

r2

)Pl(cosθ), (2.25)

where Pl is a Legendre function. Thus, φ will have a uniform distribution onthe interval [0,2π).

We can now sample yn+1 in five steps:1. Transform the coordinate system to a spherical coordinate system with

initial position given by rn = (rn,0,0).2. Given rn at time tn, sample rn+1 from the PDF (2.21).3. Given rn+1 at time tn+1, sample θn+1 from the PDF (2.25) with r = rn+1.4. Sample φn+1 from a uniform distribution on the interval [0,2π).5. Transform the coordinates back to obtain yn+1.Now, given yn+1 and Yn+1, we get x1(n+1) and x2(n+1) from solving (2.4).By solving the equation in two steps we simplify the computations, but we

do introduce an error. In Paper I we show in several examples that the erroris small. If, however, one would need higher accuracy than that given by afirst order operator splitting scheme, a second order scheme, so called Strangsplitting [51], is also discussed in Paper I.

2.4 Interactions with lower dimensional structuresEukaryotes have a complex internal structure; molecules can interact withtwo-dimensional membranes and with one-dimensional structures and poly-mers. To further complicate matters these structures are far from static [41]

17

Page 18: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

and molecules in living cells are not only transported by pure diffusion, but arealso actively transported on the cytoskeleton, a structure in the cell consistingof microtubules and actin cables. Molecules bind to the fibers of the cytoskele-ton and are then transported in a specific direction by molecular motors. Thecytoskeleton extends throughout the whole cytoplasm in eukaryotic cells, andis therefore an important structure to take into account when modeling com-plex reaction networks in cells. Furthermore, one-dimensional processes maytake place on long polymers in the cell, such as DNA.

The problem of coupling simulations in space with one-dimensional pro-cesses has also been studied in [39]. They develop an FPKMC method forsimulating active transport due to chemical gradients along static lines. Meth-ods for simulation of molecules interacting with surfaces have been developedin [34, 44].

In this section we will describe how to include reactive complex lower-dimensional structures in the GFRD algorithm. More specifically, we willsummarize an algorithm for simulating complex and reactive surfaces (seePaper II) and an algorithm for simulating dynamic and reactive embeddedone-dimensional manifolds (see Paper VI).

2.4.1 Interaction between a molecule and a planeConsider a molecule in the vicinity of a plane. Without loss of generalitywe can assume that the plane is the x− y plane and that the position of themolecule at time tn is given by xn = (0,0,zn). The diffusion of the moleculealong the x- and the y-axes is now independent of the interaction between themolecule and the plane, and the x- and y-coordinates are therefore updatedby sampling new positions from a normal distribution with standard deviation√

2D∆t in each direction. The interaction between the molecule and the planeis modeled by the one-dimensional Smoluchowski equation

∂ pz

∂ t= D

∂ 2 pz

∂ z2 , (2.26)

with the boundary condition

D∂ pz

∂ z= kr pz(0, t|zn, tn). (2.27)

and inititial condition p(z, tn|zn, tn) = δ (z− zn). Finally, p vanishes at infinityp(z→ ∞, t|zn, tn) = 0. This equation is solved analytically in [8]. Similarly towhen updating pairs of particles, we first sample the time tr when the moleculereacts with the surface. If tr ≤ ∆t, the reaction fires at tr, and otherwise zn+1 issampled from pz.

18

Page 19: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

2.4.2 Interaction between a molecule and a straight lineNow consider a straight, infinite line through some domain. We want to sim-ulate the interaction between a molecule A and the line l. Without loss ofgenerality, assume that the line is the z-axis and that the molecule has the ini-tial position, in cylindrical coordinates, rn = (rn,θn,zn) = (rn,0,0) at time tn.The molecule has the reaction radius σA and the line has the reaction radiusσl . Denote the sum of the reaction radii by σ and the diffusion coefficient of Aby D. Note that the diffusion of the molecule in the z-direction is independentof the diffusion in the r- and θ -direction and the interaction with the line. Thefull equation is split into two equations using a first order operator splittingscheme. The equation for the radial part becomes

∂ pr

∂ t= D

(∂ 2 pr

∂ r2 +1r

∂ pr

∂ r

), (2.28)

with boundary condition at r = σ

2πσD∂ pr

∂ r

∣∣∣r=σ

= kr pr(r = σ , t|rn, tn) (2.29)

and initial condition given by pr(r, tn|rn, tn) = δ (r− rn). Finally, pr vanishesat infinity. This equation is solved analytically in [8] and the solution is givenby

pr(r, t|rn, tn) =1

∫∞

0exp(−Du2(t− tn))C(u,r,k,kr)C(u,rn,k,kr)udu,

(2.30)

where k = 2πσD and where the function C is defined by

C(u,r,k,h) =J0(ur)(kuY1(σu)+hY0(σu))−Y0(ur)(kuJ1(σu)+hJ0(σu))

((kuY1(σu)+hY0(σu))2 +(kuJ1(σu)+hJ0(σu))2)12

,

(2.31)

with J0 and J1 being Bessel functions of the first kind and Y0 and Y1 Besselfunctions of the second kind. Although the analytical solution is available, itis fairly complex and expensive to compute. Natural strategies to sample fromthe PDF pr are to either evaluate the analytical solution on the fly, compute alook-up table in the parameters r, rn, and t− tn, or to use a numerical schemeto compute the solution. We investigate these three strategies in Paper III andthe results are summarized in Section 2.6.

Next we solve the equation for the θ and z directions

∂ pθz

∂ t= D

(1r2

∂ 2 pθz

∂θ 2 +∂ 2 pθz

∂ z2

), (2.32)

with initial condition pθz(θ ,z, tn|0,0, tn) = δ (θ)δ (z)/r. The solution is aGaussian in both θ and z.

19

Page 20: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

2.5 Dynamic lines and active transportConsider a general curve Γ embedded in three-dimensional space. The curvecan be approximated by a piecewise linear curve, with linear segments denotedby γ1, . . . ,γM, to arbitrary accuracy. Consider a molecule close to one of thelinear segments, say γi. First choose a time step ∆t such that the molecule andthe line segment are unlikely to interact with any other object during the timestep. Throughout the time step ∆t the interaction between the line segmentand the molecule can be approximated by the interaction between a moleculeand an infinitely long line. Thus, the molecule can be updated according tothe algorithm proposed in Section 2.4.2.

We simulate moving, growing, and shrinking lines with an operator splittingapproach. First we update molecules with the lines kept constant, and then weupdate the lines with the molecules kept constant. More specifically, considerthe line defined by the segments γ1, . . . ,γM . The segment γi is determined by apair of endpoints (p1

i ,p2i ), where the points are chosen such that the segments

are connected. The line is now transformed by some transformation T (x, t) :R3×R→R3, where the points at time tn+1 is given by applying T to all pointsat time tn. Thus, if the line is defined by the points p1

1,p21, . . . at time tn, then

the line is given by the points T (p11, tn),T (p

21, tn), . . . at time tn+1.

Active transport can be simulated by sampling new positions for moleculeson the lines from a different distribution than the normal distribution, or evenletting the molecules do a deterministic walk on the lines. Diffusion and re-action of molecules on the lines can be simulated with the GFRD algorithmin one dimension. In Paper VI we consider numerical examples with bothdynamic lines and active transport.

2.6 Efficient sampling of random numbersAlthough the analytical solutions to many of the equations considered aboveare available, it is not obvious that they are efficient to use when sampling newpositions of the molecules. For instance, the analytical solution to the radialpart of the two-dimensional Smoluchowski equation is given as an integral ofa complicated expression of Bessel functions, and evaluating that expressionaccurately and efficiently is not straight-forward.

We compare several different approaches to sampling new positions in boththree dimensions and two dimensions. The first approach is to use the an-alytical solutions to compute the PDF or the cumulative distribution function(CDF) on the fly, and then sample new positions by inverse transform sampling(ITS). ITS is based on sampling uniform random numbers and then transform-ing them with the inverse of the CDF. The second approach is to precomputethe PDFs and tabulate the solutions. Computing the tables can be expensive,but is done only once before the simulation is started. However, the drawbackof this approach is that in order to keep the interpolation error small we may

20

Page 21: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

need very large three-dimensional tables consuming a lot of memory. This canmake the look-up process slow and make the algorithm less suitable for mul-ticore implementations. On the other hand, for cases when the table is not toolarge, this can be a very efficient method. The last approach that we consideris to compute the PDFs with a semi-implicit finite difference scheme. Withthe PDF, we determine the CDF numerically and sample from that.

2.6.1 Three dimensionsWe have compared sampling a new r and θ both using a look-up table andsampling by utilizing the analytical expressions for the PDF or the CDF whenavailable. In three dimensions the analytical expression for pr is fairly simple,and as an analytical expression for the CDF is available, the CPU time forsampling by evaluating the analytical expression on the fly is on the same orderas sampling from a look-up table. Solving the equation numerically turns outto be orders of magnitude slower, and thus it is clear that the preferred methodis to sample random numbers using the analytical expression.

The analytical expression for pθ is more complicated than that for pr, andinvolves summation of an infinite series. For the parameters that we consid-ered in Paper III we found that sampling from the analytical PDF was expen-sive and that the CPU time per random number sampled was on the order of0.1s, while sampling from a look-up table was 2-3 orders of magnitude faster,while still maintaining an error of around 0.01%. We implemented the meth-ods in Matlab and the performance could probably be improved significantlyif we were to write an optimized version in for instance C, but it is still un-likely that the main conclusion would change. Computing the look-up tablewas quite efficient (a CPU time of 17 seconds) and unless that time is signifi-cantly longer than the actual simulation time, the best method to sample a newθ would be to use the look-up table method (except for small values of theparameter where the method developed in [7] has a similar performance to thelook-up table). Note that there is only one parameter to tabulate for in pθ , andthe table can therefore be kept small (less than 500KB).

2.6.2 Two dimensionsIn two dimensions the angular direction is straight-forward to update, whilethe analytical expression for pr in (2.30) is complicated. For this case wefound that evaluating the analytical expression was the most expensive methodand that sampling a new r using the numerical solution of the equation wasabout an order of magnitude faster. However, the look-up table was yet an-other 2-3 orders of magnitude faster, with an error of less than 5% for allparameters, and for most parameters significantly smaller than that (< 1%).The fastest way to generate the look-up table was to generate it by solving the

21

Page 22: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

equation numerically, which took about 29 minutes of CPU time compared toapproximately 7 hours using the analytical expression.

2.7 Numerical exampleIn Paper VI we consider an example of active transport of molecules alongmoving microtubules in a spherical domain with radius 10−6 m. Moleculesof species A diffuse in three dimensional space, react with microtubules, andare then actively transported towards the center of the sphere. We are thusconsidering the following reaction

A+Ckrkd

Acyl +C (2.33)

where C is a microtubule and Acyl is an A-molecule bound to the microtubule.The system is initialized with 100 A-molecules with uniform initial positions,and 25 microtubules, modeled by straight lines going through the center of thesphere. Each microtubule is therefore determined by a pair of points (pi,−pi),1 ≤ i ≤ 25. The points pi are all sampled from a uniform distribution onthe surface of the sphere. Molecules free in space move by pure diffusionwith diffusion constant D = 10−12 m2/s, while the molecules attached to a mi-crotubule move deterministically towards the center of the sphere with speed√

2 ·10−14∆t/40m/s. Two snapshots from the simulation are shown in Figure2.1.

We model the motion of the microtubules by rotation around the center ofthe sphere. Specifically, they move ∆θ and ∆φ radians per time step aroundthe x-axis and the y-axis, where ∆θ and ∆φ are given by

∆θ = 2π∆tX1

∆φ = 2π∆tX2,(2.34)

and where X1 and X2 are random numbers sampled from a normal distributionwith standard deviation 1. Note that this is not meant as an accurate represen-tation of the true biology, but rather as a demonstration of the flexibility of thealgorithm.

A trajectory of one of the microtubules as well as the radial distribution ofmolecules at the end of a simulation are plotted in Figure 2.2. As expected,the distribution of molecules in the sphere is shifted towards the center of thesphere compared to the radial distribution of molecules uniformly distributedon the sphere.

22

Page 23: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

Figure 2.1. Two snapshots from the simulation. Acyl-molecules (blue dots) are boundto the microtubules (yellow lines). Once bound, they are transported deterministicallytowards the center of the sphere. Note that the free A-molecules are not shown in thisfigure.

0 0.2 0.4 0.6 0.8 1

x 10−6

0

5

10

15

Distance from origin

Distribution at tf=1.0s

Uniform distribution

0 0.2 0.4 0.6 0.8 1−1

−0.5

0

0.5

1x 10

−6

Time (s)

Po

sitio

n

x(t)

y(t)

z(t)

Figure 2.2. To the left the radial distribution of the molecules at the final time (solidline) compared with the radial distribution at the initial time (dashed line). The initialpositions of the molecules are sampled from a uniform distribution. To the right atrajectory of one of the microtubules. We plot the x-, y- and z-coordinate as functionsof time.

23

Page 24: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

3. The mesoscopic level

At the mesoscopic level of approximation we assume that the system, to highaccuracy, can be approximated by a spatially homogeneous model inside somevolume. In other words, the distribution of the position of a molecule shouldbe close to uniform inside the volume. This condition is often referred to as thewell-stirred condition. A system that is assumed to be well-stirred is thereforefully described by the discrete number of molecules present at a given time.Let xn = (x1, . . . ,xN) denote an observation of the stochastic variable X(t) =(X1, . . . ,XN) at time tn, where X j is the number of molecules of species j. Nowlet p(x, t|xn, tn) be the probability of the system to be in state x at time t, giventhat it was in state xn at time tn. The governing equation for p is the chemicalmaster equation (CME) [22, 33], given by

d pdt

=M

∑r=1

ωr(x−nr)p(x−nr, t)−ωr(x)p(x, t), (3.1)

where ωr is the propensity function of reaction r and n is the stoichiometrymatrix. Thus, ωr describes the intensity with which the reaction r occurs,and column r of the matrix n, denoted by nr, describes how the state vectoris affected by reaction r. As an example, consider a system with a singlereversible reaction

A+Bkakd

C. (3.2)

If we assume mass action kinetics, the propensity function for the associa-tion of A and B is given by ω1 = kaab, where a and b are the copy num-bers of molecules A and B respectively, and the propensity function for thedissociation is given by ω2 = kdc. The stoichiometry vectors are given byn1 = [−1,−1,1] and n2 = [1,1,−1].

Exact trajectories of a well-stirred system can be generated with the stochas-tic simulation algorithm (SSA) by Gillespie [24]. Another exact method is thenext reaction method (NRM) [23]. Approximate methods include the tau-leaping method [25] and the finite state projection (FSP) algorithm [45]. Im-proved versions of tau-leaping have been developed in [1, 4, 5, 6]. Variousmethods for the well-mixed case have been implemented in the freely avail-able software StochKit [49].

Some systems have spatial inhomogeneities that make them violate thewell-stirred condition. If this is the case, the volume can be divided into

24

Page 25: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

subvolumes, where in each subvolume the well-stirred condition is fulfilled.Diffusion is modeled by discrete jumps between the subvolumes and onlymolecules in the same subvolume can react. The governing equation is nowcalled the reaction-diffusion master equation (RDME). The NRM algorithmhas been extended to this setting in the next subvolume method (NSM) byElf and Ehrenberg [15]. MesoRD [27] is a software that implements NSM onstructured meshes. NSM can also be extended to unstructured meshes [17],and a software package that uses unstructured meshes instead of structuredmeshes is URDME [12]. STEPS [55] is another software for mesoscopic sim-ulations on unstructured meshes. An approximate method that improve on theperformance of NSM is the diffusive finite state projection algorithm (DFSP)[13]. The DFSP algorithm is implemented as a plugin solver for URDME.

However, it has been shown that the RDME in fact becomes a poor modelif the size of the subvolumes becomes too small [20, 29, 30, 32]. The modelcan be improved by allowing reaction rates to depend explicitly on the mesh[18, 20, 29], but such corrections to the model will inevitably be problem-dependent. This problem is investigated in Paper IV, where we also derivemesh-dependent reaction rates in two dimensions as well as three dimensionsfor a model problem. These results are summarized in Section 3.1. In Sec-tion 3.2 we discuss how to simulate molecules in space interacting with one-dimensional structures, summarizing the contents of Paper V.

3.1 NSM in the limit of small subvolumesA fundamental assumption that we have made is that the microscopic levelprovides a more accurate description of reality than the mesoscopic level.Therefore it is natural to verify the accuracy of a mesoscopic model by com-paring it to a microscopic model. However, in order to do so we need to knowhow the mesoscopic reaction rates correspond to the microscopic, or intrinsic,reaction rates in a specific microscopic model. The relation between meso-scopic reaction rates and the corresponding reaction rates in the microscopicmodel is given by

kmeso =4πσDkmicro

4πσD+ kmicro(3.3)

for sufficiently large subvolumes [9, 26]. This conversion formula is valid inthree dimensions, but in two dimensions no such mesh-independent formulaexists. It is easy to realize that the mesoscopic model becomes inaccurate ifthe size of the subvolumes becomes too small; if the subvolumes are so smallthat molecules no longer fit inside them we could not expect the model to ac-curately describe the system. However, it has been shown that the mesoscopicmodel does not agree with the microscopic model even for reasonably largesubvolumes [18, 20, 29, 30]. One approach to resolve this problem would be

25

Page 26: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

to extend the model to allow for reactions between molecules in different sub-volumes, and this has been studied in [20, 31]. We will instead consider thecase where only molecules in the same subvolume can react, and derive meso-scopic reaction rates that make the two models match for a model problem.

3.1.1 Mesh-dependent reaction ratesNow, let us consider a system with only two molecules, a molecule A and amolecule B, that react according to

A+B kr−→ /0, (3.4)

where kr is the intrinsic, microscopic reaction rate. If we assume that themolecule B is fixed at the origin and that the initial position of the moleculeA is uniformly distributed in a square or cube with volume or area V , we canestimate the average time, τmicro, until the molecules react by (see [20])

τmicro =(1+αF(λ ))V

kr, (3.5)

where V is the volume or area of the domain, α = kr/4πDσ in three dimen-sions and α = kr/πD in two dimensions. Define R to be the radius of a sphereor disk with volume or area V . Then λ = σ/R, and F is given by

F(λ ) =

4ln(1/λ )−(1−λ 2)(3−λ 2)

4(1−λ 2)2 (2D)

(1−λ )(5+6λ+3λ 2+λ 3)5(1+λ+λ 2)2 (3D).

(3.6)

The corresponding mesoscopic model, where the B molecule diffuses on aCartesian mesh with subvolumes of width h and with periodic boundary con-ditions, can also be solved analytically, as demonstrated in Paper IV. The av-erage time until the molecules react at the mesoscopic level, τmeso, dependson the mesh size h, the diffusion constant D, and the mesoscopic reaction ratekmeso in the following way

τmeso = τD +N/kmeso, (3.7)

where N is the number of subvolumes and τD is approximated by

τD ∼

V

2πD ln(√

Vh

)+0.1951 V

4D , as h→ 0 (2D)

1.5164 V6Dh , as h→ 0 (3D),

(3.8)

where V is the volume of the domain in three dimensions and the area of thedomain in two dimensions. Note that (3.8) is a corollary that follows fromresults on random walks by Montroll and Weiss [42, 43].

26

Page 27: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

A reasonable assumption is that τmicro = τmeso should hold, and we can thensolve this equation for the now mesh dependent mesoscopic reaction rates intwo as well as three dimensions:

kmeso =N

τmicro− τD. (3.9)

Other mesh-dependent reaction rates in two and three dimensions have beenderived by Fange et al. in [20], and similar reaction rates were derived byErban and Chapman in [18] for the three-dimensional case. The reaction ratesderived in [20] do not match the reaction rates that we get from studying themodel problem above. This is not surprising as they study a different modelproblem, and we would then expect to get different mesoscopic reaction rates.We have compared how τmeso depends on the mesh and the different choicesof reaction rates in Figure 3.1.

5 10 15 20 25 3016

17

18

19

20

Grid size h (multiples of ρ)

Tim

e (s

)

Fange et al.k

meso

Micro

5 10 15 20 250.2

0.3

0.4

0.5

0.6

Grid size h (multiples of ρ)

ConventionalErban and ChapmanFange et al.k

meso

Micro

Figure 3.1. We have computed τmeso for different reaction rates in two dimensions (tothe left) and in three dimensions (to the right). As we can see, the different reactionrates do not give the same results, and this is because they are derived from differentmodel problems. The conventional reaction rates, as defined by (3.3), are good forlarger subvolumes. In the figure above, ρ denotes the reaction radius.

There is a lower bound on h, h∗, for when the equation τmeso = τmicro cannotbe solved anymore. By solving τmicro = τD for h, we obtain

h∗ ≈

3.1σ (3D)5.1σ (2D) .

(3.10)

This lower bound is an absolute lower bound for this problem and no meso-scopic reaction rate can make the two models match if h is below this criticallower bound. In Section 4.2.1 we discuss how this problem has practical con-sequences when simulating a problem with fine-grained dynamics, and howwe can resolve it for that model using a hybrid method coupling microscopicand mesoscopic simulations.

27

Page 28: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

3.2 Embedded one-dimensional structuresIn Section 2.4 we described how to simulate interactions between molecules inthree-dimensional space and embedded lines at the microscopic level. How-ever, these simulations can be fairly expensive for large systems, so an accu-rate mesoscopic method is useful for the cases where a mesoscopic level ofapproximation is sufficient.

The problem of coupling mesoscopic simulations in space with active trans-port on one-dimensional fibers was also considered in [28]. They derive howthe fibers affect the mesoscopic jump rates, rather than simulating the fibersexplicitly.

In this section we describe how to simulate molecules reacting with anddissociating from general, embedded polymers. This section summarizes thecontents of Paper V.

3.2.1 Interaction with a polymerWe consider a Cartesian mesh of size h on which the molecules in space dif-fuse and react. The domain Ω is subdivided into cubical voxels Ω1, . . . ,ΩN .A general one-dimensional curve Γ(u) = (x(u),y(u),z(u)), u ∈ [0,umax], goesthrough the mesh and is approximated by a polygon π(s), where the cornersof the polygon are given by

(xm,ym,zm) = (x(um),y(um),z(um)), m = 1, . . . ,M1−1 (3.11)u0 = 0 < u1 < .. . < uM1 . (3.12)

The segments of the polygon are surrounded by cylinders C1, . . . ,CM , wherethe radius of the cylinders, rc, is chosen such that πr2

c = h2. This way the areaof the face of the cylinder is the same as the area of the face of the cubes in themesh. Next we compute the overlap between the cylinders and the backgroundmesh, and the reaction rates given by (3.9) are scaled by the fraction of the vol-ume of the cylinder inside the volume of a voxel in the mesh. The system cannow be simulated with a modified version of the NSM algorithm, as describedin Paper V. Note that the three-dimensional simulation can be coupled withone-dimensional mesoscopic simulations on the fibers in a straight-forwardway. Several such examples are considered in Paper V.

28

Page 29: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

4. Hybrid methods

It has been shown that reaction networks in living cells can have microscalefeatures that affect the macroscopic behavior of the system [52]. These mi-croscale features cannot be accurately captured even at the spatially heteroge-neous mesoscopic scale, since they require a spatial resolution that is finer thanthe critical lower bound of the size of the subvolumes in (3.10). Thus we haveto resort to the microscale to accurately simulate such a system. Unfortunately,even with efficient microscale methods, these simulations are slow comparedto the corresponding mesoscopic simulations, and large systems with com-plicated outer boundaries and internal structures are difficult to simulate forlong times if high accuracy is required. However, if the microscale behavioris restricted to only a part of the system, another strategy would be to simulateonly this specific part with a microscopic method and the remaining part ofthe system at a coarser scale.

In Paper II a method is developed for dividing the species into a micro-scopic and a mesoscopic part, as well as splitting space into a microscopic anda mesoscopic part. Other hybrid methods have been suggested in [21, 37].In [21] they derive an accurate way of coupling the diffusion of molecules ina one-dimensional domain, where one part of the domain is simulated micro-scopically and one part is simulated mesoscopically. In [37] they also considerthe possibility to split both species and space into a mesoscopic and a micro-scopic region.

4.1 Splitting of the systemA domain Ω is covered with a primal mesh, consisting of non-overlappingtetrahedra in space and non-overlapping triangles on the boundary ∂Ω. Fromthe primal mesh we create the dual mesh. We have a set of species S =S1, . . . ,SN in our system. For each species we define a mesoscopic regionand a microscopic region in space. Species Si is simulated at the mesoscopiclevel in the subvolumes Ωi

C = ΩiC1, . . . ,Ω

iCJ1 and at the microscopic level

in the subvolumes ΩiM = Ωi

M1, . . . ,ΩiMJ2, where Ω = Ωi

C ∪ΩiM for all i,

1≤ i≤ N.The system is now propagated with an operator splitting scheme. Choose

a time step ∆tsplit for the splitting. The first step is to freeze the microscopicpart of the system and propagate the mesoscopic part with NSM on unstruc-tured meshes for the full time step ∆tsplit. The second step is to freeze all the

29

Page 30: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

mesoscopic variables and propagate the microscopic variables according to thealgorithm outlined in Section 2 for the full time step. At the end of each timestep the state vector is updated by converting microscopic molecules that haveended up in a mesoscopic region to mesoscopic molecules, and vice versa.Note that during a time step all variables remain either mesoscopic or mi-croscopic, meaning that a mesoscopic molecule diffusing into a microscopicregion of space will not be treated as a microscopic variable until the nexttime step, and vice versa. Therefore we should choose the time step such thata molecule does not diffuse through several subvolumes during that time step,or the accuracy will suffer. On the other hand, if the time step is too smallrelative to the size of the subvolumes, the spatial distribution of moleculeswill be biased towards the mesoscopic regions of space. This can be realizedby imagining a microscopic molecule close to the mesoscopic region. If thetime step is really small, it may diffuse into the mesoscopic region, but it ishighly likely that it will still be close to the microscopic region. However, atthe next time step it will be treated as a mesoscopic molecule and is thereforeassumed to be uniformly distributed in the subvolume, and we get a shift inthe distribution.

In Paper VII we develop another hybrid method for coupling of a meso-scopic and a microscopic region, the ghost cell method (GCM), and comparethe error of the GCM to the error of the method outlined above. In the GCMmethod we only consider splitting of space, and not splitting of species, andtherefore, for simplicity, we study the problem of pure diffusion in a cube withside length 10−6 m and diffusion constant 10−12 m2/s.

The cube is first discretized with an unstructured mesh, and then dividedinto a microscopic region, which is defined to be all subvolumes left of x =5 · 107 m, and a mesoscopic region which is defined to be all remaining sub-volumes. We initialize the system by sampling 2 ·104 molecules uniformly onthe domain, and then propagate the system for 0.1s. As the initial condition isa uniform distribution, we expect the distribution to be uniform also at the endof the simulation. We compute the error E defined by

E =∑

10i=1 |Ni−N0/10|

N0, (4.1)

where N0 is the total number of molecules, and Ni, 1 ≤ i ≤ 10 is the numberof molecules with x-coordinate in the interval [(i− 1)/10 · 10−6, i/10 · 10−6]at the end of the simulation. Molecules that are in the mesoscopic regionare assigned to an interval by sampling a continuous position from a uniformdistribution on their respective subvolume. The error of the two methods arecompared in Figure 4.1. We find that the error of the GCM method decreaseswith decreasing time step, while the error of the method in Paper II increasesif the time step becomes too small, but that the error is smaller than that ofthe GCM method for time steps such that

√2D∆t ∼ h. Here h is defined to

be the cubic root of the average volume of a subvolume in the mesh. A good

30

Page 31: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

approach would therefore be to choose method based on the time step; forreally small time steps we would use the GCM method and for larger timesteps we would switch to the method in Paper II.

10−5

10−4

10−1

∆ t

E

25393 voxels

49101 voxels

72413 voxels

10−5

10−4

10−3

10−2

10−2

10−1

∆ t

E

CPM method

GCM method

h2/(2D)

Figure 4.1. On the left we have plotted the error E of the GCM method for differentresolutions of the mesh and different time steps. We see that the error decreases withthe time step. On the right we compare the error of the GCM method with the error ofthe method proposed in Paper II (referred to as the CPM method in the legend). Thevertical dashed line marks ∆t = h2/(2D).

4.2 Numerical examplesIn the first example we study a model of one layer of a mitogen-activatedprotein kinase (MAPK), first proposed in [52], and in the second examplewe simulate a model of translocation of molecules into the cell nucleus. TheMAPK system has microscale dynamics that can be captured with the hybridmethod by a splitting of species into a mesoscopic and a microscopic part,while the translocation model will be simulated by splitting the domain into amesoscopic and a microscopic part. These two examples were also studied inPaper II.

4.2.1 MAPK pathwayTo verify the accuracy and applicability of the method we first apply it to aproblem studied in [52]. They consider a model of a MAPK pathway

KK +Kk1k2

KK−Kk3→KK∗+Kp, KK +Kp

k4k5

KK−Kpk6→KK∗+Kpp,

(4.2)

P+Kppk1k2

P−Kppk3→P∗+Kp, P+Kp

k4k5

P−Kpk6→P∗+K, (4.3)

KK∗k7→KK, P∗

k7→P. (4.4)

31

Page 32: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

First, in (4.2), K is phosphorylated in two steps by the kinase KK to becomeKp and Kpp. In (4.3) K is dephosphorylated in two steps from Kpp by thephosphatase P. After dephosphorylation the enzymes are inactive, KK∗ andP∗, and are activated again through the reactions in (4.4). If k7 is large, theinactive enzymes KK∗ and P∗ are reactivated quickly, and the spatial corre-lations that exist for a short time after a dissociation become important. Theresponse time τres of the system is defined as the time until we have 50% ofthe steady state level of doubly phosphorylated substrate Kpp. The spatial cor-relations due to fast rebindings cannot be captured at the macroscopic scaleor the mesoscopic scale and the macroscopic behavior of this system is onlycaptured accurately at the microscopic level.

Since we know that the critical reactions are the dissociations of KK−Kand P−KK∗ with fast rebindings due to the quickly reactivated enzymes, itseems natural to split the system into a mesocopic part and a microscopic part,where the microscopic part consists of the species KK−K and P−KK∗ andwhere the mesoscopic part will be the rest of the system. Since microscopicmolecules are simulated as microscopic during a full time step, we would,with a correctly chosen time step, capture the dissociations and fast rebind-ings during that time step. The time step for the splitting scheme should thusbe chosen such that the molecules have enough time to get well-mixed in asubvolume during that time step. The results are shown in Figure 4.2. We findthat the hybrid method can attain an accuracy close to the accuracy obtainedwith purely microscopic simulations, but with a significant reduction of themolecules simulated at the microscopic level. Since the computational costscales almost with the square of the number of microscopic molecules, alsothe gain in computational time is significant even though the overhead of themethod can be up to 30% of the total computational cost.

0.01 0.1 1 102

4

6

8

10

12

14

16

D (µm2/s)

τre

s

Hybrid method

GFRD

Mean field

0.1 10

20

40

60

80

100

120

140

160

180

D (µm2/s)

Ave

rag

e n

um

be

r o

f m

ole

cu

les

Microscale

Mesoscale

Figure 4.2. To the left we compare τres computed with the hybrid method, with GFRDsimulations from [52] and the corresponding ODE model. The response time is sig-nificantly smaller at the microscopic level as compared to the ODE description. Withthe hybrid method we are able to accurately simulate the system, with a reduction ofthe average number of molecules simulated on the microscale, as shown to the right.

32

Page 33: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

4.2.2 Translocation into the cell nucleusIn Paper II we also considered a model of translocation of molecules from thecytoplasm to the nucleus of the cell. The full system is described in Table 4.1.

Reactions in the bulk

(1) /0µ1−→ A

(2) /0µ2−→ B

(3,4) A+Bk1k2

C

Reversible adsorption of C to the membrane

(5,6) Ckakd

Cm

Translocation of C into nucleus

(7,8) Cm +Pkpk−p

CmP

(9) CmP kr−→ P+Cn

Table 4.1. A and B undergo a reversible reaction in the cytosol, where the product C inturn can react with the membrane to form Cm. Cm-molecules diffuse on the membraneand can react with nuclear pores located on the membrane, and are then transportedinto the nucleus via the pore.

The interaction between the molecules and the membrane of the nucleusis not easily modeled at the mesoscopic level, while the reactions in the bulkdo not require a particularly fine-grained model. Therefore we consider apartitioning of space where we have a few layers of microscopic voxels aroundthe membrane of the nucleus while the rest of the domain is kept mesoscopic.The partitioning of space and the time evolution of the system are both plottedin Figure 4.3.

33

Page 34: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

0 50 100 150 2000

2

4

6

8

10

12

14

Time (s)

Ave

rage

num

ber

of m

olec

ules

BCC

m

PC

mP

Cn

Figure 4.3. The partitioned domain is plotted to the left, with red illustrating micro-scopic subvolumes and blue mesoscopic subvolumes. The green sphere is the nucleus.To the right we have plotted the time evolution of the system.

34

Page 35: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

5. Conclusions

In many biochemical reaction networks, key proteins are present in only afew copies, making the classical deterministic ODE model for the concentra-tions of the chemical species inadequate. Instead we have to consider discretestochastic models. In some cases it is sufficient to approximate the system witha fully spatially homogeneous model, but it is has also been demonstrated thatsome systems have dynamics that is only captured with spatially heteroge-neous models. Considering the complex structures present inside eukaryoticcells with reactive membranes and the cytoskeleton, we realize that the numer-ical study of these systems requires not only efficient and accurate algorithms,but they also need to be highly flexible and able to handle complex geometries.

The main focus of this thesis has been on adapting efficient algorithms onthe micro- and mesoscale to such complex settings. The GFRD and eGFRDalgorithms are efficient and accurate algorithms for simulating systems at themicroscopic level. One of the main steps of these algorithms is sampling ofnew positions for pairs of molecules, and we have simplified this step by em-ploying operator splitting, and solving a complex equation in two steps ratherthan one step. We have used this technique in both two and three dimensions,and by combining this method with approximation of embedded surfaces andlines with locally flat planes and straight line segments, we have been ableto extend the GFRD to the case of general lines and surfaces inside complexgeometries.

Although the efficiency of microscopic methods have been improved overthe last couple of years, it is still a problem that they become too slow whensystems become large. However, also large systems may have parts that havedynamics occurring at the microscopic scale. Unfortunately it is only possi-ble to increase the spatial accuracy of the mesoscopic methods to a certainlimit. We have derived a lower bound for the size of the subvolumes in twoand three dimensions, after which no reaction rates can make the microscopicand mesoscopic models agree. Another approach, instead of refining the meshat the mesoscopic level, is to simulate systems that require a high accuracywith hybrid methods. We have coupled the microscopic and mesoscopic lev-els by separating species and space into two different parts, one microscopicand one mesoscopic, and then used operator splitting to propagate the system.This method has been successfully applied to systems that previously had beendemonstrated to have spatial correlations at the microscopic level that affectedthe macroscopic behavior of the system.

In Paper V we developed an algorithm at the mesoscopic level for simu-lation of general lines embedded in three-dimensional space. The reaction

35

Page 36: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

between a molecule in space and a line is a two-dimensional process, andto be able to simulate these systems with consistency as the size of the sub-volumes shrink, we need correct two-dimensional mesoscopic reaction rates.We have derived such reaction rates, by matching the association times at themicroscopic level with association times at the mesoscopic level. We havedemonstrated the accuracy of this approach for several biologically realisticsystems.

36

Page 37: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

6. Summary in Swedish

Studiet av biokemiska nätverk i levande celler med hjälp av numeriska metoderär ett forskningsområde som växt snabbt de senaste årtiondena. Traditionellthar man främst använt sig av deterministiska modeller, t.ex. ordinära differ-entialekvationer, men då det nu visats att system där vissa makromolekylerendast finns tillgängliga i några få exemplar inte beskrivs väl av sådana mod-eller, har man också börjat intressera sig för stokastiska modeller.

Man brukar tala om två nivåer av stokastiska modeller: mesoskopiska ochmikroskopiska. I en mesoskopisk modell hoppar molekylerna mellan noderi ett nät och molekyler som befinner sig i samma nod reagerar med en givenintensitet. Mikroskopiska modeller avser modeller där enstaka partiklar följs irummet, och där reaktioner sker mellan partiklar som befinner sig nära varan-dra. Två stycken sådana modeller som studerats är Smoluchowskis modelloch Dois modell. I Smoluchowskis modell så antas partiklar vara hårda sfärer,som reagerar med en viss sannolikhet vid en kollision. I Dois modell reagerarmolekylerna med en viss intensitet när de befinner sig inom en given reaktion-sradie. En skillnad mellan modellerna är alltså att man i Dois modell inte tarhänsyn till den volym som exkluderas av partiklarna medan molekylerna haren faktisk fysisk utbredning i Smoluchowskis modell.

För simuleringar på den mesoskopiska nivån finns flera fritt tillgängligaprogramvarupaket: URDME, STEPS och MesoRD. URDME och STEPS görsimuleringar på ostrukturerade nät och MesoRD på strukturerade nät.

Även för simuleringar på den mikroskopiska nivån finns flera program-varor: eGFRD, Smoldyn, MCell och Spatiocyte. Alla dessa programvarorimplementerar algoritmer vars syfte är att approximera Smoluchowskis mod-ell. I Spatiocyte hoppar molekylerna på ett nät av tätt packade sfärer medanmolekylerna rör sig kontinuerligt i rummet i övriga programvaror. I MCell ochSmoldyn diskretiseras tiden med ett konstant tidssteg, medan man i eGFRDgenererar tiden till nästa reaktion för par av molekyler. Således är eGFRD ex-akt i teorin; i praktiken är det dock inte så då man måste ta hänsyn till ränderoch till fallet då fler än två molekyler kommer nära varandra.

Förutom molekyler som diffunderar fritt och reagerar, så är eukaryota cellerfyllda med interna strukturer; membran med komplicerad topologi och cy-toskelettet som består av fibrer till vilka molekyler binder för att sedan trans-porteras genom cellen via aktiv transport. Förutom att effektivt kunna simulerafria molekyler i tre dimensioner, är det alltså viktigt att kunna koppla dessasimuleringar till reaktioner med och på tvådimensionella och endimensionellastrukturer i cellen. En del av denna avhandling är fokuserad på att utveckla

37

Page 38: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

flexibla algoritmer som kan hantera även dessa komplicerade interna struk-turer som finns i celler, på ett noggrant sätt.

Trots att det nu finns effektiva metoder för simulering av system på mikro-nivån så är fortfarande metoderna på mesonivån signifikant snabbare, och storasystem kan vara svåra att simulera med mikroskopiska metoder. Vissa sys-tem kräver dock mikroskopiska modeller också för att den makroskopiska dy-namiken ska simuleras korrekt, men det är inte nödvändigtvis hela systemetsom kräver den mest finskaliga upplösningen. Om så är fallet kan man tänkasig att hybridmetoder, där man kopplar ihop flera skalor, kan vara ett effektivtsätt att studera dessa system.

Denna avhandlings bidrag är följande. I artikel I föreslår vi en algoritmsom gör det enklare att generera slumpmässiga händelser vid simulering påmikronivån, och i artikel III undersöker vi olika metoder för att göra det såeffektivt som möjligt. Simuleringar på mikronivån involverar ett steg då parav molekyler ska uppdateras. Att lösa Smoluchowskis ekvation för par avmolekyler kan visserligen göras analytiskt, men lösningen är komplicerad ochdyr att evaluera. I stället föreslår vi att man löser ekvationen i två steg viaen så kallad operatorsplitting, vilket resulterar i två ekvationer som var försig är betydligt enklare att lösa än den den fullständiga ekvationen. I två di-mensioner är det än mer komplicerat att finna en analytisk lösning än i tredimensioner, och vi visar hur vår algoritm kan tillämpas även på det fallet. Iartikel III jämför vi slumptalsgenerering direkt från det analytiska uttrycketför fördelningsfunktionen, med att tabulera fördelningen och att beräkna dennumeriskt.

I artikel IV diskuterar vi hur den mesoskopiska nivån relaterar till denmikroskopiska, och härleder mesoskopiska reaktionskonstanter i två och tredimensioner som gör att den mesoskopiska modellen stämmer överens medden mikroskopiska modellen ner till en undre gräns på nätstorleken. Vi visarockså var den undre gränsen finns, både i två dimensioner och tre dimensioner,samt att denna undre gräns är en absolut undre gräns och att det inte existerarnågot val av nätberoende reaktionskonstanter som kan få den mesoskopiskamodellen att överenstämma med den mikroskopiska modellen om den undregränsen passeras.

Artikel V behandlar en metod för att på den mesoskopiska nivån simulerasystem med inbäddade linjer, och artikel VI behandlar samma problem mennu för simuleringar på den mikroskopiska nivån. På den mesoskopiska nivånvisar vi hur man kan bädda in godtyckliga linjer i en tredimensionell volymdiskretiserad med ett Cartesiskt nät. Genom att använda reaktionskonstanternafrån artikel IV kan vi simulera reaktioner med godtyckliga linjer inbäddadei rummet. Vi simulerar även diffusion och reaktioner på linjerna. På denmikroskopiska nivån studerar vi liknande problem, men kan även hantera merkomplicerade yttre ränder, samt linjer vars geometri förändras över tiden.

I artikel II beskriver vi en algoritm för att koppla ihop mesoskopiska simu-leringar med mikroskopiska simuleringar i en hybridmetod. System som up-

38

Page 39: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

pvisar ett mikroskopiskt beteende som påverkar även det makroskopiska be-teendet kan delas upp i en mesoskopisk del och en mikroskopisk del, där en-dast de delar som kräver hög noggrannhet simuleras mikroskopiskt. Dels kanvi dela upp rummet i en mikroskopisk del och en mesoskopisk del, men vi kanäven separera molekylerna, så att vissa molekyler är mikroskopiska och andramesoskopiska. Vi visar att vi kan göra signifikanta vinster av beräkningstidgenom en sådan uppdelning av ett problem med skalseparation. I artikel VIIjämför vi noggrannheten hos flera hybridmetoder.

39

Page 40: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

7. Author’s contributions

Paper IThe method was developed in collaboration between the authors. I imple-mented the method and conducted the numerical experiments. I wrote Section4.3 and parts of the paper.

Paper IIThe hybrid method was developed in close collaboration between all authors.I implemented the hybrid method and designed the numerical experiments incollaboration with A. Hellander. The microscale solver was implemented byme. P. Lötstedt carried out the analysis in Section 5 of the paper.

Paper IIIThe research was designed by all authors in collaboration. I wrote parts of thepaper. Most of the implementations were done by M. H. Bani-Hashemian, butI did some work on optimizing the code.

Paper IVThe paper was written in collaboration between all authors. I carried out theanalysis in the section on the breakdown of the mesoscopic level, and derivedthe corrected mesoscopic reaction rates. A. Hellander did all the numericalexperiments.

Paper VThe research was designed by all authors in collaboration. S. Wang imple-mented the method. J. Elf suggested some of the numerical experiments. Iperformed simulations on the microscale for comparison with the mesoscopicsimulations.

40

Page 41: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

Paper VII am the sole author of this paper.

Paper VIIThe research was designed by all authors in collaboration. I implemented themethods in three dimensions on unstructured meshes and conducted all thenumerical experiments in Section 5.2. M. B. Flegg carried out the analysis ofthe GCM method.

41

Page 42: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

8. Acknowledgments

Per, thank you for all the encouragement and support. You have been an ex-cellent advisor.

Linda, I have really enjoyed visiting your research group at UCSB. Radek,thanks for the opportunity to visit you in Oxford. To all collaborators: I havetruly enjoyed working with you.

I would like to thank my family, and in particular my mother and father.You have always been a great support, and without you this thesis could nothave been written.

I also want to express my sincere gratitude to Katrina Quist, who helpedand inspired me during high school. Your support was important and muchappreciated.

To all my colleagues at TDB: Many thanks for all enjoyable and interestingdiscussions during "fika". I would like to thank Sven-Erik, Martin, Jens andSofia for being good friends.

42

Page 43: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

References

[1] D. F. Anderson. Incorporating postleap checks in tau-leaping. J. Chem. Phys.,128(5):054103, 2008.

[2] S. S. Andrews and D. Bray. Stochastic simulation of chemical reactions withspatial resolution and single molecule detail. Phys. Biol., 1:137–151, 2004.

[3] S. N. V. Arjunan and M. Tomita. A new multicompartmental reaction-diffusionmodeling method links transient membrane attachment of E. coli MinE toE-ring formation. Syst. Synth. Biol., 4:35–53, 2010.

[4] Y. Cao, D. T. Gillespie, and L. R. Petzold. Avoiding negative populations inexplicit poisson tau-leaping. J. Chem. Phys., 123(5):054104, 2005.

[5] Y. Cao, D. T. Gillespie, and L. R. Petzold. Efficient step size selection for thetau-leaping simulation method. J. Chem. Phys., 124(4):044109, 2006.

[6] Y. Cao, D. T. Gillespie, and L. R. Petzold. Adaptive explicit-implicit tau-leapingmethod with automatic tau selection. J. Chem. Phys., 126(22):224101, 2007.

[7] T. Carlsson, T. Ekholm, and C. Elvingson. Algorithm for generating a Brownianmotion on a sphere. J. Phys. A: Math. Theor., 43:505001, 2010.

[8] H. S. Carslaw and J. C. Jaeger. Conduction of Heat in Solids. Oxford UniversityPress, 1959.

[9] F. C. Collins and G. E. Kimball. Diffusion-controlled reaction rates. Journal ofColloid Science, 4(4):425–437, 1949.

[10] M. Doi. Second quantization representation for classical many-particle system.Journal of Physics A: Mathematical and General, 9(9):1465, 1976.

[11] M. Doi. Stochastic theory of diffusion-controlled reaction. Journal of PhysicsA: Mathematical and General, 9(9):1479, 1976.

[12] B. Drawert, S. Engblom, and A. Hellander. URDME: A modular framework forstochastic simulation of reaction-transport processes in complex geometries.BMC Syst. Biol., 76(6):1–17, 2012.

[13] B. Drawert, M. J. Lawson, L. Petzold, and M. Khammash. The diffusive finitestate projection algorithm for efficient simulation of the stochasticreaction-diffusion master equation. J. Chem. Phys., 132(7):074101, 2010.

[14] A. Edelstein and N. Agmon. Brownian dynamics simulations of reversiblereactions in one dimension. J. Chem. Phys., 99(7):5396–5404, 1993.

[15] J. Elf and M. Ehrenberg. Spontaneous separation of bi-stable biochemicalsystems into spatial domains of opposite phases. Syst. Biol., 1:230–236, 2004.

[16] M. B. Elowitz, A. J. Levine, E. D. Siggia, and P. S. Swain. Stochastic geneexpression in a single cell. Science, 297(5584):1183–1186, 2002.

[17] S. Engblom, L. Ferm, A. Hellander, and P. Lötstedt. Simulation of stochasticreaction-diffusion processes on unstructured meshes. SIAM J. Sci. Comput.,31:1774–1797, 2009.

[18] R. Erban and J. Chapman. Stochastic modelling of reaction–diffusionprocesses: algorithms for bimolecular reactions. Phys. Biol., 6(4):046001, 2009.

43

Page 44: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

[19] D. L. Ermak and J. A. McCammon. Brownian dynamics with hydrodynamicinteractions. J. Chem. Phys., 69(4):1352, 1978.

[20] D. Fange, O. G. Berg, P. Sjöberg, and J. Elf. Stochastic reaction-diffusionkinetics in the microscopic limit. Proc. Natl. Acad. Sci. USA,107(46):19820–19825, 2010.

[21] M. B. Flegg, S. J. Chapman, and R. Erban. The two-regime method foroptimizing stochastic reaction–diffusion simulations. J. R. Soc. Interface,9(70):859–868, 2012.

[22] C. W. Gardiner. Handbook of Stochastic Methods. Springer Series inSynergetics. Springer-Verlag, Berlin, 3rd edition, 2004.

[23] M. A. Gibson and J. Bruck. Efficient exact stochastic simulation of chemicalsystems with many species and many channels. J. Phys. Chem.,104:1876–1889, 2000.

[24] D. T. Gillespie. A general method for numerically simulating the stochastictime evolution of coupled chemical reactions. J. Comput. Phys., 22(4):403–434,1976.

[25] D. T. Gillespie. Approximate accelerated stochastic simulation of chemicallyreacting systems. J. Chem. Phys., 115:1716–1733, 2001.

[26] D. T. Gillespie. A diffusional bimolecular propensity function. The Journal ofChemical Physics, 131(16):164109, 2009.

[27] J. Hattne, D. Fange, and J. Elf. Stochastic reaction–diffusion simulation withMesoRD. Bioinformatics, 21(12):2923–2924, 2005.

[28] A. Hellander and P. Lötstedt. Incorporating active transport in mesoscopicreaction-transport models inside living cells. Multiscale Model. Simul.,5(8):1691–1714, 2010.

[29] S. Hellander, A. Hellander, and L. Petzold. Reaction-diffusion master equationin the microscopic limit. Phys. Rev. E., 85(4):042901, 2012.

[30] S. A. Isaacson. The reaction-diffusion master equation as an asymptoticapproximation of diffusion to a small target. SIAM J. Appl. Math., 70:77–111,2009.

[31] S. A. Isaacson. A convergent reaction-diffusion master equation. ArXive-prints, February 2013.

[32] S A. Isaacson and D. Isaacson. Reaction-diffusion master equation,diffusion-limited reactions, and singular potentials. Phys. Rev. E, 80:066106,Dec 2009.

[33] N. G. van Kampen. Stochastic Processes in Physics and Chemistry. Elsevier,Amsterdam, 5th edition, 2004.

[34] R. A. Kerr, T. M. Bartol, B. Kaminsky, M. Dittrich, J.-C. Jack Chang, S. B.Baden, T. J. Sejnowski, and J. R. Stiles. Fast Monte Carlo simulation methodsfor biological reaction-diffusion systems in solution and on surfaces. SIAM J.Sci. Comput., 30(6):3126–3149, 2008.

[35] H. Kim and K. J. Shin. Exact solution of the reversible diffusion-influencedreaction for an isolated pair in three dimensions. Phys. Rev. Lett.,82(7):1578–1581, 1999.

[36] H. Kim, M. Yang, and K. J. Shin. Dynamic correlation effect in reversiblediffusion-influenced reactions: Brownian dynamics simulation in threedimensions. J. Chem. Phys., 111(3):1068–1075, 1999.

44

Page 45: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

[37] M. Klann, A. Ganguly, and H. Koeppl. Hybrid spatial Gillespie and particletracking simulation. Bioinformatics, 28(19):i549–i555, 2012.

[38] G. I. Marchuk. Splitting and alternating direction methods. In P. G. Ciarlet andJ. L. Lions, editors, Handbook of Numerical Analysis, pages 197–462,Amsterdam, 1990. North-Holland.

[39] A. J. Mauro, J. K. Sigurdsson, J. Shrake, P. J. Atzberger, and S. A. Isaacson. AFirst-Passage Kinetic Monte Carlo Method for Reaction-Drift-DiffusionProcesses. ArXiv e-prints, February 2013.

[40] H. H. McAdams and A. Arkin. It’s a noisy business. Genetic regulation at thenanomolar scale. Trends Gen., 15:65–69, 1999.

[41] T. Mitchison and M. Kirschner. Dynamic instability of microtubule growth.Nature, 312(5991):237–242, 1984.

[42] E. W. Montroll. Random walks on lattices III: Calculation of first-passage timeswith application to exciton trapping on photosynthetic units. J. Math. Phys.,10(4):753–765, 1968.

[43] E. W. Montroll and George H. Weiss. Random walks on lattices. II. J. Math.Phys., 6(2):167–181, 1965.

[44] A. Mugler, A. G. Bailey, K. Takahashi, and Pieter Rein ten Wolde. Membraneclustering and the role of rebinding in biochemical signaling. Biophys. J.,102(5):1069–1078, 2012.

[45] B. Munsky and M. Khammash. The finite state projection algorithm for thesolution of the chemical master equation. J. Chem. Phys., 124(3):044104, 2006.

[46] S. H. Northrup, S. A. Allison, and J. A. McCammon. Brownian dynamicssimulation of diffusion-influenced bimolecular reactions. J. Chem. Phys.,80:1517–1524, 1984.

[47] T. Opplestrup, V. V. Bulatov, G. H. Gilmer, M. H. Kalos, and B. Sadigh.First-passage Monte Carlo algorithm: diffusion without all the hops.Phys. Rev. Lett., 97:230602, 2006.

[48] A. V. Popov and N. Agmon. Three-dimensional simulations of reversiblebimolecular reactions: The simple target problem. J. Chem. Phys.,115(19):8921–8932, Nov. 2001.

[49] K. R. Sanft, S. Wu, M. Roh, J. Fu, R. K. Lim, and L. R. Petzold. StochKit2:software for discrete stochastic simulation of biochemical systems with events.Bioinformatics, 27(17):2457–2458, 2011.

[50] M. v. Smoluchowski. Versuch einer mathematischen Theorie derKoagulationskinetik kolloider Lösungen. Z. phys. Chemie, 92:129–168, 1917.

[51] G. Strang. On the construction and comparison of difference schemes. SIAMJ. Numer. Anal., 5:506–517, 1968.

[52] K. Takahashi, S. Tanase-Nicola, and P. R. ten Wolde. Spatio-temporalcorrelations can drastically change the response of a MAPK pathway. Proc.Natl. Acad. Sci. USA., 107(6):2473–2478, 2010.

[53] M. Tomita, K. Hashimoto, K. Takahashi, T. S. Shimizu, Y. Matsuzaki,F. Miyoshi, K. Saito, S. Tanida, K. Yugi, J. C. Venter, and C. A. Hutchison 3rd.E-cell: software environment for whole-cell simulation. Bioinformatics,15(1):72–84, 1999.

[54] V. Tulovsky and L. Papiez. Formula for the fundamental solution of the heatequation on the sphere. Appl. Math. Lett, 14:881–884, 2001.

45

Page 46: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

[55] S. Wils and E. De Schutter. STEPS: modeling and simulating complexreaction-diffusion systems with Python. Front. Neuroinf., 3:15, 2009.

[56] K. Yosida. Brownian motion on the surface of the 3-sphere. Ann. Math.Statistics, 20:292–296, 1949.

[57] J. S. van Zon and P. R. ten Wolde. Green’s-function reaction dynamics: Aparticle-based approach for simulating biochemical networks in time and space.J. Chem. Phys., 123:234910, 2005.

[58] J. S. van Zon and P. R. ten Wolde. Simulating biochemical networks at theparticle level and in time and space: Green’s-function reaction dynamics.Phys. Rev. Lett., 94:128103, 2005.

46

Page 47: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9
Page 48: Stochastic Simulation of Reaction-Diffusion Processesuu.diva-portal.org/smash/get/diva2:616667/FULLTEXT01.pdfReaction-Diffusion Processes STEFAN HELLANDER ISSN 1651-6214 ISBN 978-91-554-8667-9

Acta Universitatis UpsaliensisDigital Comprehensive Summaries of Uppsala Dissertationsfrom the Faculty of Science and Technology 1042

Editor: The Dean of the Faculty of Science and Technology

A doctoral dissertation from the Faculty of Science andTechnology, Uppsala University, is usually a summary of anumber of papers. A few copies of the complete dissertationare kept at major Swedish research libraries, while thesummary alone is distributed internationally throughthe series Digital Comprehensive Summaries of UppsalaDissertations from the Faculty of Science and Technology.

Distribution: publications.uu.seurn:nbn:se:uu:diva-198522

ACTAUNIVERSITATIS

UPSALIENSISUPPSALA

2013