45
UPTEC F 11014 Examensarbete 30 hp Februari 2011 Accuracy aspects of the reaction- diffusion master equation on unstructured meshes Emil Kieri

Accuracy aspects of the reaction- diffusion master ...397279/FULLTEXT01.pdf · The reaction-diffusion master equation (RDME) is a stochastic model for spatially heterogeneous chemical

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

  • UPTEC F 11014

    Examensarbete 30 hpFebruari 2011

    Accuracy aspects of the reaction- diffusion master equation on unstructured meshes

    Emil Kieri

  • Teknisk- naturvetenskaplig fakultet UTH-enheten Besöksadress: Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0 Postadress: Box 536 751 21 Uppsala Telefon: 018 – 471 30 03 Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student

    Abstract

    Accuracy aspects of the reaction-diffusion masterequation on unstructured meshes

    Emil Kieri

    The reaction-diffusion master equation (RDME) is a stochastic model for spatiallyheterogeneous chemical systems. Stochastic models have proved to be useful forproblems from molecular biology since copy numbers of participating chemicalspecies often are small, which gives a stochastic behaviour. The RDME is a discretespace model, in contrast to spatially continuous models based on Brownian motion. Inthis thesis two accuracy issues of the RDME on unstructured meshes are studied. Thefirst concerns the rates of diffusion events. Errors due to previously used rates areevaluated, and a second order accurate finite volume method, not previously used inthis context, is implemented. The new discretisation improves the accuracyconsiderably, but unfortunately it puts constraints on the mesh, limiting its currentusability. The second issue concerns the rates of bimolecular reactions. Using themacroscopic reaction coefficients these rates become too low when the spatialresolution is high. Recently, two methods to overcome this problem by calculatingmesoscopic reaction rates for Cartesian meshes have been proposed. The methodsare compared and evaluated, and are found to work remarkably well. Their possibleextension to unstructured meshes is discussed.

    ISSN: 1401-5757, UPTEC F 11014Examinator: Tomas NybergÄmnesgranskare: Per LötstedtHandledare: Andreas Hellander

  • Contents

    1 Introduction 21.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 The reaction-diffusion master equation . . . . . . . . . . . . . . . 4

    2 Diffusion coefficients 62.1 Finite element derivation . . . . . . . . . . . . . . . . . . . . . . 82.2 Finite volume method on Voronöı meshes . . . . . . . . . . . . . 102.3 Convergence study . . . . . . . . . . . . . . . . . . . . . . . . . . 132.4 First exit time from a sphere . . . . . . . . . . . . . . . . . . . . 172.5 Moments of the diffusive part of the RDME . . . . . . . . . . . . 19

    3 Propensities for bimolecular reactions 203.1 Corrections to reaction rates . . . . . . . . . . . . . . . . . . . . . 213.2 Propensities for reversible reactions . . . . . . . . . . . . . . . . . 243.3 Incorporating spatial dependence . . . . . . . . . . . . . . . . . . 26

    4 The effects combined 28

    5 Discussion and conclusions 31

    A Proof of theorems 3 and 4 35

    B List of abbreviations 41

    1

  • 1 Introduction

    1.1 Background

    To be able to predict the outcome of chemical processes has long been in theinterest of science and industry. Several models, and associated computationaltools, have been proposed for the simulation of such processes. These modelsspan from the Schrödinger equation and Newton’s equations of motion on thenano scale, to the reaction rate equations (RRE) which model the macroscopicbehaviour of a chemical process. In fields like medicine and biotechnology, chem-ical processes inside living cells are of interest. In this thesis, we will consider thedynamics of such cellular reaction networks involving macromolecules, workingon time scales of seconds or minutes. The computational study of such pro-cesses poses several difficulties. Because of the long time scales, nano modelsare obviously intractable. Molecular dynamics simulations rarely exceed thescale of microseconds. The RRE could be applied, but fail to give an accuratedescription of many biochemical systems. This is because the RRE rely on twoassumptions which in our problems often do not hold.

    The RRE are a system of ordinary differential equations (ODEs) for the con-centrations of the involved molecular species. They assume high copy numbersof the involved molecular species and spatial homogeneity. The first is neces-sary for the applicability of an ODE model, concentration must be treated asa continuous variable. If the copy number gets too low concentration will bediscretised. The second is a modelling choice, the RRE have no spatial depen-dence. It is however possible to formulate partial differential equations (PDEs)which form a spatially dependent extension of the RRE. This will increase thedimensionality of the problem, making its solution more expensive.

    Both of the above stated assumptions are often violated in the chemicalprocesses of living cells. Reactions may be localised, e.g. to membranes or or-ganelles, introducing spatial dependence. Some of the chemically active molec-ular species may appear in very small numbers. This leads to a break-down ofthe RRE. Firstly concentration is no longer a continuous quantity, adding a sin-gle molecule changes it considerably. This makes it troublesome to differentiate.Secondly the rate of reactions will no longer be well-defined. It can at best be anaverage rate. When only a few substrate molecules diffuse in the cell collisions,and thus also reactions, will be random events. This introduces stochastic noisein the system. In [36] Vilar et al. give an example of a cellular reaction networkwhere this stochastic noise leads to a radically different behaviour than what ispredicted by the RRE.

    It is widely acknowledged that for low concentrations, which frequently occurin cellular reaction networks, stochastic models are necessary. Today two classesof models dominate the field. The first class consists of micro scale models basedon Brownian motion [37, 23], where each molecule is tracked individually in arandom walk in continuous space. Brownian motion is more accurate, but alsomore computationally expensive, than the second class of models which we willfocus on. These methods operate on the so-called meso scale, and are basedon the reaction-diffusion master equation (RDME). We will here make a quickreview of their history and basic properties.

    First consider the well-stirred case, i.e. a biochemical system with no spatialdependence. Let the state of the system be the copy numbers of the involved

    2

  • molecular species. Let the chemical reactions be instantaneous events, and as-sume that the times until the next occurrence of each reaction are exponentiallydistributed random variables. Each probability distribution function (PDF)should only depend on the current state, not on the history, i.e. the systemshould have the Markov property. The system is then modelled as a Markovprocess. As a consequence, the time evolution of the probability for the systemto be in each of its states is given by a master equation [25], which is a systemof ODEs. For well-stirred systems the equation is known as the chemical mas-ter equation (CME). The dimensionality of the CME is the number of possiblestates, which easily becomes very high. If there exist no upper bound on thecopy number of one of the involved species the CME will be infinite-dimensional.Solving the CME directly is therefore most often intractable or even impossi-ble. The Gillespie method [20], commonly known as the stochastic simulationalgorithm, is a Monte Carlo method for calculating realisations, or trajectories,of the Markov process. The next reaction method (NRM) due to Gibson andBruck [19] is an efficient implementation of the Gillespie method for systemswith many reaction channels.

    For the spatially dependent case the computational domain, typically a cell,is divided into non-overlapping subvolumes. The subvolumes should be smallenough to resolve spatial gradients in the system, but much bigger than anysingle molecule. Each subvolume is then treated as well stirred. Chemicalreactions may occur between molecules residing in the same subvolume, andmolecules may diffuse to neighbouring subvolumes. The state of the system isthe copy number of each molecular species in each subvolume. The Markovproperty is still assumed, and the diffusion events are modelled just as the reac-tions. The model of the system is then a continuous time discrete space Markovchain (CTMC), and its time evolution is governed by the RDME. Stochasticsimulation based on sampling the RDME is becoming a popular tool in molec-ular systems biology. Several software packages have been proposed during thelast few years [9, 21, 29], and a range of applications in cell biology have beenpresented [1, 15, 33].

    An efficient method for sampling trajectories consistent with the RDME isthe next subvolume method (NSM) by Elf and Ehrenberg [10], which is a gen-eralisation of the NRM to the spatially dependent case. The software URDME[9] is an implementation of NSM on unstructured meshes. In URDME, thepropensities for diffusive jumps are determined by a finite element discretisa-tion of the Laplace operator. The derivation is summarised in Section 2.1 anddescribed in detail in [11]. The motivation for using unstructured meshes isthe ability of handling complex geometries. This is of special importance inmolecular biology, since molecules often bind to, dissociate from and diffusealong membranes. If Cartesian meshes are used a curved membrane cannot befollowed accurately, making especially diffusion along it inaccurate. A prob-lem with the methodology used on unstructured meshes is that some diffusionpropensities may come out negative if there exist obtuse dihedral angles in themesh. This can of course not be accepted, as a remedy the negative propensitiesare truncated to zero. The truncation unfortunately makes the diffusive partof the RDME inconsistent with Laplace diffusion. In this thesis, the impact ofthis inconsistency is studied, and an alternative, more accurate discretisationis proposed. This alternative approach is second order accurate in space, butits usefulness in practice is severely limited due to constraints imposed on the

    3

  • meshes. It requires meshes with the Delaunay property, which is hard to achievein three dimensions. Delaunay meshes in three dimensions would be much ben-eficial not only here, but also to the PDE community. Their construction is anactive area of research.

    Another accuracy issue studied concerns the reactions. Typically the macro-scopic reaction rates are used also in meso scale models. It has recently beensuggested that this may be inaccurate. This is because reactions between twomolecules being in different subvolumes, but close to their common boundary,are not accounted for. It was shown by Isaacson in [24] that in the limit ofinfinitesimally small subvolumes bimolecular reactions never occur. In [12], Er-ban and Chapman illustrate with a simple example how this leads to inaccuratesimulations also before the subvolumes get excessively small. They derive acorrection to the reaction coefficient in the special case of cubic subvolumes.Fange et al. propose a different correction in [14], both to the propensities ofbimolecular reactions, and also to dissociative reactions allowing an accuratedescription of reversible reactions. Their approach includes allowing moleculesin neighbouring subvolumes to react. In this thesis, the two approaches to smallsubvolumes are compared and tested on a selection of model problems. The er-ror originating from the handling of bimolecular reactions in small subvolumesis also compared to the error from the diffusion modelling in an illustrativeexample. Both effects turned out to be moderate compared to errors in therepresentation of the geometry. The error in the diffusion was notable whenspatial gradients were big, and error in the reaction rate when the associationrate was high.

    1.2 The reaction-diffusion master equation

    A chemical system with N molecular species and R chemical reactions is stud-ied. The system is confined to a domain Ω ⊂ Rd, d = 2, 3. The moleculesdiffuse in the domain, and may engage in reactions when they are sufficientlyclose to each other. The domain Ω is divided into non-overlapping subvolumesCj , j = 1, . . . ,K, completely covering Ω. In our mesoscopic model of the systemthe molecules are not tracked individually. We only keep track of how manymolecules of each species are present in each subvolume. The state of the sys-tem is then represented by the N ×K-matrix x, where xij is the copy numberof species i in subvolume Cj . Transition between the states is event-driven.There are two different kinds of events: diffusion events and reaction events. Amolecule may diffuse by jumping to a neighbouring subvolume. For a reactionto be possible the substrates of the reaction need to be present in the samesubvolume. Despite the qualitative difference between the two event types theycan be modelled in the same way: as an instantaneous transition from one stateto another. The system is stochastic, and assumed to have the Markov property[25, Ch. IV]. The time until the next event is assumed to be random and ex-ponentially distributed, depending only on x. This makes the model a CTMC.The time evolution of p(x, t), the probability of the system being in state x attime t, is then governed by the RDME.

    A reaction can be defined by a stoichiometry vector and a propensity func-tion. The stoichiometry vector is the nominal difference in state, and the propen-sity is the probability per unit time that the reaction will occur. Let the columnsof theN×R-matrix n be the stoichiometry vectors of the reactions, and wrj(x · j)

    4

  • be the propensity for reaction r in subvolume Cj given the state x. Then, thereaction r in subvolume Cj is defined by

    x · jwrj(x · j)−−−−−−→ x · j + n · r. (1)

    Let Xij denote a molecule of species i in subvolume Cj . We can then exemplifywith the reaction r in Cj ,

    Xij +Xkj → Xlj , (2)

    where the stoichiometry vector n · r has nlr = 1, nir = nkr = −1 and all otherelements equal to zero. A diffusion event can also be written as a reaction. Theevent of one molecule of species i diffusing from Cj to Ck is defined by

    Xijv(i)jk (xij)−−−−−→ Xik. (3)

    The propensity is proportional to the copy number of species i in Cj , v(i)jk (xij) =q

    (i)jk xij , where q

    (i)jk is constant. Naturally, q

    (i)jk is non-zero only if Cj and Ck are

    neighbours, and the stoichiometry vector for this event is -1 in element j, 1 inelement k, and zero in all other elements. Modelling reactions and diffusion thisway gives us the master operatorsM and D, so that the RDME takes the form

    ∂p(x, t)

    ∂t=Mp(x, t) +Dp(x, t), (4)

    p(x, 0) = δxx0 ,

    whereM governs the reactions, D the diffusion, and δxy is the Kronecker delta.Let m

    (i)jk be the stoichiometry vector for the diffusion event (3). The master

    operators are then defined by

    Mp(x, t) =R∑r=1

    K∑j=1︸ ︷︷ ︸

    x · j−n · r≥0

    wrj(x · j − n · r)p(x · 1, . . . ,x · j − n · r, . . . ,x ·K , t)

    −R∑r=1

    K∑j=1︸ ︷︷ ︸

    x · j+n · r≥0

    wrj(x · j)p(x, t), (5)

    and

    Dp(x, t) =N∑i=1

    K∑j=1

    K∑k=1︸ ︷︷ ︸

    xi ·−m(i)jk≥0

    q(i)jk (xi · −m

    (i)jk )jp(x1 · , . . . ,xi · −m

    (i)jk , . . . ,xN · , t)

    −N∑i=1

    K∑j=1

    K∑k=1

    q(i)kj xikp(x, t). (6)

    The first sums sum over the events that will cause the system to enter state x,and the second sums sum over the events that will cause the system to leave

    5

  • state x. The master equation (5) can be written on W-matrix form as

    ∂p(x, t)

    ∂t= Wp(x, t), (7)

    where the matrix W has two important properties [25, Ch.V.2]:

    Wjk ≥ 0, j 6= k, (8)∑j

    Wjk = 0, ∀k. (9)

    The property (8) guarantees the transition propensities to be non-negative, and(9) states that the probability mass stays constant in the system.

    2 Diffusion coefficients

    In this section we will consider how to calculate the propensities for diffusivejumps, i.e. the coefficients qjk in the RDME. In the modelling framework of theRDME, qjk is the expected rate of diffusive jumps from Cj to Ck for a singlemolecule in Cj . (

    ∑k qjk)

    −1is the expected first exit time of a Brownian particle

    in Cj . It is unfortunately difficult to calculate the first exit time of a Brownianparticle in a general polyhedron. We will instead approach the problem fromthe other direction, using the macroscopic diffusion equation. The diffusivepart of the RDME for each of the molecular species approaches the diffusionequation when the copy number of the species grows. Since all molecules diffuseindependently we can study each molecular species separately. The diffusionequation is given by

    φ̇ = γ∆φ, r ∈ Ω, t > 0,n · ∇φ = 0, r ∈ ∂Ω, t > 0, (10)φ(r, 0) = φ0(r), r ∈ Ω,

    where φ(r, t) is the local concentration of the molecular species and n the out-ward unit normal of the computational domain Ω. A no-flux boundary conditionis a natural choice in most cases, especially when macromolecules are studiedsince they rarely diffuse across membranes. If membranes are crossed it is typ-ically by active transport rather than diffusion. Approximations of the jumpcoefficients can be calculated using techniques for the numerical solution of par-tial differential equations (PDEs). The subvolumes Cj are constructed to suitthe discretisation technique used.

    The diffusion equation (10) is semi-discretised using the method of lines, i.e.it is discretised in space to a system of linear ODEs,

    φ̇ = Dφ, t > 0, (11)

    φ(0) = φ0.

    The mesoscopic diffusion jump propensities are then picked directly from thematrix D, qjk = Djk, j 6= k. qjj are chosen to be zero since a particle diffusingto the same subvolume does not change the state of the system. DT is supposedto have the properties (8) and (9) of the W-matrix, but note that DT is not the

    6

  • W-matrix itself, except for the special case of one diffusing molecule. D is anNK ×NK-matrix, while W reflects the dimensionality of the RDME which ismuch higher, possibly infinite. These properties are necessary for our stochasticinterpretation. Condition (8) guarantees the first exit time from all subvolumesto be non-negative, and (9) preserves the number of molecules in the domainunder diffusion. They also form a sufficient condition for fulfilling a discretemaximum principle (DMP). The diffusion equation obeys a maximum principlewhich can be stated as follows.

    Theorem 1. Assume that φ(r, t) is a solution to (10) and t1 > t0 ≥ 0. Then

    φ(r, t1) ≤ supr̃∈Ω

    φ(r̃, t0) ∀r ∈ Ω. (12)

    Maximum principles are well-known properties of parabolic PDEs that canbe understood intuitively. Homogeneous Neumann boundary conditions areinsulative which implies that mass is preserved, i.e.

    ∫Ωφ dx remains constant

    over time. The Laplace operator smoothes things out, so that new local maximacannot form and existing local maxima cannot grow. Thus, the maximum ofthe solution will be at the initial condition. For a rigorous proof, consult e.g.[13]. The discrete version of the theorem is completely analogous.

    Theorem 2. Assume that φ(t) is a solution to (11), and t1 > t0 ≥ 0. If thediffusion matrix D has the properties Djk ≥ 0, j 6= k and

    ∑Kk=1Djk = 0, j =

    1, ...,K, thenφi(t1) ≤ sup

    j=1,...,Kφj(t0), i = 1, . . . ,K. (13)

    Proof. The time derivative of the function value at a given mesh node rj is

    φ̇j =∑k

    Djkφk. (14)

    Since all rows of D sum to zero we can write

    φ̇j =∑k 6=j

    Djkφk −∑k 6=j

    Djkφj . (15)

    Assume that φj is a possibly degenerate global maximum at time t, i.e. φj ≥φk, k = 1, . . . ,K. Then

    φ̇j ≤∑k 6=j

    Djkφj −∑k 6=j

    Djkφj , (16)

    φ̇j ≤ 0. (17)

    If the maximum cannot grow, we cannot get a bigger maximum than at earliertimes.

    Perhaps the easiest way of discretisation is to use a finite difference methodon a Cartesian partition. This is the approach used by Elf and Ehrenberg in[10]. This method has several advantages: it is accurate, efficient and relativelyeasy to implement and analyse. However, it does provide problems when itcomes to boundary treatment. Biological cells typically have curved boundarieswhich are difficult to represent with Cartesian meshes, and it becomes difficult

    7

  • to accurately implement the homogeneous Neumann boundary condition. Ad-ditionally, a lot of interesting biology happens on the membranes. Proteins maybind to, and diffuse on, the membrane. This diffusion on a curved surface isespecially troublesome to simulate when Cartesian meshes are used.

    In this section we will present and analyse two other methods where un-structured meshes are used. This makes boundary treatment easier, but as wewill see, unstructured meshes comes with a few other difficulties.

    2.1 Finite element derivation

    In [11], Engblom et al. discretise (10) using the finite element method (FEM).A primal mesh of triangles in 2D or tetrahedra in 3D is constructed. A dualmesh is in 2D constructed by connecting the midpoints of the triangles withthe midpoints of the edges, as in Figure 1. The subvolumes Cj are taken tobe the dual cells around each primal mesh point rj . In 3D the dual meshis constructed similarly, the dual cell boundaries are made of planar surfacesconnecting the midpoint of a tetrahedron with the midpoint of one of its edgesand two of its faces. Note that the dual mesh is not constructed explicitly, itjust gives the definition of the subvolumes. A space Vh of continuous functions

    Figure 1: A part of an unstructured triangular mesh. The solid lines denote the primalmesh, and the dashed lines the dual mesh. rj is a node, and n

    kj is the unit normal of

    the dual cell Cj towards Ck. Meshing in 3D is analogous.

    which are linear in each of the triangles or tetrahedra is introduced. Basisfunctions ϕi are constructed such that Vh = span({ϕi}Ki=1), ϕi(rj) = δij . TheFEM approximation of the weak form of (10) is then

    For each t > 0, find φ ∈ Vh such that∫Ω

    φ̇ϕi dx = −γ∫∂Ω

    ∇φ · ∇ϕi dx, i = 1, . . . ,K. (18)

    If φ is expressed as a linear combination of the basis functions ϕj we obtain asystem of linear ODEs, which can be written on matrix form as

    M φ̇ = γSφ, (19)

    where φ is the nodal values of φ, M the mass matrix and S the stiffness matrix.For the details of FEM discretisations, consult e.g. [3]. The lumped mass matrix

    A has the row sums of M on its diagonal, Ajj =∑Nk=1Mjk, Ajk = 0, j 6= k.

    8

  • Replacing M with A is a second-order approximation, and Ajj = |Cj |, where| · | is the Lebesgue measure. Doing so gives us the equation

    φ̇ = Dφ, D = γA−1S. (20)

    It can be concluded that DT fulfils the property (9):

    K∑k=1

    Djk = γA−1jj

    K∑k=1

    Sjk

    = −γA−1jjK∑k=1

    ∫Ω

    ∇ϕj · ∇ϕk dx

    = −γA−1jj∫

    ∇ϕj · ∇

    (K∑k=1

    ϕk

    )dx

    = −γA−1jj∫

    ∇ϕj · ∇(1) dx = 0.

    Unfortunately DT does not in general fulfil the property (8). If the angle

    Figure 2: A primal mesh element with an obtuse angle. This element will give anegative contribution to Sij since ∇ϕi ·∇ϕj > 0. Contributions to Sik and Sjk willbe positive.

    between two edges in a triangle or two faces in a tetrahedron is no bigger thanπ2 everywhere in the primal mesh, the property is fulfilled. But if there existobtuse angles, off-diagonal elements in the stiffness matrix may become negative.This is illustrated in Figure 2. On the triangle∇ϕi · ∇ϕj > 0, so the triangle willgive a negative contribution to Sij . If all angles are acute this cannot happen.Since it is necessary to fulfil (8) for a stochastic interpretation of the stiffnessmatrix, any negative off-diagonal element is zeroed out, and the diagonal iscorrected so that the rows still sum to zero. This truncated stiffness matrix isdenoted by S̃. The truncation makes the discretisation fulfil the properties (8)and (9), but also makes it inconsistent. Mesh refinements will therefore not givearbitrarily good accuracy, but the matrix does represent some kind of diffusion.If all elements are of the right sign, for which non-obtusity of all angles is a

    9

  • sufficient condition, the truncation is unnecessary and the method second orderaccurate.

    In 2D it is often possible to create triangulations without obtuse angles.Then this approach is an attractive one. But in 3D this proves to be difficult.There exists, to our knowledge, no mesh generator that can achieve this forgeneral geometries. In a simulation with URDME, the mesh is usually gener-ated with COMSOL Multiphysics [7]. In a typical 3D mesh from COMSOLaround 20 % of the non-zero off-diagonal elements of the stiffness matrix turnout negative. In such a mesh the discrete maximum principle is in general notsatisfied. The negative off-diagonal elements are typically smaller in modulusthan the positive ones. Denote the truncated diffusion matrix D̃ = D + D�,and introduce the weighted Frobenius norm ‖D‖F =

    ∑i,j |Ci|D2ij . Then the

    norm of the correction, ‖D�‖F is typically five to ten percent of the norm of theconsistent diffusion matrix, ‖D‖F . The impact of this inconsistency is studiedin Section 2.3.

    2.2 Finite volume method on Voronöı meshes

    In this section we will discuss the applicability of a node-centred two-pointflux finite volume method (FVM) on Voronöı meshes to our class of problems.The method has been used for two-dimensional problems for several decades[5], while its extension to three dimensions has been analysed more recently[30, 35]. An advantage with FVM on Voronöı meshes is that it produces aconvergent discretisation fulfilling the DMP. A disadvantage with the methodis the constraints it puts on the mesh.

    For a given set of mesh nodes rj , j = 1, . . . ,K, the Voronöı cells Cj aredefined as Cj = {r ∈ Rd : |r− rj | < |r− rk| ∀k 6= j}, i.e. Cj is the set of pointsthat are closer to rj than to any of the other nodes. The Voronöı mesh is thedual of a Delaunay tessellation, see Figure 3. The vertices of the Voronöı meshare located at the centres of the circumscribed circles (spheres) of the Delaunaytriangles (tetrahedra). A Delaunay tessellation is defined as follows.

    Definition 1. A triangular (tetrahedral) mesh is a Delaunay tessellation if thecircumscribed circle (sphere) of each element does not contain any mesh nodesin its interior.

    Figure 3: A part of Delaunay mesh in 2D, and its dual Voronöı mesh (dashed).

    Details about Delaunay and Voronöı meshes and their properties can befound in e.g. [17]. A Delaunay tessellation and a Voronöı mesh can be con-

    10

  • structed from any set of points. There is e.g. a method in MATLAB for com-puting the Delaunay tessellation of a point set in arbitrary dimensions, usingthe Quickhull algorithm [2]. Unfortunately, not all point sets are suitable forDelaunay meshes. In particular, there is no guarantee of boundary conformity,and elements may be badly shaped. The condition of boundary conformity isthat we want the boundary of the tessellation to accurately represent the an-alytic boundary ∂Ω. Each line segment in 2D, or triangular face in 3D, whichare on the boundary of the tessellation should have its nodes on ∂Ω. Amongthe badly shaped elements, an element type called slivers are especially difficultto avoid. A sliver is a tetrahedron whose nodes are placed near the equatorof its circumsphere. It is thus flat and has a very small volume and dihedralangles, even though the radius to shortest edge ratio can be quite small. Suchtetrahedra give rise to high local truncation error, and are therefore not desired.Mesh generators using Delaunay-based algorithms typically give the eliminationof slivers higher priority than the Delaunay property itself. They generate a De-launay mesh, and then eliminate the slivers by non-Delaunay edge swaps or byperturbing points. The generation of sliver-free boundary conforming Delaunaymeshes is an active area of research. Promising algorithms have been published,e.g. [6], but few have been implemented. There exists to our knowledge no pub-lic domain implementation of a quality tetrahedral Delaunay mesh generatorbeyond proof of concept level.

    The Delaunay meshes used for this thesis were generated with the opensource mesh generator Gmsh [18]. Unfortunately Gmsh only seems to be ableto produce Delaunay meshes for very simple geometries, and even then it doesnot succeed every time.

    Apart from the meshing, the method is just like the standard node-centredFVM. The first step in deriving the method is to integrate the diffusion equation(10) over the subvolumes Cj ,∫

    Cjφ̇dx = γ

    ∫Cj

    ∆φdx. (21)

    Then by using Gauss’ divergence theorem we get

    ∂t

    ∫Cjφdx = γ

    ∫∂Cj

    n · ∇φdS, (22)

    which states that the rate of change for the amount of substance in each sub-volume is the flux over its boundary. Replacing the integrand in the left handside with its mean value on the subvolume φj , and splitting the integral in theright hand side to one integral for each boundary face, gives

    |Cj |φ̇j = γ∑k∈Nj

    ∫∂Ckj

    nkj · ∇φdS, (23)

    where Nj is the set of indices for cells neighbouring Cj , ∂Ckj is the commonboundary between Cj and Ck, and nkj is the unit normal of that boundary,pointing into Ck.

    nkj · ∇φ is approximated by the nodal values divided by the distance |ejk| =‖rk − rj‖ between the nodes, which yields

    |Cj |φ̇j ≈ γ∑k∈Nj

    ∫∂Ckj

    φk − φj|ejk|

    dS, (24)

    11

  • where the remaining integrals can be evaluated to

    |Cj |φ̇j ≈ γ∑k∈Nj

    |∂Ckj |φk − φj|ejk|

    . (25)

    Dividing with the cell volume gives the approximation of the time derivative,

    φ̇j = γ∑k∈Nj

    |∂Ckj ||Cj |

    φk − φj|ejk|

    , j = 1, . . . ,K. (26)

    This can be written in matrix notation as

    φ̇ = Dφ, D = γA−1Ŝ, (27)

    where A is analogous to the lumped mass matrix, Ajk = 0, j 6= k and Ajj = |Cj |,and Ŝ is analogous to the stiffness matrix, Ŝjk =

    |∂Ckj ||ejk| , j 6= k and Ŝjj =

    −∑k∈Nj

    |∂Ckj ||ejk| . D will then have the desired properties Djk ≥ 0, j 6= k and∑K

    k=1Djk = 0, j = 1, ...,K so that the DMP is fulfilled and we directly can dothe probabilistic interpretation qjk = Djk, j 6= k. Algorithms for assembling themass and stiffness matrices are presented in [34]. They do not, however, takeboundary effects into account, a topic which soon will be given attention.

    The usefulness of Voronöı meshes becomes apparent when we are to approx-imate the flux over the boundary in (23). Since the boundary segment ∂Ckjis orthogonal to the line connecting rj and rk, φj and φk are the only valuesneeded in order to make a consistent approximation of the flux. In spite ofthis, the method as a whole is inconsistent. This was shown by Sukumar in [35]using Taylor expansion. Even so, the method is supra-convergent [26], and wasproved to be second order accurate by Mishev in [30].

    The volumes of the Voronöı cells and the stiffness matrix are assembled bysuccessively adding contributions from each dual face, which each correspondto an edge of the Delaunay mesh. The face to edge relationship is one-to-one if one counts the zero-area faces that appear if two faces of a tetrahedronare perpendicular. We will here only consider the 3D case, the 2D case is oflesser importance and should be quite easy for the interested reader to work outherself. Consider the nodes rj and rk, where k ∈ Nj . To them we associate thedual face ∂Ckj , which is orthogonal to the line segment ejk connecting rj andrk, and lie in the same plane as the midpoint of the line segment. Moreover,∂Ckj is a convex polygon, and its vertices are the circumcentres of the tetrahedrathat have both rj and rk as nodes. The area of ∂Ckj is calculated by dividing itinto triangles. The corresponding coefficient in the stiffness matrix is given bythat area divided by the distance |ejk|. The dual cell Cj is a convex polyhedron,and can thus be seen as a union of pyramids with bases ∂Ckj and common topat rj . The contribution associated with the edge ejk can thus be calculatedas 16 |∂C

    kj ||ejk| using the formula for the volume of a pyramid. Since ∂Ckj is

    identical to ∂Cjk and situated at the midpoint of the line segment ejk, symmetrycan be exploited. This yields an algorithm for calculating the dual cell volumesand stiffness matrix in the interior of the domain. The boundary, however,requires some extra care. If calculated as in the interior, a dual face – andthus a subvolume – may extend out of the domain. It is also possible that a

    12

  • dual face does not reach the boundary as it should, so that parts of the domaindo not belong to any subvolume. The dual faces need thus be restricted tothe domain, and in some cases extended to the boundary. These two cases areillustrated in Figure 4. We need to apply these extra precautions if any node ofany tetrahedron incident to the edge ejk is on the boundary. Let the dual face∂Ckj be represented by its vertex set V. Let the tetrahedra incident to ejk bedenoted by T jk` , and the circumcentre of a triangle or tetrahedron by C( · ). Asystematic procedure for the construction of V is then sketched in Algorithm 1.

    (a) (b)

    Figure 4: The topmost faces of the tetrahedra in both figures are part of the boundary.We are constructing the dual face corresponding to the edge separating those twoboundary faces. When all tetrahedra incident to the edge have their circumcentres inthe domain, as in (a), the circumcentres of the boundary faces are vertices of the dualface. If the circumcentre of a tetrahedron is outside the domain as in (b), the dual facehas to be restricted to the domain. When two neighbouring boundary faces contain adual vertex the midpoint of their common edge is a vertex as well, as in both figures.

    2.3 Convergence study

    In this section the numerical behaviour of the discretisations for diffusion pre-sented in the previous sections is investigated. This is done by applying thediscretisations to the diffusion equation and integrating it deterministically us-ing the Crank-Nicolson method [8]. Stochastic sampling with NSM will convergeto this macroscopic numerical solution when copy numbers grow, as shownby Kurtz in [27]. Since the problem is linear, also the mean of many re-alisations will approach the macroscopic solution even if the copy number islow. Our model problem is the diffusion equation in a sphere, i.e. (10) withΩ = {(r, ϕ, θ) | 0 ≤ r ≤ r0, 0 ≤ ϕ ≤ 2π, 0 ≤ θ ≤ π}. The initial condi-tion is φ0 =

    12 +

    (sin(αr)α2r2 −

    cos(αr)αr

    )cos θ, and the diffusion coefficient γ = 0.1.

    r0 =3

    √3

    4π so that |Ω| = 1, and α ≈ 3.355 is chosen so that the boundarycondition is fulfilled. The analytical solution is then

    φ(r, t) =1

    2+ e−γα

    2t

    (sin(αr)

    α2r2− cos(αr)

    αr

    )cos θ. (28)

    The problem is discretised in space using the truncated FEM previouslyused in URDME, and using the Voronöı based FVM described above. It is thenintegrated one second using ten millisecond time steps. For FEM, the meshes

    13

  • Algorithm 1 Construct dual face ∂CkjV := ∪` C(T jk` )

    # Extend dual face up to the boundary.for ` do

    if C(T jk` ) ∈ Ω and ejk ∈ ∂Ω thenfor F ∈ T jk` ∩ ∂Ω doV := V ∪ C(F )

    end forend if

    end for

    # Restrict dual face to the domain.Vin := V ∩ ΩVout := V \Vinfor p ∈ Vout,q ∈ Vin do

    L ={x ∈ R3 : x = λp + (1− λ)q, λ ∈ [0, 1]

    }V := V ∪ (L ∩ ∂Ω)

    end forV := V \Vout# Account for creases in the boundary.for F1, F2 ∈ (∪`∂T jk` ) ∩ ∂Ω do

    if F1 ∩ V 6= ∅ and F2 ∩ V 6= ∅ thenV := V ∪ midpoint(F1 ∩ F2)

    end ifend for

    were generated by COMSOL. Those meshes can not be used for FVM since theydo not fulfil the Delaunay empty sphere criterion. Delaunay meshes generatedby Gmsh [18] were used in the FVM simulations. The COMSOL meshes werekept for the FEM discretisation since they are generally of better quality thanthe meshes generated by Gmsh, despite not being Delaunay. Using the meshesgenerated by Gmsh also for FEM would give an unfair comparison since betteraccustomed meshes exist, and would actually be used in practice. The error in`2 and `∞ as compared to the analytical solution is illustrated in Figure 5, whereit can be seen how FVM has second order convergence as expected, while meshrefinements do not improve the accuracy of the truncated FEM discretisation.The error norms used are defined by

    ‖e‖22 =∑j

    e2j |Cj |, (29)

    ‖e‖∞ = maxj|ej |. (30)

    In a stochastic simulation not only the discretisation error, but also randomfluctuations cause deviation from the analytic mean-field solution. When thenumber of particles is increased, the stochastic noise decays and the simulationresult approaches the solution of the semi-discretised system (11). In the limit ofmany particles, the discretisation error gives the full deviation from the analytic

    14

  • Figure 5: `2 and `∞ error for the truncated FEM and Voronöı FVM discretisationsof the diffusion equation in a sphere, as function of the number of nodes in the mesh.The dashed line indicates the slope for second order convergence.

    solution in a purely diffusive system. Since the diffusion equation is linear, thesame holds for the mean of many simulations with a fixed number of particles.Figure 6 shows how the deviation from the analytic solution (28) decays as the

    15

  • Figure 6: `2 deviation from the analytic solution for stochastic samples from thediffusive part of the master equation, with propensities calculated by truncated FEMand Voronöı FVM. The dashed lines indicate the discretisation error, i.e. the deviationof deterministic integration of the semi-discretised diffusion equation.

    number of particles is increased for stochastic simulation of the problem stud-ied above. Simulations were made with truncated FEM on a mesh with 3433nodes, and with Voronöı FVM on a mesh with 3235 nodes. In agreement withthe results of Kurtz, the deviation approaches that of deterministic integrationof the semi-discretised system when the number of particles is increased. Notehow deviation due to stochastic noise dominate up to systems of about 106 par-ticles for truncated FEM, and also for much bigger systems if Voronöı FVM isused. In practice one rarely encounters copy numbers exceeding 104 in stochas-tic simulations. If copy numbers that big are expected, other methods maybe more appropriate [16]. The results thus indicate that the discretisation er-ror has little impact on the outcome of single realisations, when compared tostochastic deviations. However, if statistics are collected from many realisationsthe discretisation error can have considerable influence. Note that the stochas-tic deviation is not to be considered as error, it is an important part of themodel. It is also important to have in mind that this result is no more thanan indication. The relative influence of stochastic noise is strongly dependenton problem parameters such as the magnitude of spatial gradients, the meanconcentrations, diffusion coefficients, simulation times, spatial resolutions etc.,and of course the set of reactions in the system.

    16

  • 2.4 First exit time from a sphere

    The expected first exit time from a sphere of a Brownian particle situated at itscentre is

    E(τ) =R2

    6γ, (31)

    where R is the radius of the sphere Ω, and γ the macroscopic diffusion constant[32]. In this section it is studied how well this is approximated by URDME,and by the FVM. The study is made on a sphere with radius R = 10−6 m, andthe diffusion constant is γ = 10−12 m2/s. The expected first exit time is then16 s. The sphere is meshed so that there is a primal node at the origin, as initialcondition 106 molecules of species A are placed in the corresponding subvolume.Molecules leaving the domain are modelled with the first order reaction

    Av(xAj)−−−−→ ∅, v(xAj) = MxAj (32)

    in the boundary subvolumes Cj , where xAj is the copy-number of species A inCj , ∂Cj ∩ ∂Ω 6= ∅. M is chosen to be high, so that molecules exit immediatelywhen they reach a boundary subvolume. This corresponds to a homogeneousDirichlet boundary condition, and is reasonable since the jump propensitiesbetween the subvolumes are calculated as jumps between the primal nodes inthe mesh. The primal node of a boundary subvolume is on the boundary, themolecule can thus be said to have left the domain when it reaches a boundarysubvolume. In the experiments made, M was taken to be 1050 s−1.

    Figure 7: Mean first exit times as sampled with URDME at different resolutions, usingthe truncated FEM and Voronöı FVM discretisations. The dashed line indicates theexpected time in the analytic problem.

    There sources of error in this approach are

    17

  • 1. the truncation error in D ∼ γ∆,

    2. the extension of the subvolume at the origin,

    3. the triangulated approximation of the boundary, and

    4. the statistical error.

    Error from sources 2 and 3 decline as the resolution is increased. The statisticalerror can be controlled by making big enough samples. The truncation error ofD will remain constant, since an inconsistent discretisation is used. Thus, inthe limit of high resolution and many particles, the truncation error of D will bethe dominant source of error. Since anti-diffusive fluxes are truncated away, theeffective diffusion constant is expected to be higher than wanted. This is alsowhat is experienced. Figure 7 show the sampled first exit time on a sequence ofmeshes with increasing resolution. The samples were of 106 molecules, for whichstatistical fluctuations typically make difference to the fourth most significantdigit. The experiment was repeated with the Voronöı FVM. In that case we didnot manage to place a node at the origin, the molecules were initially placed atthe node closest to the origin. The error originating from this decays for higherresolution. Since the scheme is convergent, error from all sources vanish in thelimit of high resolution and many particles. Consequently, we see in Figure 7how the mean first exit time approaches the wanted value.

    Figure 8 illustrates the distribution of exit locations when using the trun-cated FEM. The concentration of molecules leaving the domain from each sub-volume, taken as proportional to the number of exited molecules divided bythe area |∂Cj ∩ ∂Ω|, is plotted for two realisations. The patterns were found tomatch remarkably well, inhomogeneities are therefore likely due to discretisa-tion errors rather than stochastic noise. The difference between the highest andlowest concentration was around a factor three in both realisations.

    Figure 8: Concentration of exit locations for two independent samples with 106 and107 molecules respectively, on a mesh with 3517 nodes. Blue denotes minima, redmaxima. Note the similarity of the patterns. The concentrations are scaled so thatthe colouring is independent of the number of molecules in the system.

    18

  • 2.5 Moments of the diffusive part of the RDME

    In this section the first and second order moments of the solution to the masterequation for diffusion of a single molecular species are studied. We will startquite generally, only the sufficient conditions for the DMP stated in Theorem2, and that the master equation is irreducible [25, Ch.V] is assumed. Nothingis assumed in terms of accuracy.

    Assumption 1. The diffusion matrix D = γA−1S, where γ is scalar and A adiagonal matrix, fulfils

    ∑Kk=1Djk = 0, j = 1, . . . ,K, Djk ≥ 0, j 6= k, and has a

    one-dimensional null space.

    A simplified notation for the master equation will be used. Since there isonly one molecular species, the state of the system can be denoted by the vectorn, where ni, i = 1, . . . ,K is the copy number in the subvolume Ci. Steady-stateis indicated by simply dropping time as independent variable, e.g. p(n) =limt→∞ p(n, t). The first moment, the expected value, of the component ni isdenoted by Mi(t) =

    ∑n nip(n, t), where the sum is over all feasible states. Sim-

    ilarly the covariance is denoted by Cij(t) =∑

    n(ni −Mi(t))(nj −Mj(t))p(n) =∑n ninjp(n, t)−Mi(t)Mj(t). Cii(t) is the variance of ni. Given the conditions

    of Assumption 1, the following can be concluded about the expected values ofni.

    Theorem 3. The vector M(t), consisting of the expected values of the copynumbers for each component at time t, fulfils

    Ṁ(t) = DTM(t). (33)

    The proof of the theorem can be found in appendix A. This result is adesired one, but given the very liberal assumptions on the matrix D it rathersays something about the forgiving nature of diffusion than the accuracy ofour method. To explain why this result is wanted the equation is driven tosteady-state, and D is decomposed,

    (γA−1S)TM = γSTA−TM = 0. (34)

    Using that A and S are symmetric and dividing by γ yields

    S(A−1M) = 0. (35)

    Since the rows of S sum to zero, any constant vector is in the null-space ofS. We have furthermore assumed that D has a one-dimensional null-space, thesame must then hold for S. Consequently A−1M is a constant vector, so ifAii = |Ci|, Mi|Ci| is equal for all i = 1, . . . ,K. Thus, in steady-state the meanconcentration will be spatially independent.

    In very much the same manner, an equation for the covariances can bederived.

    Theorem 4. The covariance matrix C(t) fulfils

    Ċ(t) = DTC(t) + C(t)D + F (t) (36)

    where

    Fii(t) =

    K∑k=1

    DkiMk(t)− 2DiiMi(t), (37)

    Fij(t) = −DijMi(t)−DjiMj(t), i 6= j. (38)

    19

  • As for the expected values, the proof of the theorem can be found in appendixA. Noting that

    ∑Kk=1DkiMk = Ṁi the equation is driven to steady-state, re-

    sulting in

    DTC + CD + F = 0, (39)

    Fij = −DijMi −DjiMj . (40)

    Figure 9: The variance for the concentration of a single species at steady-state in apurely diffusive system with N = 104 particles in a sphere of volume 1 m3. The dashedreference line, which is indistinguishable from the variance curve, is given by N

    volume.

    This matrix equation is, just like the equation for the expected values, singu-lar. Furthermore, its coupling of variances and covariances makes it difficult toanalyse. Instead, we have computationally verified the intuitively expected re-sult that in steady-state, the variance of the concentration of a chemical speciesin each subvolume is inversely proportional to the volume of the subvolume.This is shown in Figure 9, where 104 molecules have undergone diffusion in asphere of volume 1 m3. The system was simulated in URDME on a mesh with633 subvolumes, and the variances were calculated from 105 sampling times.

    3 Propensities for bimolecular reactions

    The mesoscopic modelling framework and the RDME are often seen as approx-imations of a microscopic model based on Brownian motion. They do, however,not converge towards any sensible microscopic model as the mesh is refined. Asshown by Isaacson [24], bimolecular reactions are lost when the subvolume sizeapproaches zero due to the fast decay of the probability of two molecules beingin the same subvolume. The effect is in some parameter regimes notable even forrelatively coarse discretisations, the frequency of bimolecular reactions decreaseswhen the mesh is refined. The reason is that boundary effects in the subvol-umes become more notable when the subvolumes become small. Molecules can

    20

  • be close enough to react despite being in different subvolumes, as in Figure10, but this is not accounted for in the RDME. Throughout this section, thephenomenon will be studied on Cartesian meshes with cubic subvolumes.

    Figure 10: A bimolecular reaction can only happen if the substrates are in the samesubvolume. The molecules in the upper right corner may not react unless they diffuseto the same subvolume, even though they may have intersecting reaction radii.

    In order to illustrate how the mesh resolution affects the behaviour of achemical system, consider this model problem taken from [12],

    A+Bk1−→ B, ∅ k2−→ A. (41)

    At time t = 0 there is one molecule of type B, and no molecules of type Ain the system. Both species diffuse with diffusion constant γ = 10−12 m2/sin a cube with side length L = 10−6 m. The reaction constants are k1 =2 · 10−19 m3/s ≈ 1.2 · 108 M−1s−1 and k2 = 1018 m−3s−1 ≈ 1.7 · 10−9 M/s.The domain is partitioned into cubic subvolumes with side length h = Ln . ThePDF for the number of A-molecules at steady-state is a quantity which shouldnot depend on the discretisation. This is unfortunately not experienced insimulation. The propensity for the bimolecular reaction becomes too low athigher resolution, so that there are too many A-molecules at equilibrium. The

    mean number of A-molecules at equilibrium should be k2L6

    k1, which with our

    choice of parameters is 5. In Figure 11 it can be seen how quickly the RDMEstarts to deviate from this value. Already at n = 4, i.e. a mesh with 64subvolumes, the deviation is more than 10 %.

    3.1 Corrections to reaction rates

    In [12] Erban and Chapman derive a correction to the propensities for bimolec-ular reactions. The concept is quite simple, the propensity for reaction whenthe substrates are in the same subvolume is increased to compensate for thereactions between molecules in neighbouring subvolumes not accounted for. Inthe derivation of the corrected propensity, the model problem (41) is used. Withthe steady-state solution of the RDME of the problem as starting point, Erbanand Chapman derive an expression for the propensity so that the number ofA-molecules is correct, independent of the resolution. Since the derivation isbased on a particular problem, it is natural to question its generality. Thereare two particular aspects which raise doubt. The first is the geometry. The

    21

  • derivation relies on the domain being cubic, and as an approximation bound-ary effects are ignored – all subvolumes are assumed to have six neighbours.This may cause inaccuracy for domains with much boundary for little interior,which may be the case e.g. in the dendrites of a neuron or in a cell which islargely occupied by a vacuole. On the other hand, bimolecular reactions havein themselves no strong dependence on the domain shape. There is little reasonto suspect that the correction should not be valid for more general geometries,with the exception of extreme cases like those mentioned.

    The other reason to question the generality is the dependence on the set ofreactions in the model. The set of reactions is assumed in the derivation, theresult is in an optimistic manner made available for more general systems byextrapolation. We will come back to this matter, and present a simple chemicalsystem for which the proposed correction does not give an accurate description,and suggest a solution to the problem.

    Figure 11: Mean number of A-molecules at steady-state for the system given by (41), asfunction of the resolution. The curve with triangles uses the conventional, macroscopicpropensity functions, the curve with squares the propensity function (42) of Erban andChapman with β = β∞. The curve with circles uses the propensities (45) of Fange etal. The dashed line indicate the correct value, and the numbers in the plot state therelative deviation. The curve for the fix of Fange et al. was generated with MesoRD,and the other curves with URDME, on Cartesian meshes with n3 subvolumes.

    In conventional mesoscopic simulations the macroscopic reaction rate con-stants are used, so that the propensity function for the association event A +

    Bka−→ C in a subvolume with volume ν becomes v = abk1/ν, where a, b and c are

    the copy numbers of A, B and C, respectively, in the subvolume. On a Carte-sian partition with cubic subvolumes of volume ν = h3, Erban and Chapman

    22

  • propose the modified propensity function

    ṽa = ab(γA + γB)k1

    (γA + γB)h3 − βk1h2(42)

    for association events. γA and γB are the diffusion constants for the substrates,and β is a discretisation-dependent parameter. Its dependence on the discreti-sation compensates for boundary effects, that the in- and outflow by diffusionis smaller in boundary subvolumes than in the interior since the subvolumes donot have neighbours on all sides. In their paper, Erban and Chapman give aformula for β on cubic domains,

    β =1

    2n3

    n−1∑i,j,k=0

    (i,j,k)6=(0,0,0)

    1

    3− cos(iπ/n)− cos(jπ/n)− cos(kπ/n). (43)

    There are limitations on the applicability of the formula. Firstly, it is only forcubic domains. Secondly, it only gives a correction for the mean rates. What onereally would want is different propensity functions in the boundary subvolumesso that spatial effects are accurately modelled. Erban and Chapman suggeststhis in their paper, but give no hint on how it can be done. They suggestthat β = β∞ ≈ 0.25272 should be accurate enough in most applications. β∞ isdetermined by letting n→∞ in (43), in effect disregarding the boundary effects.Figure 11 shows the mean number of A-molecules at steady-state when (41) issimulated with the propensity function (42) and β = β∞. The improvementcompared to the conventional approach is notable, but the deviation is stillaround 6 % for a mesh with 4096 subvolumes, i.e. h = 62.5 nm. If β is chosenaccording to (43) agreement with the expected result is excellent, with a 1.1% deviation for 4096 subvolumes. However, as previously mentioned, such aformula is not available for more general geometries. Note also that this fix isapplicable only for resolutions up to a certain limit. There is a critical value ofh,

    hcrit = β∞k1

    γA + γB, (44)

    for which the denominator in (42) becomes zero. The reaction propensities canonly be adjusted up to this level with this method.

    Another correction to the propensities for bimolecular reactions is proposedby Fange et al. [14]. They suggest that propensities for bimolecular reactionsshould be calculated with the expression

    qa =ab

    h3k

    1 + α(1− β)(1− 0.58β), (45)

    where k is the microscopic association rate constant which can be determinedby the relation

    ka =4πρ(γA + γB)k

    4πρ(γA + γB) + k, (46)

    where ρ is the reaction radius of the substrates. α = k4πρ(γA+γB) is the degree

    of diffusion control, i.e. the relative strength of association over diffusion on themicroscopic scale, and β = ρρ+h is a measure of the resolution. Furthermore,

    23

  • they suggest to calculate the reaction propensities on another spatial resolu-tion than the one used for diffusion. To account for reactions across subvolumeboundaries, an A-molecule may react with a B-molecule in the same or a neigh-bouring subvolume. This leads to a performance penalty which is likely to beconsiderable, but which we have not evaluated. The accuracy of this approachon the problem (41) is shown in comparison to the approach of Erban andChapman in Figure 11. As can be seen, accuracy is comparable between thetwo methods. Simulations using the reaction propensities proposed by Fange etal. were made using MesoRD [21], with ρ = 10−8 m.

    3.2 Propensities for reversible reactions

    Consider the reaction network

    A+Bka�kd

    C, ∅ k1−→ C, A k2−→ ∅, B k2−→ ∅, (47)

    taken from [14], which includes a reversible reaction. The parameters are takento be ka = 1.2442 · 10−19 m3/s ≈ 7.5 · 107 M−1s−1, kd = 12.442 s−1, k1 =6 · 1020 m−3s−1 ≈ 1.0 · 10−6 M/s, k2 = 10 s−1, γ = 0.5 · 10−12 m2/s, and ρ =10−8 m. The system is confined to the domain Ω = [0, L]3, with L = 10−6 m.Reversibility introduces extra complexity, which at first sight may not be obvi-ous. The dissociation event C → A+B is a first order reaction, which normallywould not cause any trouble. However, just as there is a possibility that as-sociation reactions happen between molecules on either side of a subvolumeboundary, the products of a dissociation may emerge in different subvolumes.In the current implementation of URDME, the products always emerge in thesame subvolume as the substrate. This leads to a too big probability of reas-sociation. Via experiment we see that for this particular choice of parameters,the increased probability of reassociation dominates over the decreased proba-bility of association reactions due to the macroscopic propensities. The averagenumber of C-molecules at steady-state increases for decreasing subvolume sizes,as can be seen in Figure 12. As in the previous example, the average numberof molecules is supposed to be independent of the spatial discretisation. It canalso be seen in the figure how the propensity function for association reactionsproposed by Erban and Chapman amplifies the effect instead of providing aremedy.

    Fange et al. propose to handle reversible reactions by choosing the propen-sity function for the dissociation reaction so that the equilibrium constant, thequotient between the propensities for the association and the dissociation reac-tion scaled with the volume, is preserved. The same approach can with successbe applied on the method of Erban and Chapman. The propensity functionsacquired for the dissociation reaction will then be

    ṽd = c(γA + γB)kd

    (γA + γB)− βka/h(48)

    and

    qd = ck̄

    1 + α(1− β)(1− 0.58β), (49)

    24

  • for the approaches of Erban and Chapman and Fange et al., respectively. k̄ is themicroscopic dissociation constant, which can be determined from the relation

    kd =4πρ(γA + γB)k̄

    4πρ(γA + γB) + k. (50)

    Note how the macroscopic dissociation constant, kd, depends on the microscopicassociation constant k, indicating that dissociation is a competition betweendiffusive separation and reassociation of the molecules, and how the same phe-nomenon appears in the mesoscopic relation (48).

    Figure 12 also shows how applying these propensity functions for dissociationsolves the problem quite well. If the propensity for dissociation is increased using(48) when applying the method of Erban and Chapman, the mean numberof C-molecules stays quite constant. Also the fix of Fange et al. keeps theconcentration quite independent on the resolution. The number of C-moleculesfor the highest resolution tested differs by less than 2 % compared to the onefor the lowest in both methods.

    Figure 12: Mean number of C-molecules at steady-state for the system (47), as functionof the resolution. The curves were generated with URDME on Cartesian meshes withn3 subvolumes, except the curve for the fix of Fange et al., which was generated withMesoRD. The measured quantity is supposed to be independent of the discretisation.

    The lost association reactions between substrates in neighbouring subvol-umes are compensated for by increasing the propensity for association betweensubstrates in the same subvolume. Since the products of dissociation reactionsalways appear in the same subvolume, the substrates for the association reactionhave an artificially increased probability of being in the same subvolume whenreversible association-dissociation reactions exist. The compensation for asso-ciation propensities then becomes an overcompensation. The remedy is takento be increasing the propensity for dissociation. This brings back the system

    25

  • to the same equilibrium, the average number of molecules of each kind is pre-served. The total number of reactions is increased as the average life time of themolecules decreases. This may seem strange, but is not necessarily a problem.The macroscopic dissociation constant as defined in (50) is the result of a com-petition between dissociation and separation by diffusion on the one hand, andreassociation on the other. The macroscopic dissociation rate describe completedissociation, i.e. dissociation where the products have diffused so that theirpositions are largely uncorrelated. They have no significantly increased proba-bility of reassociation compared to any other two molecules. The macro scalemodel is thus hiding these dissociation and reassociation events that appear onthe meso scale, where the products do not lose correlation upon dissociation.

    3.3 Incorporating spatial dependence

    A main motivation for the RDME is the ability to model spatial dependencein the system studied. We will here consider a reaction network with inherentspatial dependence, and study how the method of Erban and Chapman workswhen spatial gradients are present. Their propensity function was derived fromthe steady-state solution of a spatially homogeneous model problem. It is there-fore natural to question its validity in more general cases. The reaction networkstudied is

    A+Bka−→ ∅, ∅ k1−→ A, ∅ k1−→ B, A k2−→ ∅, B k2−→ ∅, (51)

    with ka = 2 · 10−19 m3/s ≈ 1.2 · 108 M−1s−1, k1 = 1015 m−2s−1, k2 = 1 s−1,and γ = 10−12 m2/s. The system is confined to the domain Ω = [0, L]3, withL = 10−6 m. The birth event of A occurs only on one of the boundary facesof the domain, and the birth event of B only occurs on the opposite boundaryface.

    To get a reference solution for this system, we will study the mean fieldPDE. Introduce the expected value operator 〈 · 〉, and let u and v denote theconcentration of A- and B-molecules, respectively. u can be written as the sumof its mean and the deviation from the mean, i.e. u = ū + δu, where 〈u〉 = ūand 〈δu〉 = 0. v = v̄ + δv is defined similarly. The average state of the systemis governed by the PDE

    〈ut〉 = γ〈∆u〉 − ka〈uv〉 − k2〈u〉, (x, y, z) ∈ Ω,〈vt〉 = γ〈∆v〉 − ka〈uv〉 − k2〈v〉, (x, y, z) ∈ Ω,

    〈ux〉 = −k1γ, x = 0, (52)

    〈vx〉 =k1γ, x = L,

    〈n · ∇u〉 = 〈n · ∇v〉 = 0, elsewhere on ∂Ω.

    26

  • In steady-state, the system reads in our notation

    γ∆ū = kaūv̄ + ka〈δuδv〉+ k2ū, (x, y, z) ∈ Ω,γ∆v̄ = kaūv̄ + ka〈δuδv〉+ k2v̄, (x, y, z) ∈ Ω,

    ūx = −k1γ, x = 0, (53)

    v̄x =k1γ, x = L,

    n · ∇ū = n · ∇v̄ = 0, elsewhere on ∂Ω.

    Since the system is nonlinear it is difficult to solve analytically. The presenceof the unknown quantity 〈δuδv〉, which in fact is nothing but the correlationCuv(x), complicates things further. However, it was shown in [27] that Cuvdecays in comparison to ū and v̄ when the system size increases. We can thenovercome the difficulty by choosing k1 large enough for Cuv to have negligibleinfluence. Furthermore, we note that the system is homogeneous in the y- andz-directions, and integrate two dimensions away. This yields the system of ODEs

    γū′′ = kaūv̄ + k2ū, 0 < x < L,

    γv̄′′ = kaūv̄ + k2v̄, 0 < x < L,

    ū′ = −k1γ, x = 0, (54)

    v̄′ =k1γ, x = L.

    (a) (b)

    Figure 13: (a) shows the mean concentrations of A- and B-molecules in steady-state asfunction of the x-coordinate for the system (51). The results of stochastic simulations,using the macroscopic propensity functions and the propensities of Erban and Chap-man, are compared to a reference solution computed from the mean-field description.(b) shows the error in concentration of A-molecules in the two stochastic methods ascompared to the reference solution.

    A reference solution is constructed by solving the system numerically. Figure13 shows ū(x) and v̄(x) computed by stochastic simulations with macroscopicpropensity functions and with the method of Erban and Chapman on a Carte-sian mesh with n3 = 163 subvolumes, compared to the reference solution. Both

    27

  • approaches yield quite good results. Note how the error curve for the macro-scopic propensities peaks in the middle of the domain, where the intensity ofbimolecular reactions is the highest. The symmetry of the curve indicates thatthe absolute concentration in itself has little impact on the error. Note how themethod of Erban and Chapman completely eliminates this peak. The error isconstant and comparably small in the whole domain. The decline in concentra-tion of A-molecules does though result in a considerable relative error, 10.5 %,at the x = L boundary, and similarly for the concentration of B-molecules atx = 0. The results give no indication that the method of Erban and Chapmanwould have any difficulties with spatially dependent problems.

    4 The effects combined

    Figure 14: The geometry for the example problem (55).

    In this section a more complex example, illustrating the error both in diffusionand in bimolecular reaction rate, is presented. The domain Ω is a block oflength 4.5 µm, having a quadratic 1×1 µm cross section. It is divided into threesections, Ω = Ω1∪Ω2∪Ω3, where Ω1 = [0, 2L]× [0, L]2, Ω2 = [2L, 2.5L]× [0, L]2,and Ω3 = [2.5L, 4.5L]×[0, L]2, with L = 10−6 m. The system has two molecularspecies, A and B. A fixed number, NB = 10, of B-molecules are confined to Ω2.A-molecules are inserted to the system with the rate k1 = 5 s

    −1 at the point(0, 0.5L, 0.5L), i.e. the midpoint of one end of the domain. The problem setupis illustrated in Figure 14. A-molecules are destructed upon association withB-molecules,

    A+Bka−→ B. (55)

    The A-molecules diffuse in the whole domain with diffusion coefficient γA whichwill adopt different values, while the B-molecules diffuse in Ω2 with the fixeddiffusion constant γB = 10

    −12 m2/s. The domain is partitioned by an unstruc-tured mesh with K subvolumes. Four different meshes with K = 449, 1234, 3959and 8799 are used. As a consequence of the meshing methodology, a numberof subvolumes will be centred on the interior boundaries. Subvolumes centredon ∂Ω1 ∩ ∂Ω2 are considered as belonging to Ω2, and subvolumes centred on∂Ω2 ∩ ∂Ω3 are considered as belonging to Ω3. The experiment is made for dif-ferent values of the parameters ka and γA. ka takes the values 10

    −21, 10−20 and10−19 m3/s (6 · 105, 6 · 106 and 6 · 107 M−1s−1), covering a biologically relevantrange. The diffusion constant γA takes the values 0.9, 1.0 and 1.1 µm

    2/s, where

    28

  • the deviation from the middle value is in the order of the deviation expectedto result from the truncation of the stiffness matrix. The diffusion jump coef-ficients are calculated with the truncated FEM, and the bimolecular reactionpropensities are calculated with the conventional, macroscopic approach.

    In the simulations the distribution of A-molecules at steady-state is soughtfor. One particular measure is studied: the 1D concentration of A-moleculesalong the x-axis, u(x). To calculate it, the 3D concentration of A-molecules isinterpolated linearly from the nodal values to a Cartesian mesh with step sizeh = 10−7 m. The y- and z-dimensions are then integrated over using Simpson’srule on the Cartesian mesh. To get the mean concentration at steady-state, thestate of the system is sampled at 20 000 time steps with a separation of onesecond. The first 1 000 seconds are disregarded as the transient phase.

    29

  • (a)

    (b)

    (c)

    Figure 15: The linear concentration u(x) of A-molecules at steady-state for differentchoices of K and ka. γA was held at 1.0 · 10−12 m2/s. Note that the concentrationdecreases when resolution increases, despite the effect of reduced association rates insmall subvolumes. 30

  • The linear concentration u(x) for γA = 1.0 µm2/s and different values of ka

    and K is illustrated in Figure 15. The equilibrium concentration of A-moleculesdecreases when resolution is increased, contrary to what would be predictedtaking the reduced rate of bimolecular reactions in small subvolumes into ac-count. This could be explained by difficulties in resolving the geometry withthe coarser meshes. The relative, and absolute, difference in concentration fordifferent resolutions is less in the experiments with the highest association con-stant. This is likely due to the artificially reduced association rate in smallsubvolumes counteracting the decrease, an effect which is stronger for high as-sociation constants. The correction of Erban and Chapman suggests that theassociation rate is artificially reduced by between 5 and 20 % with the finestmesh and ka = 10

    −19 m3/s. For the lower association rates, the reduction is lessthan 2 %. The uncertainty in this figure is partly due to different subvolumesizes in the same mesh, and partly due to lack of a definition of the mesh spacingh on an unstructured mesh.

    Figure 16 shows the dependence on the diffusion constant γA. The depen-dence is stronger for higher association rates, which is expected since the spatialgradients then are bigger. Diffusion transports the A-molecules from the inflowpoint at the boundary to the reactive segment, where they are destroyed. Fasterdiffusion thus flattens out the slope, and reduces the concentration peak at theinflow boundary. It also gives a small reduction to the total amount of A-molecules in the system. The effect of a 10 % perturbation to the diffusionconstant is in this example small compared to the effect of changing the spatialresolution.

    (a) (b)

    Figure 16: The linear concentration u(x) of A-molecules at steady-state for differentvalues of the diffusion constant γA. The left figure is for ka = 10

    −20 m3/s, the rightfor ka = 10

    −19 m3/s. The mesh with 3959 subvolumes was used in both cases.

    5 Discussion and conclusions

    Studies of the validity and accuracy of the RDME have played a dominant rolein this thesis. In this section that discussion will be summed up, but as a pre-requisite we will consider the validity and reliability of the numerical results at

    31

  • our disposal. We assume that the idealised model of the biochemical system isvalid: that the geometry is accurately represented by given, static boundaries,that the diffusive transport is isotropic Brownian motion with known diffusionconstant, and that the reaction rates are proportional to the rate of molecularcollisions and will coincide with the macroscopic reaction rates if the systemis scaled up. Considering the well-ordered chaos in the cytosol these assump-tions, in particular the first two, can be questioned. There will doubtlessly be aconsiderable modelling error. Inner membranes, organelles, polymers etc. willcreate geometric conditions that are far more detailed than what is modelled,there is much uncertainty in their exact shape, and on the time scales stud-ied they may undergo considerable motion. Since the cytosol itself is far fromhomogeneous there will also be anisotropy in the diffusion, and there is con-siderable uncertainty also in the average diffusion constant. These assumptionscan still be motivated with two arguments. Firstly, it will probably be possibleto extend the model, allowing relaxation of the assumptions. A special caseof anisotropic diffusion for the RDME have actually already been implementedin [22]. Secondly, the main competing models, the CME, Brownian and PDEmodels, generally operate under similar conditions. We will therefore accept theassumptions and lay our brick to a strong foundation of the model, useful as itis and prepared for future improvement.

    The convergence test in Section 2.3, illustrated in Figure 5, indicates as ex-pected that the Voronöı FVM is second order accurate while the truncated FEMdoes not converge to the diffusion equation. The applicability of the method ofanalysis, i.e. integration of the semi-discretised PDE, is as previously mentionedassured by the results of Kurtz [27]. That does however not say anything aboutthe relevance of the model problem. Choosing a good model problem is difficultin this case. One would want a problem that resembles the characteristic prop-erties, the geometry, diffusion coefficient, time scale, etc., of typical biologicalsystems of interest. This is unfortunately not possible when considering diffu-sion only. As shown in Section 2.5, the numerical solution at steady-state willbe the uniform distribution, which is the exact solution. Due to exponentialdecay of spatial gradients, steady-state will be reached quite quickly. In a real,biological system on the other hand, reactions will maintain, or in an oscillatorymanner recreate, spatial gradients. The numerical difficulties of the transientphase will hence remain indefinitely. In the presented example, the total errorduring a part of the decay of a spatial inhomogeneity is calculated. The initialcondition is chosen as the product of a spherical Bessel function and the cosineof the longitudinal angle, so that the analytical solution is known. A constantis added to make the solution positive everywhere in the domain. The diffusionconstant and simulation time is chosen so that most, but far from all, of thespatial irregularity is smoothed out. Note that the diffusion constant is nothingbut a scale factor for the time variable. In our example, the peaks decay to 32% of their initial deviation from the mean. The `2-error curve for truncatedFEM levels out at ∼ 10−2, which is about 2 % of the norm of the analyticalsolution. One should have in mind that this is the error accumulated duringwhat typically will only be a small part of the full simulation, but also that theerror will depend strongly on the problem in question. It is difficult to draw anystronger conclusion than that the method is not converging towards the diffu-sion equation. The related experiment with stochastic simulations, illustrated inFigure 6, does not really say anything more about the accuracy. A purely diffu-

    32

  • sive system will on average behave like the corresponding deterministic system.What this experiment says is that stochastic variations of single realisations canbe considerable in comparison to discretisation errors if the number of involvedmolecules is small. The deviation due to stochastic noise will decay if a meanis taken over several realisations.

    The experiment on the first exit time from a sphere in Section 2.4 gives moredefinite answers. The consistent underestimation of the first exit time givenby the truncated FEM simulations clearly indicates that the effective diffusionconstant is larger than wanted. In the present setting, it is overestimated byabout 10 %. The size of the error is of course dependent on the mesh quality, butapart from that the relative error in the effective diffusion constant is parameterindependent. Scaling of the diffusion constant is accurately reflected by thesame, inverted, scaling of the mean first exit time.

    The experiments concerning bimolecular reactions in small subvolumes, pre-sented in Section 3, have quite strong parameter dependence. As indicatedby equation (44), the system becomes more sensitive to small subvolumes ifthe bimolecular reaction rate constant is high and diffusion is slow. Naturally,smaller subvolumes will be needed if the domain is small or has fine geomet-ric details. In the experiments presented, a cubic domain of size 1 µm3 and adiffusion constant of 1 µm2/s are used. These are quite typical values in molec-ular biology. The bimolecular reaction rate constants are taken from [12, 14].They are comparably high, making the problem more pronounced, but they arenot unrealistic. These examples show what can happen to the accuracy if thisimperfection is not taken into account, but should not be seen as generally rep-resentative. If the reaction constants were reduced by an order of magnitude,the problem would vanish. They also show that the corrections to the reactionrates proposed in [12, 14] can provide considerable improvement. An interestingresult is the one of the spatially dependent problem, illustrated in Figure 13,which despite the high association rate shows quite modest error. It is also ofinterest to note that the method of Erban and Chapman appears to work wellalso in this spatially inhomogeneous case.

    The example in Section 4 is a slightly more complicated one. It shows arather strong dependence on the resolution, but this seems not to be because ofthe problem with bimolecular reactions. It is rather because of problems withresolving the geometry. Both the inaccuracy in the treatment of diffusion andthe problems with bimolecular reactions in small subvolumes have impact, butonly in a limited part of the parameter range.

    To sum up, the experiments allow us to make the following concrete obser-vations.

    • The truncated FEM is not a consistent approximation of the diffusionequation, and will in effect overestimate the diffusion constant.

    • The Voronöı FVM is a consistent approximation of the diffusion equation,but the constraints it puts on the meshing limits its current usability.

    • The problem with small subvolumes grows quickly when it appears. Oneneeds to be careful when choosing mesh resolution, especially if the asso-ciation rates are high. The methods of Erban and Chapman and of Fangeet al. provide a remedy if the mesh is Cartesian.

    33

  • • The method of Erban and Chapman for small subvolumes can not handlereversible reactions. It is however possible to extend it, giving it thatcapability.

    The inaccuracy in the diffusion does not seem to have an easy solution.Accurate and efficient schemes, fulfilling the DMP, for the Laplacian on un-structured meshes have long been desired. A couple of nonlinear schemes havebeen proposed, e.g. in [4, 28], but nonlinear schemes for a linear problem arenot that attractive. Using them would increase the computational cost con-siderably. Additionally, their validity after coupling with reactions remains anopen question. The Voronöı FVM offers a solution if a Delaunay mesh is avail-able. Today it is unfortunately in general not. The construction of Delaunaymeshes in general 3D domains is still an active area of research. An alterna-tive approach is proposed in [31]. The domain, which has an irregular, smoothboundary, is partitioned with a Cartesian mesh. The discretised interior is cou-pled to the smooth boundary, which is discretised with a Voronöı mesh on whicha FVM scheme is applied. In contrast to the full 3D case, algorithms for theconstruction of Voronöı meshes on curved surfaces are known. This approachallows both smooth boundaries and convergent interior and boundary schemesfulfilling the DMP.

    The presented examples show that the treatment of bimolecular reactionsin small subvolumes can result in considerable inaccuracy in certain parame-ter regimes. The accuracy is strongly parameter dependent, and the troubleescalates rather quickly once it has appeared. One should be extra careful ifthe reaction rate is high or if high resolution is needed, e.g. in the vicinity ofgeometric details. It could be a good idea to check the relation between themacroscopic reaction rate and the mesoscopic one due to Erban and Chapman,given by the expression

    ṽav

    =γA + γB

    γA + γB − β k1h. (56)

    If the quotient deviates significantly from one, one should consider applying ei-ther of the methods for small subvolumes or adapting the mesh. A limitation forthese methods is that they require the mesh to be Cartesian. Generalising themethod of Erban and Chapman to unstructured meshes appears to be challeng-ing. Generalisation of method of Fange et al. is a more straight-forward task.However, the method imposes some penalty on the computational cost, andeven more so on unstructured meshes. It requires reaction and diffusion ratesto be recalculated after an event, not only in the subvolume where the eventoccurred, but also in neighbouring subvolumes. On a Cartesian mesh, each in-terior subvolume has six neighbours. On an unstructured mesh, the number ofneighbours is typically two or three times as high.

    Acknowledgements

    I am very grateful to my advisor Andreas Hellander and my reviewer Per Lötst-edt for many valuable comments and suggestions. I also want to thank DavidFange for explaining his method for handling small subvolumes.

    34

  • A Proof of theorems 3 and 4

    In this section we will prove the theorems 3 and 4, which give conditions onthe first and second order moments of the solution of the master equation fordiffusion of a single molecular species. The diffusion matrix D is required tofulfil Assumption 1.

    The simplified notation for the master equation defined in Section 2.5 will beused. Furthermore, introduce the K-dimensional vectors δj , being 1 in elementj and 0 in all other elements. Define p(n, t) = 0 for all states n where anyelement is negative. In this section, the time dependence of the moments willnot be denoted explicitly to keep notation cleaner. The master equation fordiffusion of one molecular species can then be written

    ∂p(n, t)

    ∂t=

    K∑i=1

    K∑j=1j 6=i

    Dij(ni + 1)p(n + δi − δj , t)−K∑i=1

    K∑j=1j 6=i

    Dijnip(n, t). (57)

    For the proof of theorem 3 the master equation is multiplied by nk, and sum-mation is performed over all feasible states n,

    ∑n

    nk∂p(n, t)

    ∂t=

    K∑i=1

    K∑j=1j 6=i

    Dij

    (∑n

    nk(ni + 1)p(n + δi − δj , t)−∑n

    nknip(n, t)

    ).

    (58)This can be written

    ∂t

    ∑n

    nkp(n, t) =

    K∑i=1

    K∑j=1j 6=i

    DijΘkij , k = 1, . . . ,K, (59)

    where

    Θkij =∑n

    nk(ni + 1)p(n + δi − δj , t)−∑n

    nknip(n, t), i 6= j. (60)

    The left-hand side is by definition Ṁk. Θkij can be evaluated for three different

    cases. First assume that k 6= i, j. Then

    Θkij = 0, (61)

    as

    Θkij =∑n

    nk(ni + 1)p(n + δi − δj , t)−∑n

    nknip(n, t)

    =∑n

    nk(ni + 1)p(n + δi, t)−∑n

    nknip(n, t)

    =∑n

    nknip(n, t)−∑n

    nknip(n, t) = 0.

    Now consider the case k = i 6= j. Then

    Θkkj = −Mk, (62)

    35

  • since

    Θkkj =∑n

    nk(nk + 1)p(n + δk − δj , t)−∑n

    n2kp(n, t)

    =∑n

    (nk + 1)2p(n + δk, t)−

    ∑n

    n2kp(n, t)−∑n

    (nk + 1)p(n + δk, t)

    = −∑n

    nkp(n, t) = −Mk.

    Finally, if k = j 6= i,Θkik = Mi, (63)

    since

    Θkik =∑n

    nk(ni + 1)p(n + δi − δk, t)−∑n

    nknip(n, t)

    =∑n

    (nk − 1)(ni + 1)p(n + δi − δk, t)−∑n

    nknip(n, t)

    +∑n

    (ni + 1)p(n + δi − δk, t)

    =∑n

    nip(n, t) = Mi.

    Using these results (59) can easily be attacked, summing over the cases wherej and i are equal to k, respectively,

    Ṁk =

    K∑i=1

    K∑j=1j 6=i

    DijΘkij

    =

    K∑i=1i6=k

    DikΘkik +

    K∑j=1j 6=k

    DkjΘkkj

    =

    K∑i=1i6=k

    DikMi −MiK∑j=1j 6=k

    Dkj .

    Using that the rows of D sum to zero, we get

    Ṁk =∑i=1i6=k

    DikMi +MiDkk, (64)

    which can be put together to

    Ṁk =

    K∑i=1

    DikMi, k = 1, . . . ,K. (65)

    Writing the system of matrix form concludes the proof.For the covariances, multiply (57) by nkn` and sum over all feasible states,

    ∂t

    ∑n

    nkn`p(n, t) =

    K∑i=1

    K∑j=1j 6=i

    Dij

    (∑n

    nkn`(ni + 1)p(n + δi − δj , t)−∑n

    nkn`nip(n, t)

    ).

    (66)

    36

  • As before, this is written as

    Ċk` + ṀkM` +MkṀ` =

    K∑i=1

    K∑j=1j 6=i

    DijΘk`ij , k = 1, . . . ,K, (67)

    where

    Θk`ij =∑n

    nkn`(ni + 1)p(n + δi − δj , t)−∑n

    nkn`nip(n, t), i 6= j, (68)

    and the different cases are considered. It is easily understood that case wherek 6= i, j and ` 6= i, j yields

    Θklij = 0, (69)

    using the same reasoning as for (61). Note that this holds also for k = `. Ifk = ` = i 6= j we get

    Θkkkj =∑n

    n2k(nk + 1)p(n + δk − δj , t)−∑n

    n3kp(n, t)

    =∑n

    (nk + 1)3p(n + δk, t)−

    ∑n

    n3kp(n, t)

    −∑n

    (2nk + 1)(nk + 1)p(n + δk, t)

    = −2∑n

    (nk + 1)2p(n + δk, t) +

    ∑n

    (nk + 1)p(n + δk, t)

    = −2∑n

    n2kp(n, t) +Mk

    = −2(Ckk +M2k ) +Mk,

    i.e.

    Θkkkj = −2Ckk +Mk − 2M2k . (70)

    In the same way for k = ` = j 6= i,

    Θkkik =∑n

    n2k(ni + 1)p(n + δi − δk, t)−∑n

    n2knip(n, t)

    =∑n

    (nk − 1)2(ni + 1)p(n + δi − δk, t)−∑n

    n2knip(n, t)

    +∑n

    (2nk − 1)(ni + 1)p(n + δi − δk, t)

    = 2∑n

    (nk − 1)(ni + 1)p(n + δi − δk, t) +∑n

    (ni + 1)p(n + δi, t)

    = 2(Cik +MiMk) +Mi,

    i.e.

    Θkkik = 2Cik + 2MiMk +Mi. (71)

    37

  • If k = i 6= j and ` 6= i, j,

    Θk`kj =∑n

    nkn`(nk + 1)p(n + δk − δj , t)−∑n

    n2kn`p(n, t)

    =∑n

    (nk + 1)2n`p(n + δk, t)−

    ∑n

    n2kn`p(n, t)

    −∑n

    (nk + 1)n`p(n + δk, t)

    = −Ck` −MkM`.

    Since Θk`ij is symmetric under exchange of k and `, and C is a symmetric matrix,we have

    Θk`kj = Θk``j = −Ck` −MkM`. (72)

    Finally we consider the case k = j 6= i and ` 6= i, j.

    Θk`ik =∑n

    nkn`(ni + 1)p(n + δi − δk, t)−∑n

    nkn`nip(n, t)

    =∑n

    (nk − 1)n`(ni + 1)p(n + δi − δk, t)−∑n

    nkn`nip(n, t)

    +∑n

    n`(ni + 1)p(n + δi, t)

    = Ci` +MiM`,

    and by symmetry

    Θk`i` = Cik +MiMk, k 6= i 6= ` 6= k. (73)

    Finally considering the case k = i 6= ` = j gives

    Θk`k` =∑n

    nkn`(nk + 1)p(n + δk − δ`, t)−∑n

    n2kn`p(n, t)

    =∑n

    (nk + 1)2n`p(n + δk − δ`, t)−

    ∑n

    n2kn`p(n, t)

    −∑n

    (nk + 1)n`p(n + δk − δ`, t)

    =∑n

    (nk + 1)2(n` − 1)p(n + δk − δ`, t)−

    ∑n

    n2kn`p(n, t)

    +∑n

    (nk + 1)2p(n + δk, t)

    −∑n

    (nk + 1)(n` − 1)p(n + δk − δ`, t)−∑n

    (nk + 1)p(n + δk, t)

    = Ckk − Ck` +M2k −MkM` −Mk.

    Using symmetry again we can write the full system, where by convention indices

    38

  • with different letters may not have the same value,

    Θk`ij = 0,Θkkij = 0,Θkkkj = −2Ckk +Mk − 2M2k ,Θkkik = 2Cik +Mi + 2MiMk,Θk`kj = −Ck` −MkM`,Θk``j = −Ck` −MkM`,Θk`ik = Ci` +MiM`,Θk`i` = Cik +MiMk,Θk`k` = Ckk − Ck` +M2k −MkM` −Mk,Θk``k = C`` − Ck` +M2` −MkM` −M`.

    (74)

    These are plugged into (67). First consider the case k = `,

    Ċkk + 2ṀkMk =

    K∑i=1

    K∑j=1j 6=i

    DijΘkkij

    =

    K∑j=1j 6=k

    DkjΘkkkj +

    K∑i=1i6=k

    DikΘkkik

    =

    K∑j=1j 6=k

    Dkj(−2Ckk +Mk − 2M2k ) +K∑i=1i6=k

    Dik(2Cik +Mi + 2MiMk)

    = Dkk(2Ckk −Mk + 2M2k ) +K∑i=1

    Dik(2Cik +Mi + 2MiMk)

    −Dkk(2Ckk +Mk + 2M2k )

    =

    K∑i=1

    Dik(2Cik +Mi + 2MiMk)− 2DkkMk

    = 2

    K∑i=1

    DikCik +

    K∑i=1

    DikMi + 2ṀkMk − 2DkkMk,

    i.e.

    Ċkk = 2

    K∑i=1

    DikCik +

    K∑i=1

    DikMi − 2DkkMk. (75)

    39

  • The case k 6= ` yields

    Ċk` + ṀkM` +MkṀ` =

    K∑i=1

    K∑j=1j 6=i

    DijΘk`ij

    =

    K∑i=1

    i6=k,`

    DikΘk`ik +

    K∑i=1

    i6=k,`

    Di`�