원시데이터 수집 시스템
선정목록으로

Hitting time distributions for efficient simulations of drift‐diffusion processes

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Raghu Raghavan — Therataxis, Baltimore, Maryland
DOI
10.1002/eng2.12109
저널
Engineering Reports
발행년도
2020
발행기관
Wiley
피인용수
4
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1002/eng2.12109
토픽
Heat and Mass Transfer in Porous Media
OpenAlex ID
W3005062248

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Numerical solutions to partial differential equations in anisotropic, heterogeneous media obtained by their probabilistic representations are useful for a number of purposes, including our own interests in biomedical simulations. These solutions are obtained by a walk with both random and deterministic components hitting a boundary. Hitting time distributions are required to efficiently simulate such processes. The distributions for hitting time T and place X T on a surface for a particle undergoing both diffusion and drift are presented here, generalizing the previous work. Importantly, the distributions directly obtained are, on the whole, not useful for numerical work, being expressed as very poorly and nonuniformly convergent series. Resummed series with rapid convergence for probabilities over a useful range of the hitting time to the boundary are here obtained in different ways. A numerical inverse is constructed to implement the random walk. We have used these hitting time distributions, combined with efficient inverse function construction, to obtain speed‐up of simulations of fluid and particle transport by permitting the steps allowed for a given accuracy to be as large as possible.

본문 78,898자

본문 펼치기
DOI: 10.1002/eng2.12109 R E S E A R C H A R T I C L E # Hitting time distributions for efficient simulations of drift-diffusion processes Raghu Raghavan Therataxis, Baltimore, Maryland Correspondence Raghu Raghavan, Therataxis, 314 West 36th St, Baltimore, MD, USA 21211. Email: raghu@therataxis.com Funding information BrainLab, AG 1 INTRODUCTION Numerical solutions to partial differential equations in anisotropic, heteroge neous media obtained by their probabilistic representations are useful for a number of purposes, including our own interests in biomedical simulations. These solutions are obtained by a walk with both random and deterministic com ponents hitting a boundary. Hitting time distributions are required to efficiently simulate such processes. The distributions for hitting time _T_ and place _XT_ on a surface for a particle undergoing both diffusion and drift are presented here, generalizing the previous work. Importantly, the distributions directly obtained are, on the whole, not useful for numerical work, being expressed as very poorly ~~and nonuniformly convergent series. Resummed series with rapid convergence~~ for probabilities over a useful range of the hitting time to the boundary are here obtained in different ways. A numerical inverse is constructed to implement the random walk. We have used these hitting time distributions, combined with effi cient inverse function construction, to obtain speed-up of simulations of fluid and particle transport by permitting the steps allowed for a given accuracy to be as large as possible. K E Y W O R D S biomedical simulation, hitting time distributions, numerical solution of PDE's, probabilistic representation Computer simulation of a Brownian process has, as is well known, a very vast number of applications. In our own work, we have used such simulations for applications in neuromedicine; in particular to optimize drug delivery for serious neurological diseases. <sup>1-3</sup> For such applications, we need numerical solutions of both parabolic and elliptic partial differential equations that describe fluid flow and particle transport in tissue allowing for the inhomogeneities and anisotropies that are necessarily prevalent in such a medium. <sup>4</sup> (Of course, such equations have a vastly greater field of applications than our own current interests.) We have used the probabilistic representations that mathematicians had worked out for such general cases (with nonconstant coefficients and anisotropic diffusion) utilizing in particular the results detailed in the monograph. <sup>5</sup> For this purpose we need to simulate Brownian processes with arbitrary drift vector field v ( x ) and Abbreviations: PDE, partial differential equation [This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the](http://creativecommons.org/licenses/by/4.0/) original work is properly cited. © 2020 The Authors. _Engineering Reports_ published by John Wiley & Sons, Ltd. diffusion tensor field D ( x ). In our applications, these fields vary spatially but are considered to be fixed temporally. We shall not discuss the case where these fields are inhomogeneous in time as well. It is important in our applications that these fields vary in the medium so that we cannot directly use solution representations for homogeneous media. We have made use of the general formulas for such spatially dependent equations in both initial value as well as boundary value (and initial/boundary value) problems, as has been indicated in our work quoted. <sup>4</sup> We omit references that are specialized to solution representations for homogeneous media, which may be obtained from stochastic walks on the boundary of the medium. Other workers have used simulation of general Brownian processes for other purposes. In particular, the works of References 6 and 7 have pointed out that the straightforward way of simulating a Brownian walk can be quite inefficient. In their papers, they had large homogeneous regions, and the standard way of simulation is to undertake given time steps Δ _t_ which need to be sufficiently small so that the walker is likely to remain in a region of constant drift and diffusion coefficients, with a probability close to unity, according to the accuracy desired. Then the step length is sampled from a Gaussian distribution, the step direction being uniformly distributed over the area of a sphere. For most applications, this ends up being too demanding and the simulation times become unacceptably large even for modest accuracies <sup>6,7</sup> because the requirement on the time step remaining small is too stringent. In order therefore to simulate the random walk more efficiently, <sup>6,7</sup> we need to be able to take as large a step as the homogeneity of diffusion coefficients allow (in their case), or as the constancy of drift vector v and diffusion tensor D allow for the more general cases. In fact, we need to convert from a fixed time step method to a process with fixed step length Δ _R_ . This means that we need to compute the distribution of the hitting time _T_ and hitting place _XT_ on a convenient surface when a particle with drift and diffusion is released from a point within the center of the volume enclosed by the surface, assuming sufficient symmetry. Then the simulation may proceed by choosing a point on the surface with the specified hitting place distribution, and marking a random time as having elapsed, chosen according to the hitting time distribution. The simulation then continues in a similar fashion from this point on. We denote the surface by _?_  and the closure of its interior by . The purpose of this paper is to generalize to the case of a drift velocity field (and an anisotropic diffusion tensor field), the results on hitting time in, <sup>6</sup> which were restricted to the case of the standard Wiener process of isotropic diffusion in the absence of drift. Once we have obtained these distributions, we need to find the inverse functions in order to simulate the walk, <sup>*</sup> at least in one standard way of generating random variables. It will turn out that the distributions (including the cases found earlier) are expressed as formal power series which are not uniformly convergent, and indeed very poorly convergent and essentially useless for “smaller” steps, where the meaning of “smaller” will be quantified below (essentially where the distribution is not very close to unity as a matter of fact). We therefore develop resummed series with fast convergence by using the Poisson summation formula. To obtain random samples for simulation, we indicate one simple form for the numerical inverse that we have used extensively. However, the principal purpose of this paper is to compute the hitting time distributions in useful (rapidly convergent) form for whatever purposes they may serve for the community. After this work was completed, we became aware of two papers <sup>8,9</sup> in this area that have been published. We now reference their work in the section where we write the relevant formulas (Equations (32) and (34) in Section 5.3) which were previously obtained by these authors by other means, and we discuss their work in more detail in our Conclusion section. We compute the distributions required in three steps. First, we review the known results on this distribution when there is no drift, and the diffusion is isotropic. Then, we compute the distribution for the case where there is drift, and make some remarks for the case we are actually interested in, where the diffusion is anisotropic as well. All results are restricted to three dimensions. Then we compute a better convergent representation of the hitting time, in several ways. We build on deep results obtained by mathematicians decades ago. The principal results obtained here are the hitting distributions (Section 5.3). In the appendices, we develop some formulas that would otherwise have impeded the discussion in the main text. The notation we use in this paper is summarized in Table 1. *If a random variable _T_ has as its distribution _P_ ( _t_ ) and if <sup><u>←−</u></sup> _t_ ( _u_ ) is its inverse, that is, <sup><u>←−</u></sup> _t_ ( _P_ ( _t_ )) = _t_ ; _P_ ~~(~~ <u>←−</u> _t_ ( _u_ ) ~~)~~ = _u_, then if _u_ is a uniformly distributed random variable in the range [0 _,_ 1], the variable <sup>←−</sup> _t_ ( _u_ ) will have the distribution _P_ . In the language of composite functions, we would express the inverse relationship as saying that <sup>←−</sup> _t_ - _P_ and _P_ - <sup>←−</sup> _t_ each maps its respective domain onto itself and is the identity thereon. TA B L E 1 Symbols used and their meaning ~~Symbol~~ ~~Meaning~~ _TH_ First hitting time to a sphere from origin.; _TH_ ∈] 0 _,_ ∞[ ~~X~~ _H_ ~~Hitting place on the sphere at time~~ _~~T~~_ _H_ v _, v,_ D _, D_ drift vector field, _v_ = ‖ v ‖, diffusion tensor field, isotropic diffusion coefficient _~~V~~_ ~~dimensionless drift speed~~ _pV_ ( _._ ) _, PV_ ( _._ ) probability density, (cumulative) probability distribution of _TH_ for drift speed _V_ ~~~~ ~~[◦]~~ ~~Expected value of random variable defined in the parentheses~~ ←− _t_ _V_ ( _._ ) (exact) inverse function to _PV_ : maps the unit interval onto the positive real line _~~p,~~_ _̂_ _~~P,~~_ _̂_ _~~T,~~_ _̂_ _~~t~~_ _V_ ~~approximations to~~ _~~p, P, T,~~_ <sup><u>←−</u></sup> _~~t~~_ ~~, respectively, with subscripts as for the unhatted symbols~~ _t_ ∈] 0 _,_ ∞[ (dimensionless) argument of the hitting time distributions _~~u~~_ ~~∈] 0,1 [~~ ~~(dimensionless) argument of the inverse functions~~  _n_ Legendre polynomial of order _n_ Before we commence our study proper of the hitting time distributions, we make some remarks about our original motivation, namely applications in computational medicine to drug delivery. All formulas of the basic probabilistic solutions are deferred to Appendix A, since they are only background, and none of the results developed in this paper are dependent on the formulas quoted in this appendix. 1.1 Probabilistic representations for partial differential equations and their application to advective transport in biomedicine We refer to our papers such as Reference 4, which provides details of our application interests. The equations are those for the transport of therapeutic molecules in solutions injected directly into brain (and other) tissue and are thereby carried (advected) by the flow of the fluid. The equations describing the transport of the molecule are therefore of the advection-diffusion type, along with processes that account for losses of the molecule and of excess fluid. The losses of fluid and molecule are through escape into the system circulation (blood vessels). In addition, molecules are lost through degradation, binding, and other mechanisms. In this paper, we will include only linear loss rates. The equations are of parabolic type, (heat equation in inhomogeneous and anisotropic media) and Appendix A quotes the mathematicians' probabilistic representation <sup>5</sup> of solutions for such equations, and discusses the correspondence between the parameters to translate from their formulas to the equations used in our application. The advection term involves the fluid velocity; therefore in the application, the fluid velocity must be solved for first before the solutions for drug distribution can be obtained. The equation for fluid flow is that of slow flow in porous media using Darcy's law, and these equations are of elliptic type (Laplace's equation for inhomogeneous and anisotropic media). The corresponding discussion of this equation and the representation used for its solution are described in a subsection of the appendix. We have chosen to use probabilistic methods to solve for the equations, rather than the more traditional finite element methods, because they can more directly incorporate volumetric data obtained from three-dimensional magnetic resonance imaging; they are very amenable to parallelization; they can be used to compute the solution in selected points or regions; and other advantageous characteristics that are mentioned in the paper quoted, with results and further discussion shown for example in <sup>3</sup> and other publications referred to therein. 2 BROWNIAN MOTION HITTING TIME TO A SPHERE We first define the hitting time _TH_ and hitting place X _H_ . A stochastic process is first defined, for example, the standard Brownian motion. A particle whose trajectory is defined by this process is released at the origin (or any determined starting point). Then _TH_ is the first time when, and X _H_ the corresponding place (provided _TH_ is finite) where, the particle hits a sphere of radius _R_ centered on the origin (or the starting point, in general). These are random variables, and in the case of standard Brownian motion, that is, isotropic diffusion without drift, Wendel <sup>10</sup> derived the moment generating function (up to a sign) for the probability distributions of these variables, in arbitrary dimension and with arbitrary starting point. We will only be interested where the starting point is the center of the sphere in question embedded in three-dimensional Euclidean space. Specializing his result to starting at the center, and restoring the diffusivity _D_ <sup>†</sup> and radius _R_ of the sphere, his calculation yields for the moment generating function for _TH_, [ _e_ <sup>−</sup> <sup>_?T_</sup> <sup>]</sup> [ = ~~√~~ ~~<u>)</u>~~ _._ (1)  ( _?_ ) ∶=  _R_ <sup>2</sup> _?_ ∕ _D_ sinh ~~(√~~ _R_ <sup>2</sup> _?_ ∕ _D_ In this case, the distribution for the hitting place is obviously uniform with respect to the area measure on a sphere, and also obviously independent of the hitting time distribution. The hitting time density therefore is the inverse Laplace transform of the above: ~~√~~ ~~<u>)</u>~~ _dz,_ (2) <u>1</u> _p_ ( _T_ ) = 2 _?i_ ∫ _?_ _?_ + _i_ ∞ _e_ <sup>_zT_</sup> _R_ <sup>2</sup> _z_ ∕ _D_ _?_ - _i_ ∞ sinh ~~(√~~ _R_ <sup>2</sup> _z_ ∕ _D_ where the line of integration parallel to the imaginary axis must be taken to the right of all the singularities of the integrand. The contour must be closed to the left ( _e_ <sup>_zT_</sup> → 0). The singularities are simple poles at _zn_ = − _Dn_ <sup>2</sup> _?_ <sup>2</sup> ∕ _R_ <sup>2</sup> _, n_ = 1 _,_ 2 _,_ 3 _,_ … _,_ (3) that is, along the negative _x_ −axis. We therefore choose the real _?_ to be slightly negative, and close the contour by a large semicircle which avoids hitting any pole. The integrand is vanishingly small for negative real part as the contour extends to infinity. Since (√ <u>)</u> _R_ <sup>2</sup> ( _zn_ + _?_ ) ∕ _D_ = <sup>_<u>R</u>_</sup> <sup>2</sup> <sup>_<u>R</u>_</sup> <sup>2</sup> ~~√~~ _<u>?</u>_ 2 _D_ - _n_ - _n_ <sup>2</sup> _?_ <sup>2</sup> <u>)</u> = _?_ <sup>_<u>R</u>_</sup> <sup>2</sup> <sup>_<u>R</u>_</sup> <sup>2</sup> ~~√~~ <u>(−1)</u> <sup>_n_</sup> 2 _D_ - _n_ <sup>2</sup> _,_ ( cosh ~~√~~ - _n_ <sup>2</sup> _?_ <sup>2</sup> sinh - _n_ <sup>2</sup> _?_ <sup>2</sup> upto linear order in _?_, the integral is evaluated by residues: ( ) _p_ ( _T_ ) = 2 <sup>_<u>D</u>_</sup> _R_ <sup>2</sup> ∑∞ _n_ =1 (−1) <sup>_n_</sup> <sup>+1</sup> _n_ <sup>2</sup> _?_ <sup>2</sup> exp - <sup>_<u>Dn</u>_</sup> <sup>2</sup> <sup>_<u>?</u>_</sup> <sup>2</sup> <sup>2</sup> <sup>_<u>?</u>_</sup> <sup>2</sup> _T_ _R_ <sup>2</sup> _._ (4) The cumulative distribution then has the representation: ∑∞ _n_ =1 ( ) - <sup>_<u>Dn</u>_</sup> <sup>2</sup> <sup>_<u>?</u>_</sup> <sup>2</sup> <sup>2</sup> <sup>_<u>?</u>_</sup> <sup>2</sup> _T_ _R_ <sup>2</sup> _P_ ( _T_ ) = 1 + 2 (−1) <sup>_n_</sup> exp _._ (5) The right-hand side is a convergent series for _T >_ 0, but (i) the number of terms required for a fixed error bound increases without limit as _T_ → 0 (it is thus not uniformly convergent), and (ii) the inverse function to the above, which we denote <sup>←−</sup> _t_ 0 ( _u_ ), 0 ≤ _u_ ≤ 1, which is needed for numerical simulations is not expressible as a standard function. The standard way of taking care of the first problem is with the Poisson summation formula. <sup>11</sup> We examine these issues in a later section. But first we generalize to the case with drift, and then to anisotropy. The results above for isotropic diffusion have been previously obtained; <sup>6</sup> however, the paper omits all mention for the need of a better convergent series. †In comparing formulas, it is necessary to note a difference between the mathematician's and the engineer's use of the diffusion equation. The √ mathematician uses the normalized Gaussian _u_ = exp <sup>(</sup> - _x_ <sup>2</sup> ∕2 _t_ <sup>)</sup> ∕ 2 _?t_ with variance equal to _t_ as the fundamental solution of the diffusion equation √ mathematician uses the normalized Gaussian _u_ = exp <sup>(</sup> - _x_ <sup>2</sup> ∕2 _t_ <sup>)</sup> ∕ 2 _?t_ with variance equal to _t_ as the fundamental solution of the diffusion equation with unit diffusivity (in one dimension). Since the expression is a solution of _?u_ ∕ _?t_ = <sup><u>1</u></sup> 2 <sup>_?_</sup> <sup>2</sup> <sup>_u_</sup> <sup>∕</sup> <sup>_?x_</sup> <sup>2, there is a factor of</sup> <sup><u>1</u></sup> 2 <sup>which is absent in the equation</sup> physicists and engineers use for the diffusion equation with unit diffusivity. We will use the normalized solution to ( _D?_ <sup>2</sup> ∕ _?x_ <sup>2</sup> - _v?_ ∕ _?x_ - _?_ ∕ _?t_ ) _f_ = 0 to be exp <sup>(</sup> −[ _x_ - _vt_ ] <sup>2</sup> ∕4 _Dt_ <sup>)</sup> ∕2√ _?Dt_ . Further we note that if _??_ ( _x_ ) is an eigenfunction of _D?_ <sup>2</sup> ∕ _?x_ <sup>2</sup> with eigenvalue _?_, then exp ( _vx_ ∕2 _D_ ) _??_ ( _x_ ) is an √ be exp <sup>(</sup> −[ _x_ - _vt_ ] <sup>2</sup> ∕4 _Dt_ <sup>)</sup> ∕2 _?Dt_ . Further we note that if _??_ ( _x_ ) is an eigenfunction of _D?_ <sup>2</sup> ∕ _?x_ <sup>2</sup> with eigenvalue _?_, then exp ( _vx_ ∕2 _D_ ) _??_ ( _x_ ) is an eigenfunction of _D?_ <sup>2</sup> ∕ _?x_ <sup>2</sup> - _v?_ ∕ _?x_ with eigenvalue _?_ - _v_ <sup>2</sup> ∕4 _D_ . 3 ISOTROPIC BROWNIAN MOTION WITH DRIFT The above results concerned isotropic Brownian motion with no drift. In order to compute what we want with a deterministic drift velocity included, we begin with a special case of a theorem that Wendel proved in another paper, <sup>12</sup> namely that the joint distribution of hitting time and place, even when drift is included, factorizes for isotropic Brownian motion when a particle released at the center of the sphere. As he remarks, this is a somewhat surprising result. The reason that intuition seems to suggest differently can be perhaps be illustrated with a simple example. Suppose the particle has a strong drift toward the north pole, starting at the center. Then intuition says that the particle is more likely to exit the sphere first from the north pole rather than the south, which is true. However, we sometimes confuse this with: the likelihood it will exit first from the north pole rather than the south is higher for small times, which is false. In fact, as is well known, diffusion is more important the shorter the time; in any case the theorems state that the time and place distributions are independent. This theorem is very useful, indeed crucial for simulations since otherwise the joint distribution of hitting time and place, if not factorizable, would be too complicated for effective use. In any case, in that same paper he quotes an even then standard result: _F_ exp ( - _v_ <sup>2</sup> _T_ ∕2 + v ⋅ X _T_  <sup>v</sup> [ _F_ ] =  [ )] _,_ (6) where the left-hand side is the expectation under Brownian motion _with_ drift v of any function _F_ on the path, while the right-hand side is the expectation under the standard Brownian motion (without drift). We write down the generalization of this formula to the case of a general diffusivity, taking account of the factor of 2 mentioned in the earlier footnote: ( - <sup>_<u>v</u>_</sup> 4 <sup>2</sup> _D_ <sup>_<u>T</u>_</sup> <sup>+</sup> <sup><u>v</u></sup> <sup><u>⋅</u></sup> 2 _D_ <sup><u>X</u></sup> <sup>_<u>T</u>_</sup> )]  <sup>v</sup> [ _F_ ] =  [ _F_ exp - <sup>_<u>v</u>_</sup> 4 <sup>2</sup> _D_ <sup>_<u>T</u>_</sup> Choose to obtain ( ) _._ (7) _,_ (8) _F_ ∶= exp (− _?T_ ) exp - <sup><u>v</u></sup> <sup><u>⋅</u></sup> <sup><u>X</u></sup> <sup>_<u>T</u>_</sup> 2 _D_ { ( }] _T_ ~~√~~ ( 2 _D_ )] ~~<u>)</u>~~ (9) ) sinh  <sup>v</sup> [ exp (− _?T_ ) exp - <sup><u>v</u></sup> <sup><u>⋅</u></sup> <sup><u>X</u></sup> <sup>_<u>T</u>_</sup> [ exp _?_ + <sup>_<u>v</u>_</sup> <sup>2</sup> 4 _D_ _?_ + <sup>_<u>v</u>_</sup> <sup>2</sup> = ~~(√~~ _?R_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup> =  _,_ _?R_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup> from the above. In preparation to computing the hitting time and place densities, we note from Wendel that the following is also true: ( - <sup><u>v</u></sup> <sup><u>⋅</u></sup> <sup><u>X</u></sup> <sup>_<u>T</u>_</sup> 2 _D_ ]  _n_ ( _?_ ) ( 2 _D_ ]  _n_ ( _?_ ) ) )  <sup>v</sup> [ exp (− _?T_ ) exp - <sup><u>v</u></sup> <sup><u>⋅</u></sup> <sup><u>X</u></sup> <sup>_<u>T</u>_</sup> ≡ <sup>v</sup> [ exp (− _?T_ ) exp - <sup>_<u>vR?</u>_</sup> = 0 _, n_ ≠ 0 _,_ (10) where _?_ is the cosine of the polar angle of the hitting place with the _z_ -axis chosen along v . We use a calligraphic font for the Legendre polynomial  _n_, so that it is not confused with a symbol for probabilities. For _n_ = 0, we of course reproduce Equation (9). This therefore gives us distribution of hitting time and place by writing out the left-hand side as ∞ 1 0 _dT_ ∫ _d?_ exp (− _?T_ ) exp (− _vR?_ ∕2)  _n_ ( _?_ ) _p_ 1 ( _T_ ) _p_ 2 ( _?_ ) _._ (11) ∫ −1 The spatial transform then is computed (in general) by the Fourier-Legendre series, ∑ _an_  _n_ ( _?_ ) _,_ (12) _n_ ≥0 _an_ = <sup><u>2</u></sup> <sup>_<u>n</u>_</sup> <sup><u>+ 1</u></sup> 2 ∫ 1 _d?_  _n_ ( _?_ ) _f_ ( _?_ ) ⇔ _f_ ( _?_ ) = −1 where only the term with _n_ = 0 survives. Thus we immediately obtain the density function for hitting _place_ _p_ 2 ( _?_ ) =  <sup>−1</sup> exp ( _vR?_ ∕2 _D_ ) _,_ (13) and  is computed by normalization, so that  = 2 <sup><u>sinh (</u></sup> <sup>_<u>vR</u>_</sup> <sup><u>∕2</u></sup> <sup>_<u>D</u>_</sup> <sup><u>)</u></sup> _._ (14) ( _vR_ ∕2 _D_ ) Together Equations (13) and (14) give us the polar angle distribution. The distribution in azimuthal angle is uniform due to symmetry. Plugging Equation (14) into Equation (11), we see that the moment–generating function for the hitting time distribution is ∞ ~~√~~ ~~<u>)</u>~~ _._ (15) ∞ _dT_ exp (− _?T_ ) _p_ 1 ( _T_ ) = <sup><u>sinh (</u></sup> <sup>_<u>vR</u>_</sup> <sup><u>∕2</u></sup> <sup>_<u>D</u>_</sup> <sup><u>)</u></sup> 0 ( _vR_ ∕2 _D_ ) _?R_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup>  _V_ ( _?_ ) ∶= ∫ ( _vR_ ∕2 _D_ ) sinh ~~(√~~ _?R_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup> Thus, the mean hitting time is <sup>′</sup> _V_ <sup>(0) =</sup> <sup>_<u>R</u>_</sup> _v_ _T_ = − <sup>′</sup> _v_ <u>cosh (</u> _<u>vR</u>_ <u>∕2</u> _<u>D</u>_ <u>)</u> (16) sinh ( _vR_ ∕2 _D_ ) <sup>−</sup> <sup>2</sup> _v_ <sup>_<u>D</u>_</sup> <sup>2</sup> <sup>_._</sup> The mean time approaches _R_ ∕ _v_ as _v_ becomes large, as it should. However for finite values of _vR_ ∕ _D_, the time is always less than this limiting form by the factor cosh ( _vR_ ∕2 _D_ ) ∕ sinh ( _vR_ ∕2 _D_ ) − 2 _D_ ∕ _vR_, which lies between 0 and 1 as the speed increases from 0 to ∞ (“diffusion always helps”). The density function is then the inverse Laplace transform: ~~√~~ ~~<u>)</u>~~ _dz,_ (17) <sup><u>1</u></sup> 2 <sup></sup> 2 <sup><u>1</u></sup> _?i_ ∫ _?_ + _i_ ∞ _p_ 1 ( _T_ ) = <sup><u>1</u></sup> 2 _?_ - _i_ ∞ _e_ <sup>_zT_</sup> _zR_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup> sinh ~~(√~~ _zR_ <sup>2</sup> ∕ _D_ + _v_ <sup>2</sup> _R_ <sup>2</sup> ∕4 _D_ <sup>2</sup> ) <sup>_<u>v</u>_</sup> <sup>2</sup> 4 _D_ <sup>_T_</sup> ( ( _,_ (18) = 2 <sup><u>1</u></sup> <sup></sup> <sup><u>2</u></sup> _R_ <sup>_<u>D</u>_</sup> <sup>2</sup> ∑∞ _n_ =1 ) exp (−1) <sup>_n_</sup> <sup>+1</sup> _n_ <sup>2</sup> _?_ <sup>2</sup> exp - <sup>_<u>D</u>_</sup> _R_ <sup>_<u>D</u>_</sup> _R_ <sup>2</sup> <sup>_n_</sup> <sup>2</sup> <sup>_?_</sup> <sup>2</sup> <sup>_T_</sup> - <sup>_<u>v</u>_</sup> <sup>2</sup> 4 using the method of residues from the previous section. The cumulative hitting time distribution is ( ( - <sup>_<u>v</u>_</sup> <sup>2</sup> 4 ) <sup>_<u>v</u>_</sup> <sup>2</sup> 4 _D_ <sup>_T_</sup> ) exp _._ (19) 4 <sup>_<u>v</u>_</sup> _D_ <sup>2</sup> - _R_ <sup>_<u>D</u>_</sup> <sup>2</sup> <sup>_n_</sup> <sup>2</sup> <sup>_?_</sup> <sup>2</sup> <sup>_T_</sup> - _R_ <sup>_<u>D</u>_</sup> <sup>2</sup> _RD_ <sup>2</sup> <sup>_n_</sup> <sup>2</sup> <sup>_?_</sup> <sup>2 +</sup> 4 <sup>_<u>v</u>_</sup> _D_ <sup>2</sup> (−1) <sup>_n_</sup> _n_ <sup>2</sup> _?_ <sup>2 exp</sup> _P_ 1 ( _T_ ) = 1 + 2 <sup><u>sinh (</u></sup> <sup>_<u>vR</u>_</sup> <sup><u>∕2</u></sup> <sup>_<u>D</u>_</sup> <sup><u>)</u></sup> ( _vR_ ∕2 _D_ ) _<u>D</u>_ _R_ <sup>2</sup> ∑∞ _n_ =1 Equations (13) and (19) together with the definition (14) give us the required distributions for a sphere for a particle released at the center, albeit as power series which do not converge for _T_ = 0 _, v_ = 0. In fact the convergence of this series is extremely poor except for very large T where the distribution is almost unity. Before we return to this topic, we discuss the final generalization, namely where the diffusion is generally anisotropic. 4 ANISOTROPIC DIFFUSION _The joint distribution of hitting time and place on the surface of a sphere does not factorize in the case of anisotropic diffusion._ This follows from a theorem proved by Pitt <sup>13</sup> which asserts that if the joint distribution factorizes for standard (isotropic) Brownian motion and drift, the hitting surface must be a sphere. (Again we specialize all results to the three-dimensional case we are interested in.) So, let us transform from the laboratory coordinate system to one in which the diffusion tensor is diagonal. We write Λ ∶=  <sup>_T_</sup> D _,_ (20) where the rotation  results in Λ being diagonal. We further write B ∶= ~~√~~ Λ _,_ (21) and define the new dimensional coordinates _?_ ∶= B <sup>−1</sup>  <sup>_T_</sup> x _,_ (22) so that the diffusion operator becomes isotropic in these coordinates: ∑3 _i_ =1 _??_ <sup>2</sup> _i_ _<u>?</u>_ <sup>2</sup> _._ (23) In this system, then, the Brownian motion is isotropic, and hence, from Wendel, the joint distribution factorizes for the sphere, but more importantly for _only_ the sphere, (by Pitt's theorem) in this space. This sphere becomes an ellipsoid in the original coordinates, so we have shown that the distribution, while factorizing for this ellipsoid, will not factorize for the original sphere in the case of anisotropic diffusion. We therefore choose to solve a different problem. We have the freedom to do so, since our purpose is to speed up the simulation, and any convenient surface will do. We therefore solve the problem for the sphere in _?i_ −space using the formulas of the previous section for a sphere. The hitting place is mapped to the corresponding point on the ellipsoid + <sup>_<u>z</u>_</sup> <sup>2</sup> _d_ 3 _<u>x</u>_ <sup>2</sup> _d_ 1 + <sup>_<u>y</u>_</sup> <sup>2</sup> _d_ 2 = 1 _,_ (24) in _rotated_ laboratory space, where the _di_ 's are the eigenvalues of the diffusion tensor. Since (  <sup>_T_</sup> x ⋅ ∇ _?_ _,_ (25) ∇ x = B <sup>−1</sup> ∇ ) the drift velocity becomes v ⋅ B <sup>−1</sup> ∇ <sup>(</sup>  <sup>_T_</sup> x <sup>)</sup> _._ (26) The _i_ <sup>′</sup> th (in the _?_ −system) coordinate of the velocity is thus _v?_ <sup><u>1</u></sup> _b?_  <sup>_T_</sup> _i?_ <sup>_._</sup> (27)  <sup>_T_</sup> _i?_ We have thus reduced the case with anisotropic diffusion to a previously solved problem, in a special coordinate system. To avoid any misunderstanding, we should perhaps indicate why, instead of using a coordinate transformation so that the anisotropic equation is transformed to a Laplace equation, we do not solve the Laplace equation with the relevant boundary conditions. We recall that it is essential to our applications that the medium (the brain) is inhomogeneous with differing properties or metrics in different portions of the medium. In applications in computational biomedicine specifically, there is an image for example from magnetic resonance which has voxels of about a millimeter in each side. The conductivity, say, is a constant (or, more precisely, averaged) within a voxel, but varies from voxel to voxel. The anisotropies vary as well. If one were to solve the Laplace equation (and one would do that if the _entire_ volume of medium were simply anisotropic but _homogeneous_ ), one would be faced with an essentially impossible problem of matching voxel to voxel. Our application papers referred to in the Introduction discuss this issue as well. 5 THE HITTING TIME AND PLACE DISTRIBUTIONS In this section, we develop the formulas which will serve as the basis for simulating random walks of fixed step length and random times, in contrast to the conventional Gaussian process simulating the walk in a fixed time, with random step lengths, and in contrast to the poorly converging series for these hitting times obtained above. First, we quote the Poisson summation formula. Then, for convenience, we henceforth convert to dimensionless variables since the distributions depend only on these. After these preliminaries, we obtain the formulas. 5.1 The Poisson resummation In order to improve the convergence of the series above for smaller times, we resort to the Poisson summation formula, which we quote here as follows. Define the Fourier transform ∞ _F_ ( _x_ ) ∶= ∫−∞ _dy_ exp (− _i_ 2 _?xy_ ) _f_ ( _y_ ) _._ (28) Then for nicely behaved functions ∑∞ _n_ =−∞ _f_ ( _n_ ) = ∑∞ _F_ ( _k_ ) _,_ (29) _k_ =−∞ where the sums are over integer values. (Any text or online source may be consulted for the conditions for validity of the Poisson summation.) However, before performing the computations, we shall first work with simplified formulas by defining dimensionless variables. 5.2 Dimensionless variables We define the dimensionless time and speed variables <sup>‡</sup> : <sup>_<u>D</u>_</sup> _V_ ∶= <sup><u>1</u></sup> _R_ <sup>2</sup> <sup>_T_</sup> <sup>;</sup> 2 _?_ ∶= <sup>_<u>D</u>_</sup> _R_ <sup><u>1</u></sup> _<u>vR</u>_ (30) 2 _?_ <sup>2</sup> _D_ <sup>_._</sup> We can see that the distributions depend on the dimensional variables _D, T, R,_ and _v_ only through these dimensionless combinations. The density function (since it is not dimensionless itself) also depends on the Jacobian, which in this case just means using the chain rule. _Remark_ 1 _._ We continue to use the same symbols for the distribution and densities. No confusion should result with the above defined functions, since we shall use only the dimensionless variables as the independent ones henceforth. 5.3 Calculating the distributions We first note that the cumulative distribution for the hitting place on a sphere is, from Equations (13) and (14), ) - exp ) ( _?_ <sup>2</sup> _V?_ ~~(~~ 2 sinh ( - _?_ <sup>2</sup> _V_ _PS_ ( _?_ ) = exp _?_ <sup>2</sup> _V_ ~~)~~ _._ (31) This is readily inverted to yield ) _,_ (32) _?_ <sup>2</sup> _V_ _u_ + exp )] _?_ <sup>2</sup> _V_ ( - _?_ <sup>2</sup> _V_ _?_ = ln [ ( 2 sinh for the random variable _?_, −1 ≤ _?_ ≤ 1, as a function of the number _u_ between 0 and 1. Thus the hitting place distribution offers no difficulty in inversion, and hence none for sample generation as well, where _u_ is chosen to uniformly distributed in [0 _,_ 1]. ‡The perhaps unnecessary introduction of the factor _?_ 2 has been incorporated into our software, and so for consistency we have retained it here. Turning to the hitting time distributions, and using the dimensionless variables introduced in Equation (30), let us first examine the series for the density function for _V_ = 0, already available in the literature, as we have mentioned: ∑∞ _n_ =−∞ _<u>d</u>_ _d?_ [exp ( _i?n_ ) exp (− _?_ 2 _?n_ 2)] _._ (33) _p_ 0 ( _?_ ) = ∑∞ _n_ =−∞ (−1) <sup>_n_</sup> <sup>+1</sup> _n_ <sup>2</sup> _?_ <sup>2</sup> exp <sup>(</sup> - _?_ <sup>2</sup> _?n_ <sup>2)</sup> = Of course we have to remove the Jacobian from the dimensionfull form of the density, in order that the normalization ∫0 <sup>∞</sup> <sup>_d?p_</sup> <sup>0 (</sup> <sup>_?_</sup> <sup>) = 1 is satisfied. From the form of the series, the density can also be expressed as twice the sum of the series,</sup> summed over positive integers only. As stated, these forms for the densities are suitable for large enough _<u>?</u>_ <u>, when they</u> √ converge rapidly, but obviously not for small _?_ . We have to go up to terms beyond the integer part of 1∕ _?_ <sup>2</sup> _?_ before √ converge rapidly, but obviously not for small _?_ . We have to go up to terms beyond the integer part of 1∕ _?_ <sup>2</sup> _?_ before the series begins to behave. For _?_ ∼ 0 _._ 1, this means going beyond 10 terms, and the situation is much worse for the distributions where the drift speed is relevant. As a warm up for the case of actual interest (with nonzero speed), we apply the Poisson summation formula to obtain series that are rapidly convergent for small _?_ . Denote the _y_ <sup>′</sup> th term within the differentiation sign in Equation (33): _f_ ( _y_ ) ∶= exp <sup>(</sup> - _?_ <sup>2</sup> _?y_ <sup>2)</sup> exp ( _i?y_ ) _,_ (34) so that its Fourier transform is <u>1</u> _F_ ( _x_ ) = ~~√~~ _??_ <u>1</u> _F_ ( _x_ ) = ~~√~~ exp <sup>[</sup> −(2 _x_ - 1) <sup>2</sup> ∕4 _?_ <sup>]</sup> _._ (35) Thus from Equation (29) we get for the zero drift case that the density function may also be written in the form [ ] _._ (36) [ <u>1</u> ~~√~~ _??_ _PSp_ 0 ( _?_ ) = ∑∞ _k_ =−∞ _<u>d</u>_ _d?_ ] exp −(2 _k_ - 1) <sup>2</sup> ∕4 _?_ Noting that the series defining _p_ 0 ( _?_ ) converges best for large _?_, we can write the corresponding distribution as ∞ _P_ 0 ( _?_ ) = 1 − ∫ _?_ _d?p_ 0 ( _?_ ) _,_ (37) ∑∞ (−1) <sup>_n_</sup> <sup>+1</sup> _n_ <sup>2</sup> _?_ <sup>2</sup> exp _n_ =1 (− _?_ <sup>2</sup> _?n_ <sup>2)</sup> _,_ (38) = 1 − 2 ∫ _?_ ∞ _d?_ ∑∞ _n_ =1 = 1 + 2 (−1) <sup>_n_</sup> exp <sup>(</sup> - _?_ <sup>2</sup> _?n_ <sup>2)</sup> _._ (39) The distribution corresponding to the Poisson resummed density is also immediate: _PSp_ 0 ( _?_ ) = _PS_ _d?_ 0 _?_ exp <sup>[</sup> −(2 _k_ - 1) <sup>2</sup> ∕4 _?_ <sup>]</sup> _._ (40) <u>1</u> ~~√~~ _??_ <u>1</u> ~~√~~ _P_ 0 ( _?_ ) = ∫ ∑∞ _k_ =−∞ (The zero- _?_ limit of the expression on the right-hand side is of course zero for all _k_, and increasingly rapidly with the magnitude of _k_ .) Now, for nonzero speeds, from Equation (18), the density is just _pV_ ( _?_ ) =  exp <sup>[</sup> - _?_ <sup>4</sup> _V_ <sup>2</sup> _?_ <sup>]</sup> _p_ 0 ( _?_ ) _._ (41) Thus, using the Fourier transform and integrating by parts, the Poisson resummed density is immediate: _._ (42) _PSp V_ ( _?_ ) =  exp [− _?_ 4 _V_ 2 _?_ ] ∑∞ _k_ =−∞ [ ] exp <sup>[</sup> −(2 _k_ - 1) <sup>2</sup> ∕4 _?_ <sup>]</sup> _<u>d</u>_ _d?_ <u>1</u> ~~√~~ _??_ As for the zero drift speed case, the distribution corresponding to _pV_ ( _?_ ) may be obtained from Equation (37), now with the subscript _V_ . The expression for _pV_ ( _?_ ) is integrated by parts, the integrations are elementary, and after consolidation of terms, we obtain _PV_ ( _?_ ) = 1 + 2 exp <sup>[</sup> - _?_ <sup>4</sup> _V_ <sup>2</sup> _?_ <sup>]</sup> ∑ <sup>∞</sup> _n_ =1 _<u>n</u>_ <sup>2</sup> (−1) <sup>_n_</sup> (43) _n_ <sup>2</sup> + _?_ <sup>2</sup> _V_ <sup>2</sup> <sup>exp (−</sup> <sup>_?_</sup> <sup>2</sup> <sup>_?n_</sup> <sup>2)</sup> <sup>_._</sup> _PS_ There are several ways to obtain the Poisson resummed distribution _P V_ and we give three different ways here. Perhaps the simplest is to write, as before, _PS_ _d?_ 0 _?_ _P V_ ( _?_ ) = ∫ _PSp V_ ( _?_ ) _._ (44) Upon integration by parts, the second integral is also expressible in terms of standard functions and the two contributions come out to be: _??_ [ ] −(2 _k_ - 1) <sup>2</sup> ∕4 _?_ ( + <sup><u>1</u></sup> _?_ <sup>2</sup> _V_ 2 <sup>sinh</sup> ] ∑∞ _k_ =−∞ <u>1</u> ~~√~~ ) _PS_ _P V_ ( _?_ ) = sinh <sup>(</sup> _?_ <sup>2</sup> _V_ <sup>)</sup> exp _?_ <sup>2</sup> _V_ [ - _?_ <sup>4</sup> _V_ <sup>2</sup> _?_ [ exp [ [ <u>|2</u> _<u>k</u>_ <u>−</u> <u>1| + 2</u> _<u>?</u>_ <sup>2</sup> _<u>?V</u>_ { erfc ] [ ] - exp ]} _,_ (45) ] erfc - |2 _k_ - 1| _?_ <sup>2</sup> _V_ <u>|2</u> _<u>k</u>_ <u>−</u> <u>1| −</u> <u>2</u> _<u>?</u>_ <sup>2</sup> _<u>?V</u>_ ~~√~~ 2 _?_ |2 _k_ - 1| _?_ <sup>2</sup> _V_ ~~√~~ 2 _?_ × ∑∞ _k_ =−∞ exp where erfc is the complementary error function. A second method is of course to directly transform the expression for _PV_ ( _?_ ). Let us just begin with the series on the right-hand side of Equation (43), call each term within the summation _<u>y</u>_ <sup>2</sup> _g_ ( _y_ ) = (−1) <sup>_y_</sup> (46) _y_ <sup>2</sup> + _?_ <sup>2</sup> _V_ <sup>2</sup> <sup>exp (−</sup> <sup>_?_</sup> <sup>2</sup> <sup>_?y_</sup> <sup>2)</sup> <sup>_._</sup> We note that _g_ ( _y_ ) = − <sup><u>1</u></sup> _?_ <sup>2</sup> _<u>d</u>_ _d?_ ∫ ∞ _d?_ exp <sup>([</sup> - _?_ <sup>(</sup> _?_ <sup>2</sup> _V_ <sup>2</sup> + _y_ <sup>2)])</sup> exp [ _i?y_ ] exp <sup>[</sup> - _?_ <sup>2</sup> _?y_ <sup>2]</sup> _._ (47) 0 ∞ Let us first Fourier transform the expression inside the integral. We have ∞ ( _?_ <sup>2</sup> _V_ <sup>2</sup> + _?_ <sup>2</sup> _y_ <sup>2)])</sup> exp [ _i?y_ ] exp exp (− _i_ 2 _?xy_ ) [ - _?_ <sup>2</sup> _?y_ <sup>2]</sup> ) ([ - _?_ ([ ∫ _dy_ exp −∞ = exp <sup>(</sup> - _??_ <sup>2</sup> _V_ <sup>2) √</sup> _<u>?</u>_ _?_ + _?_ <sup>2</sup> _?_ <sup>exp</sup> ( - <sup>_<u>?</u>_</sup> <sup>2(1 −</sup> <sup><u>2</u></sup> <sup>_<u>x</u>_</sup> <sup><u>)2</u></sup> 4 <sup>~~(~~</sup> _?_ + _?_ <sup>2</sup> _?_ <sup>~~)~~</sup> <sup>_<u>?</u>_</sup> <sup>2(1 −</sup> <sup><u>2</u></sup> <sup>_<u>x</u>_</sup> <sup><u>)2</u></sup> 4 <sup>~~(~~</sup> _?_ + _?_ <sup>2</sup> _?_ <sup>~~)~~</sup> _._ (48) So now we have to integrate over _?_, differentiate with respect to − _?_, and divide the result by _?_ <sup>2</sup> . This gives the Fourier transform _G_ of _g_ as ~~√~~ _G_ ( _x_ ) = exp <sup>[</sup> −(2 _x_ - 1) <sup>2</sup> ∕4 _?_ <sup>]</sup> ∕ _??_ - <sup><u>1</u></sup> 2 <sup>_?_</sup> <sup>2</sup> <sup>_Ve?_</sup> <sup>2</sup> <sup>_V_</sup> <sup>(</sup> <sup>_?_</sup> <sup>2</sup> <sup>_?V_</sup> <sup>−|2</sup> <sup>_x_</sup> <sup>−1|)erfc</sup> [ [ <u>2</u> _<u>?</u>_ <sup>2</sup> _<u>?V</u>_ <u>−</u> <u>|2</u> _<u>x</u>_ <u>−</u> <u>1|</u> ~~√~~ 2 _?_ ] ] _._ (49) - <sup><u>1</u></sup> 2 <sup>_?_</sup> <sup>2</sup> <sup>_Ve?_</sup> <sup>2</sup> <sup>_V_</sup> <sup>(</sup> <sup>_?_</sup> <sup>2</sup> <sup>_?V_</sup> <sup>+|2</sup> <sup>_x_</sup> <sup>−1|)erfc</sup> <u>2</u> _<u>?</u>_ <sup>2</sup> _<u>?V</u>_ <u>+ |2</u> _<u>x</u>_ <u>−</u> <u>1|</u> ~~√~~ 2 _?_ Now let us return to the full expression for the distribution (43). We have to multiply the series by 2 sinh( _?_ <sup>2</sup> _V_ )∕ _?_ <sup>2</sup> _V_ and by exp[− _?_ <sup>4</sup> _V_ <sup>2</sup> _?_ ]. The latter cancels with the corresponding exponentials with positive signs multiplying the erfc terms. We notice that the first complementary error function appears with the opposite sign from the one in Equation (45). We recall that erfc (− _x_ ) = 2 − erfc ( _x_ ) _._ (50) The series sum that arises from the first term in Equation (50) is ] = 2∕ sinh ) _,_ (51) 2 ∑∞ _k_ =−∞ exp [ - |2 _k_ - 1| _?_ <sup>2</sup> _V_ ( _?_ <sup>2</sup> _V_ ( <sup><u>1</u></sup> 2 <sup>sinh</sup> which, upon multiplication with <sup><u>1</u></sup> 2 _?_ <sup>2</sup> _V_ ) which, upon multiplication with <sup><u>1</u></sup> 2 <sup>sinh</sup> _?_ <sup>2</sup> _V_ and with the minus sign in the term, precisely cancels with the 1 in front of the series for the unsummed distribution, yielding again the series first computed. Finally, a third method to obtain this expression is the following. It can be seen from the definitions (34) and (46) that the Fourier transform _G_ of _g_ satisfies the differential equation (4 _?_ 4 _V_ 2 − _d_ 2∕ _dx_ 2) _G_ ( _x_ ) = − _d_ 2∕ _dx_ 2 _F_ ( _x_ ) _,_ (52) where _F_ has already been given in Equation (35). The general solution to this second order differential equation can be seen to have precisely the terms above in Equation (45), _plus_ the following terms: ( _C_ 1 + <sup><u>1</u></sup> exp <sup>(</sup> 2 _?_ <sup>2</sup> _Vx_ <sup>)</sup> + 2 <sup>_?_</sup> <sup>2</sup> <sup>_Ve?_</sup> <sup>4</sup> <sup>_V_</sup> <sup>2</sup> <sup>_?e_</sup> <sup>−</sup> <sup>_?_</sup> <sup>2</sup> <sup>_V_</sup> <sup>)</sup> ( _C_ 2 + <sup><u>1</u></sup> 2 <sup><u>1</u></sup> exp <sup>(</sup> −2 _?_ <sup>2</sup> _Vx_ <sup>)</sup> _,_ 2 <sup>_?_</sup> <sup>2</sup> <sup>_Ve?_</sup> <sup>4</sup> <sup>_V_</sup> <sup>2</sup> <sup>_?e?_</sup> <sup>2</sup> <sup>_V_</sup> <sup>)</sup> where _C_ 1,2 are the two integration constants (ie, independent of _x_ ). Since one or the other of the exponentials that these multiply blows up as _x_ → ±∞, each constant must be chosen to cancel with its respective term in the parenthesis, and so the solution of the differential equation reduces to the result obtained above. The moment generating function is sinh ~~√~~ ~~<u>)</u>~~ (53)  _V_ ( _?_ ) ∶= [(− _??_ )] _pV_ ( _?_ ) = sinh <sup>(</sup> _?_ <sup>2</sup> _V_ <sup>)</sup> _?_ <sup>2</sup> _V_ _<u>?</u>_ <u>+</u> _<u>?</u>_ <sup>4</sup> _<u>V</u>_ <sup>2</sup> ~~(√~~ _._ _?_ + _?_ <sup>4</sup> _V_ <sup>2</sup> _Conclusion_ 1 _._ We have computed the hitting time and place distributions for Brownian motion with drift. In terms of the dimensionless variables introduced in Equation (30), the direct series representation of the hitting time (cumulative) distribution is given in Equation (43) and, what is essential for applications, its Poisson-resummed form which is much better convergent for most of the useful range, in Equation (45). The moment generating function which is useful for other purposes is Equation (53). The corresponding density functions have also been shown above. In numerical simulations, it will be useful to compute the inverse function <sup>←−</sup> _t_ _V_ ( _u_ ) as a function of _u_ ∈]0 _,_ 1[. We employ numerical methods for this, discussed below. 6 NUMERICAL METHODS The distributions calculated above are not directly used in our simulations. We have followed the path of constructing the inverse functions to obtain samples of the needed random variables: the step length of the walk and its direction. As indicated above the direction offers no difficulties, the inverse function (32) is expressible in analytic form and can be evaluated for any input to provide the random direction. The approximate inverse _̂ tV_ ( _u_ ) however presents greater difficulties. There are a multitude of methods for constructing such inverses, including those that match exactly the moments, easily obtained by successive differentiation of Equation (53), of the exact distribution. Our first implementation, which we have used extensively in our simulations with results that have been employed and tested in the complex heterogeneous environments of human patients with brain tumors, <sup>14</sup> is described here, along with its error estimates. Before we do so, we discuss what error estimates we should use. 6.1 Error measures When comparing the use of the approximate random variable _̂ tV_ ( _u_ ) in favor of the exact <sup>←−</sup> _t_ _V_ ( _u_ ), where _u_ is the uniform random variable in the unit interval, we are faced with a variety of choices. The moments of <sup>←−</sup> _t_ _V_ are of course the moments ) _n_ = ∫0 <sup>∞</sup> 0 <sup>1</sup> <sup>_du_</sup> (←− _t_ _V_ ( _u_ ) of the hitting time distribution (∫ <sup>1</sup> 0 ) _n_ of the hitting time distribution (∫0 <sup>1</sup> <sup>_du_</sup> (←− _t_ _V_ ( _u_ ) = ∫0 <sup>∞</sup> <sup>_dt tnpV_</sup> <sup>(</sup> <sup>_t_</sup> <sup>) by changing variables), so it may be thought it would</sup> be sufficient to have an approximation match the moments of the true distribution up to a given order, but this would be a poor error criterion. For example, we may have an inverse that fails to allow probabilities outside a small interval (no hitting time is returned for _u_ outside [ <sup><u>1</u></sup> 2 <sup>−</sup> <sup>_?,_</sup> <sup><u>1</u></sup> 2 <sup>+</sup> <sup>_?_</sup> <sup>], say) and yet match several moments perfectly. In use, the inverse has to</sup> hitting time is returned for _u_ outside [ <sup><u>1</u></sup> 2 <sup>−</sup> <sup>_?,_</sup> <sup><u>1</u></sup> 2 <sup>+</sup> <sup>_?_</sup> <sup>], say) and yet match several moments perfectly. In use, the inverse has to</sup> return times in accordance with the actual distributions for all times, though of course at either end of the interval, larger relative errors can be tolerated. We have therefore chosen to use the relative error using the _L_ <sup>1</sup> norm as our criterion. In other words, we compute × 100 _._ (54) _̂_ 0 <sup>1</sup> <u>←−</u> _t_ _V_ ( _u_ ) _du_ ∫ <sup>1</sup> 0 ←− _t_ _V_ ( _u_ ) − _̂ tV_ ( _u_ )||| _du_ _L_ 1 _err_ ∶= <sup>1</sup> 0 ||| _̂_ ∫ <sup>1</sup> 0 (the denominator on the right-hand side being the mean hitting time) and display this as the percentage error. We have also computed the mean square error compared with the second moment, with errors that are even smaller, so we do not display these. 6.2 Inverse function fits It is obvious from inspection, and shown more systematically in Appendix C, that the singularities in the inverse functions are logarithmic at either end of the unit interval. For _V_ = 0, we used the following piecewise definition for the inverse: _a_ ∕{( _b_ - 4 ln _u_ ) + _c_ ln( _d_ - 4 ln _u_ )} _,_ _u <_ 0 _._ 1 _t_ 0 ( _u_ ) = ⎧ ⎪ ⎨ ⎪⎩ _a_ <sup>′</sup> - _b_ <sup>′</sup> ( _u_ - 0 _._ 1) − _c_ <sup>′</sup> ln(1 − _u_ ) + _d_ <sup>′</sup> ln _u,_ 0 _._ 1 ≤ _u_ ≤ 0 _._ 99 _,_ _a_ <sup>′′</sup> - _b_ <sup>′′</sup> ln (1 − _u_ ) _,_ _u >_ 0 _._ 99 (55) and we fit the various constants to the true inverse obtained by tabulating the distribution, also defined piecewise from Equations (39) and (40) for large and small times, respectively. In practice, the resummed series serves for the entire range. The way we defined the distribution was by careful evaluation of the series, testing convergence and switching over as the argument _?_ increased if the direct series was more economical than the Poisson resummed series. In this regard, it may be worthwhile to point out that we used Mathematica 10 for all of the computations resulting in the inverse functions. Despite the presence of large exponents, Mathematica collects these, allowing cancellations in the exponent before evaluating expressions, and this results in very accurate estimates of the series. Although just one or two terms in the series already yields accuracies to many decimal places, we have checked by evaluating even up to 1024 terms in the series, with no underflow or overflow errors resulting from the Mathematica code. Following the fit of the zero speed inverse with the above form, we use a simple linear fit to the logarithms for any nonzero speed: ln _̂ tV_ ( _u_ ) = _m_ ( _V_ ) ln _̂ t_ 0 ( _u_ ) − _c_ ( _V_ ) _._ (56) We divided the region of speeds from ln _V_ = −5 to +5 in equally spaced intervals of a tenth for every unit (−5 _,_ −4 _._ 9 _,_ …) and found the best fit for the slopes and intercepts from the distributions for the speeds in question. Figure 1A to C shows the slopes, the intercepts, and the percentage errors calculated, respectively, as indicated above. It must be admitted that our ad hoc approach was rather crude: nevertheless the total relative error never exceeded 0 _._ 6 _%_ . The results on test cases where analytic results were available were excellent, the concordance being of course dependent on the number of samples used. However, in all cases for a fixed number of samples, the errors were less than those obtained by direct simulation of Brownian motion using the Gaussian for the step lengths, while fixing the time steps. F I G U R E 1 The simulations used in our work (see eg, Reference 14 and earlier work referenced therein) generated hitting time samples, which have distributions computed in this paper, using the interpolations illustrated in this figure. See text for explanation of the slopes and intercepts as they are used in the inverse functions used to generate samples. A, Slopes _m_ ( _V_ )—see Equation (41)—as functions of dimensionless speed _V_ used for the inverse to the probability distribution for that _V_ . B, Intercepts _c_ ( _V_ )—see Equation (41)—as functions of dimensionless speed _V_ used for the inverse to the probability distribution for that _V_ . C, The percentage error in hitting times as computed from Equation (39) as a function of dimensionless speed _V_ . Due to the particular form of the functions used in our interpolations, the expressions are best when either the diffusion or the drift dominates the distribution: when there is an interplay, the fits are not quite as good, but in all cases are less than 0.6% for the integrated absolute value error as a fraction of the mean hitting time. 6.3 Implementation and performance The simulation of the random walk is a small, albeit crucial, part of the overall process of constructing a probabilistic solver to the PDE's of interest; and such a solver in turn is a small, again crucial, part of constructing simulations of the spatial distributions of molecules transported in the brain via injection of fluid in which they are suspended. We refer to References 3 and 4 for the context in which we have applied these methods. The random walk is needed to obtain the probabilistic solution to the PDE's of interest. The solution itself is an appropriate weighted sum of the boundary values specified by the PDE's, the value being chosen according to where the random walker hits the boundary, and the weighting being related to the time at which it hits the boundary (see Appendix A to this paper and the references cited). Since this paper is focused on the hitting time and place distributions, we confine our remarks to the use of these. The hitting place and time distributions are independent as we have described above, and the hitting place offers no difficulties, as the explicit formula at the beginning of Section 5.3 has indicated. As discussed above, we use the direct and the Poisson resummed series representations of the hitting times. Then as footnote * indicates, we get the desired hitting time distribution by constructing the inverse function described in the previous subsections. Although the series for the hitting times are complicated, the use of these is to enable us to construct the inverse functions, which are close to being lookup tables. (Indeed, we could speed up obtaining these inverse function tables, though we have not yet done so.) So the simulation steps can each be essentially as rapid as the construction of a Gaussian distribution that is required for the simulation of a step of random length in fixed time. In our simulations on a laptop, each simulation step on the average took 1.11 μs for the fixed step length method versus 0.75 μs for the more conventional fixed time step method, the absolute numbers having of course no significance. The particular simulations where these numbers were obtained are now described. To test the performance, we solved a parabolic initial-boundary value problem (Appendix A) for a concentration field obeying drift with a velocity, diffusion, and decay, in an external (Dirichlet) boundary box of 100 × 100 × 100 mm and a spherical flux (Neumann) source of 1 mm radius at the center of the box (so that the inner boundary would reflect). (In the Appendix below, we explain only the solution to Dirichlet problems. The Neumann problems require more preparation to explain, and our approach to these is available in Reference 15.) Particles were started at (25 _,_ 0 _,_ 0), about halfway between the source and the outer boundary. There was a 100 × 100 × 100 diffusion tensor field initialized with a constant isotropic _D_ value, but _treated_ as an arbitrary tensor field, so that no advantage was taken of its isotropy and homogeneity. There was a velocity field that pointed inward toward the source, with magnitude proportional to 1∕ _r_ where _r_ is the distance from the particle to the source. The peak magnitude was selected so that it would not be too large relative to the diffusion so that the particle would eventually drift to the outer bounding box and be absorbed. This was a decay field (initialized with a fixed value) just so that decay computation would be included in the simulation steps. All fields were sampled at 1 mm resolution. The fixed distance simulation was run using maximum step size of 0.5 mm, automatically reduced to as low as 0.05 near the boundaries. The fixed time simulation used a delta _T_ of 4 seconds in order to limit the likelihood of steps much larger than 0.5 mm. The average step length was 0.144 mm, and the probability of taking a step larger than 0.5 mm was about 10 <sup>−6</sup> . The results were that the average number of steps required for a single particle to be absorbed was 12 500 for a single step using a given step length, and 180 000 for given time interval for the steps, both as just described. Thus the speedup in this case was a factor of greater than 10. (Obviously the larger the region of homogeneity for given diffusivity or speed, the larger this speedup factor will be.) For an analytic estimate, with both diffusion and drift, one may use the distribution given in footnote 2 to estimate for example how large a time interval one may have to limit the probability of an excursion no greater than a given length _L_ to be less than, say, 10 <sup>−6</sup> for accuracy. For the numbers quoted, this gives us an order of magnitude estimate the same as that observed, the analytic calculation giving us about 20. 7 CONCLUSION AND DISCUSSION The immediate reason to work with the hitting time distributions is the one stated in the Introduction and noticed by prior researchers, namely, that the first reason to constrain a step length in the simulation of a time-homogeneous process with drift and diffusion is to stay within the region where these coefficients are constant, so that the homogeneous kernel or Green function may be used in the simulation. Thus, it is immediately advantageous to use fixed step-length simulations provided each step is not much more costly in time than each step of a standard simulation of the process which works by sampling from a Gaussian distribution after a fixed time step has been chosen. If we use the latter, we have to strongly limit the time step to be assured with high probability that the desired step length has not been exceeded. Thus many time steps have to be simulated along with checks at each step to ensure that the region of homogeneity has not been crossed. In our implementation described above, it is certainly the case that a single step is not more costly than the choice of Gaussian random variable because it is based on table lookup and a linear interpolation. This results in a simulation that is more efficient, even for inhomogeneous media since the above advantages pertain no matter how small or large is the region of homogeneity. There is another reason for preferring this method, namely, a second reason to constrain a step length which is that a step may not cross any of the boundaries of the region. With the implementation of a distance map (based on level sets <sup>16</sup> ), one has the option of setting the step length accordingly, a feature unavailable to the direct simulation. For these and other purposes it is useful to compute first the hitting time distributions as we have done, and then to find efficient ways to sample these and test their accuracies. We have implemented one such simple method also described in this paper—there are many other possibilities, but the distributions and moments will always be needed to test the simulations of the process. These and the moments are provided in this paper, extending the isotropic diffusion-only case treated by earlier practitioners, referenced in the Introduction. In Section 5.3 where we summarized the formulas, we referenced work <sup>8,9</sup> that has priority in publishing the zero drift Poisson resummed series, and the hitting place distribution, respectively. However, our central hitting time formulas, Equations (35) to (38), which we have obtained in several different ways, have not been displayed before to our knowledge. Grebenkov, who previously obtained our Equation (34) for zero drift, perhaps because of his interest in reaction-diffusion equations, does not seem to take advantage of the central discovery of the mathematicians, namely that the hitting time and hitting place distributions are independent for drift and diffusion for a sphere and only a sphere. Indeed Grebenkov's formula (28) in his paper seems to imply that they are not independent for his problem. (We have not examined the diffusion-reaction problem and so cannot comment on this.) This renders the approach not directly useful for the case of interest in our applications, and indeed there is no counterpart to the formulas of joint distributions of our paper. On the other hand, Sabelfeld has obtained our formula (32) for the hitting place distribution in his prior work. He does not, as mentioned, obtain our hitting time distribution central to our paper and indeed, his approach to the simulation seems entirely different, perhaps because he confined attention in that paper to static (time-independent) problems. Simply combining their work does not help obtain the hitting time formulas, which we use in time-dependent problems as well, nor the inverse method for using them in simulations. Our methods are also sufficiently different, we hope, to be of use and interest. ACKNOWLEDGMENTS We thank BrainLab AG for a contract in 2010 that enabled us to develop these methods and implement them in working software delivered to them early in 2011, along with the requisite reports. We particularly thank María Inmaculada Rodríguez Ponce who was the manager of the program at BrainLab to develop drug delivery simulation software. The algorithms and software were constructed by Martin L. Brady, who is also responsible for the results quoted in the Implementation and Performance section. AUTHOR CONTRIBUTIONS Conceptualization-Lead, Data curation-Lead, Formal analysis-Lead, Funding acquisition-Lead, Investigation-Lead, Methodology-Lead, Project administration-Lead, Resources-Lead, Software-Supporting, Supervision-Lead, Validation-Lead, Visualization-Lead, Writing-original draft-Lead, Writing-review & editing-Lead AUTHOR BIOGRAPHY Raghu Raghavan is co-owner of Therataxis, which is a consulting company that uses probabilistic solvers of the type described in its business. CONFLICT OF INTEREST The authors declare no potential conflict of interests. ORCID _Raghu Raghavan_ [https://orcid.org/0000-0002-4576-1132](https://orcid.org/0000-0002-4576-1132) REFERENCES 1. Sampson JH, Raghavan R, Brady ML, et al. Clinical utility of a patient-specific algorithm for simulating intracerebral drug infusions. _Neuro-Oncology_ . 2007;9:343-353. 2. I. Mehta A, D. Choi B, Ajay D, et al. Convection enhanced delivery of macromolecules for brain tumors. _Curr_ _Drug_ _Discov_ _Technol_ . 2012;9:305-310. 3. Raghavan R, Brady ML, Sampson JH. Delivering therapy to target: improving the odds for successful drug development. _Ther_ _Deliv_ . 2016;7:457-481. 4. Raghavan R, Brady M. Predictive models of pressure-driven infusions into brain parenchyma. _Phys Med Biol_ . 2011;56:1-26. 5. Freidlin M. _Functional Integration and Partial Differential Equations_ . Princeton, NJ: Princeton University Press; 1985. 6. Zheng LH, Chiew YC. Computer simulation of diffusion-controlled reactions in dispersions of spherical sinks. _J_ _Chem_ _Phys_ . 1989;90:322-327. 7. Torquato S, Kim IC. Efficient simulation technique to compute effective properties of heterogeneous media. _Appl_ _Phys_ _Lett_ . 1989;18(18):1847-1849. 8. Grebenkov D. Efficient Monte Carlo methods for simulating diffusion-reaction processes in complex systems. _Monte Carlo Methods Appl_ . 2013;22:265-275. 9. Sabelfeld KK. Random walk on spheres method for solving drift-diffusion problems. _Monte Carlo Methods Appl_ . 2016;22:265-275. 10. Wendel JG. Hitting spheres with Brownian motion. _Ann Probab_ . 1980;8:164-169. 11. Feller W. _An Introduction to Probability Theory and Its Applications_ . Vol 2. New York, NY: John Wiley and Sons; 1971. 12. Wendel JG. An independence property of Brownian motion with drift. _Ann Probab_ . 1980;8:600-601. 13. Pitt LD. On a problem of H. P. McKean: independence of Brownian hitting times and places. _Ann Probab_ . 1989;17:1651-1657. 14. Brady ML, Raghavan R, Block W, et al. The relation between catheter occlusion and backflow during intraparenchymal cerebral infusions. _Stereotact Funct Neurosurg_ . 2015;93:102-109. 15. Raghavan R, Brady ML. Efficient numerical solutions of Neumann problems in inhomogeneous media from their probabilistic representations and applications. _Engineering Reports_ [. 2020;e12108. https://doi.org/10.1002/eng2.12108.](https://doi.org/10.1002/eng2.12108) 16. Gomes J, Faugeras O. Level sets and distance functions. _Computer_ _Vision_ _ECCV_ _2000_ . 2000. Lecture Notes in Computer Science;1842:588-602. 17. Friedman A. _Stochastic Differential Equations and Applications_ . Vol 1. New York, NY: Academic Press; 1976. 18. Karatzas I, Shreve SE. _Brownian Motion and Stochastic Calculus_ . New York, NY: Springer; 1988. How to cite this article: Raghavan R. Hitting time distributions for efficient simulations of drift-diffusion processes. _Engineering Reports_ [. 2020;2:e12109. https://doi.org/10.1002/eng2.12109](https://doi.org/10.1002/eng2.12109) APPENDIX A. PARABOLIC EQUATIONS: THE CONCENTRATION PROFILE We simply quote available results: for details see References 5, 17, and 18. Further explanation of these results available in the literature may be found in Reference 15, which may be consulted for a more detailed explanation of the Neumann problem solution. However, the mathematically minded reader can find the solution to the Neumann problem in Reference 5 as well. We first exhibit some equations, and then explain each term following the display of the equations. The equations with asterisks are in so-called forward form and the coefficients therein are used in the random walk from which we construct the solutions in probabilistic representation. They are equivalent, after translation between the coefficients as given below, to the backward form which are absent the asterisks. Suppose we have a partial differential equation _<u>?u</u>_ <u>(</u> <u>x</u> _<u>, t</u>_ <u>)</u> = _L_ <sup>∗</sup> ( x _, t_ ) _u_ ( x _, t_ ) _,_ (A1) _?t_ where the differential operator _L_ <sup>∗</sup> is of the form _L_ <sup>∗</sup> ( v <sup>∗</sup> ( x _, t_ ) _,_ D <sup>∗</sup> ( x _, t_ ) _, k_ <sup>∗</sup> ( x _, t_ ) _,_ x _, t_ ) _u_ ∶= v <sup>∗</sup> ( x _, t_ ) ⋅ ∇ _u_ + <sup><u>1</u></sup> (A2) 2 <sup>D∗</sup> <sup>(</sup> <sup>x</sup> <sup>_, t_</sup> <sup>) ∶∇∇</sup> <sup>_u_</sup> <sup>+</sup> <sup>_k_</sup> <sup>∗(</sup> <sup>x</sup> <sup>_, t_</sup> <sup>)</sup> <sup>_u,_</sup> with the initial-boundary conditions reading _u_ ( x _, t_ = 0) = _f_ ( x ) _._ (A3a) _u_ ( x _, t_ ) | x ∈ _?_  = _g_ ( x _, t_ ) _._ (A3b) (Solutions to more general problems are available, but the above suffices for our purposes.) Then the solution can be represented via a stochastic process as Reference 5 (p133, theorem 2.3). ( 0 <sup>_d?k_</sup> <sup>∗(</sup> <sup>X</sup> <sup>(</sup> <sup>_?_</sup> <sup>)</sup> <sup>_,t_</sup> <sup>−</sup> <sup>_?_</sup> <sup>))</sup> _,_ (A4a) _?T<t_ _g_ ( X ( _T_ ) _, T_ ) _e_ <sup>∫</sup> <sup>_T_</sup> _u_ ( x _, t_ ) =  x ] _f_ ( X ( _t_ )) _e_ ∫0 _t_ <sup>_d?k_</sup> <sup>∗(</sup> <sup>X</sup> <sup>(</sup> <sup>_?_</sup> <sup>)</sup> <sup>_,t_</sup> <sup>−</sup> <sup>_?_</sup> <sup>))</sup> _._ (A4b) +  x ([1 − _?T<t_ We now explain the above including all the symbols used. In the usual three-dimensional Cartesian coordinates, { _xi_ } <sup>_i_</sup> _i_ <sup>=</sup> = <sup>3</sup> 1 <sup>,</sup> v <sup>∗</sup> ( x _, t_ ) ⋅ ∇ _u_ ∶= ∑3 _i_ =1 _v_ <sup>∗</sup> _i_ <sup>∗</sup> _i_ <sup>(</sup> <sup>x</sup> <sup>_, t_</sup> <sup>)</sup> <sup>_<u>?u</u>_</sup> <sup><u>(</u></sup> <sup><u>x</u></sup> <sup>_<u>, t</u>_</sup> <sup><u>)</u></sup> _?xi_ _?xi_ _,_ (A5a) ∑3 _j_ =1 D <sup>∗</sup> ( x _, t_ ) ∶∇∇ _u_ ∶= ∑3 _i_ =1 D <sup>∗</sup> <sup>∗</sup> _ij_ <sup>(</sup> <sup>x</sup> <sup>_, t_</sup> <sup>)</sup> <sup>_<u>?</u>_</sup> <sup>2</sup> <sup>_<u>u</u>_</sup> <sup><u>(</u></sup> <sup><u>x</u></sup> <sup>_<u>, t</u>_</sup> <sup><u>)</u></sup> _?xi?xj_ _?xi?xj_ _._ (A5b) We recall that we always assume that the matrix of entries for the diffusion tensor is symmetric, and further is positive definite. We now describe each line in the equation that represents the solution. We seek the solution at time _t_ and at the position x, the process having started at time 0. What is constructed is a three dimensional random walk which begins at time 0 at the point at which the solution is desired, namely x say. This random walk has a drift velocity v <sup>∗</sup> and a diffusivity tensor D <sup>∗</sup> . So X ( _t_ ) is defined to be the position of a particle at time _t_ starting at _t_ = 0 at the position x, and undergoing both diffusion and drift, with the diffusivity and the drift velocity being given according the starred quantities above. The initial time and position variables are meant to be understood, but will be suppressed. Thus, X is subject to the stochastic process: _d_ X ( _t_ ) = B <sup>∗</sup> _d_ W ( _t_ ) + v <sup>∗</sup> _dt,_ (A6) where B <sup>∗</sup> is the unique positive definite square root of the diffusivity tensor D <sup>∗</sup> . The assertion on B <sup>∗</sup> follows because the diffusivity itself has to be positive definite. We begin the explanation of the formula for the probabilistic representation of the solution with the first line: ( 0 <sup>_d?k_</sup> <sup>∗(</sup> <sup>X</sup> <sup>(</sup> <sup>_t_</sup> <sup>−</sup> <sup>_?_</sup> <sup>)</sup> <sup>_,?_</sup> <sup>))</sup> _._ (A7) <sup>_T_</sup>  x 0 _?T<t_ _g_ ( X ( _T_ ) _, T_ ) _e_ <sup>∫</sup> <sup>_T_</sup> Here _T_ means the earliest time at which this random walk hits a point X ( _T_ ) of the boundary. _?T<t_ is the characteristic function of the predicate _T < t_ : in other words it is 1 if the random walk hits the boundary before the elapse of the time _t_ at which the solution is to be computed; otherwise it is zero. Thus this term contributes only if the random walk hits the boundary before time _t_ . The Dirichlet boundary value of _u_ is evaluated at this point of the boundary and at the time of impact. (In our applications the boundary value is independent of time but the formula allows the more general case.) It is multiplied by the exponential which is a measure of the “loss” of molecules. An expectation value  x (the subscript means that the walk is begun at the point x as already stated) is taken of this number over repeated random walks. The second term ] _f_ ( X ( _t_ )) _e_ ∫0 _t_ <sup>_d?k_</sup> <sup>∗(</sup> <sup>X</sup> <sup>(</sup> <sup>_?_</sup> <sup>)</sup> <sup>_,t_</sup> <sup>−</sup> <sup>_?_</sup> <sup>))</sup> _,_ (A8)  x ([1 − _?T<t_ can be similarly interpreted. During the random walk, as long as it has not reached the boundary, one cumulates the loss as before (the exponential term) and then multiplies by the initial value that obtains at the point at the conclusion of the walk. The expectation value of this number is then stored. The solution is the sum of these two terms only one of which contributes in a given sample path. We have therefore discussed how the solution is computed. It remains to identify the pseudo-velocity, diffusion, and loss terms. It is easy to rewrite equation (1) of Reference 4 (which describes the transport of the molecule in terms of the advective velocity, the diffusivity and the loss rates which have the same symbols as used above but without the asterisks), to have the form required by Equation (A2) required by the probabilistic representation. By pulling the differentiations through the various terms, we find (see the quoted reference) v <sup>∗</sup> = − v + <sup><u>∇</u></sup> <sup><u>⋅</u></sup> <sup><u>(</u></sup> <sup>_<u>?</u>_</sup> <sup><u>D)</u></sup> _._ (A9a) _?_ D <sup>∗</sup> = D _._ (A9b) _?_ <sup>_<u>k</u>_</sup> <sup>−</sup> <sup><u>∇</u></sup> _?_ <sup><u>⋅</u></sup> <sup><u>v</u></sup> _k_ <sup>∗</sup> = − _?_ <sup>_<u>k</u>_</sup> _._ (A9c) _?_ <sup><u>⋅</u></sup> <sup><u>v</u></sup> _Remark_ 2 _._ The above identification of D <sup>∗</sup> with D then turns out to rest on the conventional use of Gaussian random variables during a stochastic simulation, not the Wiener process (see footnote *). If the Wiener process is used, the starred diffusion tensor will be twice as large. The same applies below for the hydraulic conductivity tensor. A.1 Elliptic equations: the velocity profile Another field that demands simulation is that of the velocity field given by D'Arcy's law. We solve for the pressure: the velocity field is then given by a numerical differentiation. It would be more pleasing, and potentially more numerically stable, to construct a probabilistic representation for the velocity field itself. The theory of stochastic processes does allow for such a construction, but we do not develop that here, since in our current numerical simulations we do indeed compute for the pressure and then numerically differentiate. We need the stochastic representation of the solutions to the Dirichlet boundary value problem _L_ <sup>∗</sup> ( x ) _p_ ( x ) = 0 _._ (A10) _L_ <sup>∗</sup> ( v <sup>∗</sup> ( x ) _,_ D <sup>∗</sup> ( x ) _, k_ <sup>∗</sup> ( x ) _,_ x ) _p_ ∶= v <sup>∗</sup> ( x ) ⋅ ∇ _p_ + <sup><u>1</u></sup> (A11) 2 <sup>D∗</sup> <sup>(</sup> <sup>x</sup> <sup>) ∶∇∇</sup> <sup>_p_</sup> <sup>+</sup> <sup>_k_</sup> <sup>∗(</sup> <sup>x</sup> <sup>)</sup> <sup>_p._</sup> _p_ ( x ) | x ∈ _?_  = _g_ ( x ) _._ (A12a) _p_ ( x ) || x |→∞ = ? <sup>(</sup> | x | <sup>−1)</sup> _._ (A12b) (We have used the same symbols _L_ <sup>∗</sup> _, g_ as above, even when the coefficients are not time dependent: this should not cause any confusion. The second condition on the pressure is an asymptotic one: it must decay at large distances at least as fast as _r_ <sup>−1</sup> _._ ) By comparison with equation (4) of our reference cited, we see that v <sup>∗</sup> = ∇ ⋅ K _._ (A13a) D <sup>∗</sup> = K _._ (A13b) _k_ <sup>∗</sup> = − _?_ <sup>2</sup> _._ (A13c) in terms of the hydraulic conductivity K of the tissue, the inhomogeneity in which also gives a pseudo velocity for the simulation, and a parameter _?_ which describes the loss of fluid across the walls of the blood vessels, due to the higher pressure from the infusion (the paper referenced may be consulted for more details of this application). Let _T_ be the least time for the previously described random walk (but now the drift, diffusion, and loss must be time independent) to hit the boundary. The expected value of this time must be finite (but see below). Then the solution (the same references above may be consulted) is ( _g_ ( X ( _T_ )) _e_ <sup>∫</sup> 0 <sup>_T_</sup> <sup>_d?k_</sup> <sup>∗(</sup> <sup>X</sup> <sup>(</sup> <sup>_?_</sup> <sup>)</sup> <sup>_,t_</sup> <sup>−</sup> <sup>_?_</sup> <sup>))</sup> _._ (A14) _p_ ( x ) =  x The interpretation of this equation follows the same lines as given above, and need not be repeated. However, we remark upon the case where a part of the boundary is at infinity. For example, if we have a fluid source at the origin, we may want to solve for the pressure outside the source. In this case, as is well known, the boundary condition must be supplemented in the differential equation with an asymptotic condition on the solution at infinity (eg, that it approach a constant usually taken to be zero). Correspondingly, the stochastic process must be such that it cannot return to the inner boundary after it has wandered off to infinity. In practice we select an outer boundary of the brain and set the pressure there to be zero. Treatises such as Reference 5 may be consulted on many details of the stochastic representations including the treatment of unbounded domains. APPENDIX B. REMARK ON MAXIMUM ENTROPY DISTRIBUTIONS The moment generating function (53) is, of course, easier to compute than the densities. We remark here that the density of the maximum entropy distribution with specified moments _mi, i_ ≥ 0 is _pME_ ( _T_ ) = _Z_ <sup>−1</sup> exp <sup>(</sup> - _?_ 1 _T_ - _?_ 2 _T_ <sup>2</sup> - _?_ 3 _T_ <sup>3</sup> - _?_ 4 _T_ <sup>4</sup> … <sup>)</sup> _._ (B1) It may be interesting to compare the distributions we get by using the first few moments in a maximum entropy distribution with that of the exact density which is an infinite series and so must be summed approximately anyway. We postpone this exercise for the moment. In any case, it will involve numerical work. If the moments beyond the second are taken, then computing _Z_ becomes numerical, and in all cases, computing the parameters _?_ in the distribution from the known _m_ <sup>′</sup> s requires a numerical procedure. Other methods for constructing distributions involving matching moments will be discussed in a separate publication. APPENDIX C. ASYMPTOTIC EXPANSIONS Numerical simulations of course proceed by generating the distribution by computing the inverse. In general, we would fit an inverse function <sup>←−</sup> _t_ _V_ ( _u_ ) to the cumulative distribution _PV_ ( _t_ ). It is helpful, in selecting the functions to fit ←− _t_ _V_ to be able to have good approximations to it. We therefore write down the first terms in asymptotic forms for ←− _t_ _V_ ( _x_ ), both for large and for small _x_, corresponding in turn to large and small times _t_ . Although we indicate here how to obtain asymptotic expansions, we have not really made use of it in our simulations yet. Nevertheless, the approach may turn out to be of interest. Let us begin with _V_ = 0. The first term for small _t_, is <u>1</u> _P_ 0 ( _t_ ) ≈ ~~√~~ _?t_ ( exp - <sup><u>1</u></sup> 4 _t_ ) _._ (C1) The behavior near zero is dominated by the exponential, so we denote _._ (C2) =∶ _y_ → _t_ = <sup>←</sup> _h_ <sup>−</sup> ( _y_ ) = ~~√~~ _?_ ~~√~~ <u>))−1</u> ( −4 ln ( <u>1</u> _h_ ( _t_ ) ∶= ~~√~~ _?_ ( ) _y_ exp - <sup><u>1</u></sup> 4 _t_ - <sup><u>1</u></sup> The forward and reverse arrows imply that the corresponding functions are inverses of each other. (We have chosen not to denote the inverse in the usual way, namely with an “exponent” of minus one.) Now let _<u>y</u>_ _z_ ∶= ~~√~~ <u>←</u> _h_ <u>−</u> ( _y_ ) _._ (C3) We can now successively approximate for _y_ . Set _y_ 0 = _z_ . Then _<u>z</u>_ √← _h_ - ( _z_ ) = ~~(~~ _<u>z</u>_ √← _h_ - ( _z_ ) = ~~(~~ ~~√~~ _y_ 1 = _z_ ~~<u>)</u>~~ _._ (C4) ~~(~~ _z_ −4 ln _z_ Applying <sup>←</sup> _h_ <sup>−</sup> to the above equation ~~(~~ ( _z_ _t_ = <sup>←</sup> _h_ <sup>−</sup> √← _h_ - ( _z_ ) ~~)~~ <u>1</u> = ~~(~~ ~~√~~ ~~<u>)</u>~~ _?_ ~~[~~ ~~√~~ _?_ ~~<u>)</u>~~ ~~<u>)]</u>~~ _._ (C5) + 2 ln ) −4 ln −4 ln ~~√~~ _?_ ~~√~~ _z_ Let us therefore write <u>1</u> _z_ ∶= ~~√~~ _?t_ ( = _⃗_ _h_ ( _t_ ) _._ (C6) exp - <sup><u>1</u></sup> 4 _t_ - <sup><u>1</u></sup> ( _t_ =∶ <sup>←</sup> _h_ <sup>−</sup> ( _z_ ) ∶= −4 ln ( _z_ [ + 2 ln −4 ln ( _z_ ~~√~~ _?_ _._ (C7) √ <u>)</u> <u>)])−1</u> _?_ We can now include the velocity in the same way. First, to avoid negative values for the cumulative distributions, let us replace 1 − _?t_ by _e_ <sup>−</sup> <sup>_?t_</sup> . Let _x_ = _⃗_ _f_ ( _t_ ) ∶= _e_ <sup>−</sup> <sup>_?t⃗_</sup> _h_ ( _t_ ) _._ (C8) This immediately gives us the next approximation to the inverse function, namely _e_ <sup>−</sup> <sup>_?_</sup> <sup>←</sup> <sup>_h_</sup> <sup>−(</sup> <sup>_x_</sup> <sup>)</sup> _x_ _t_ = <sup>←−</sup> _f_ ( _x_ ) ≈ <sup>←</sup> _h_ <sup>−</sup> ( ) _._ (C9) It is obvious that we may successively approximate the inverse (for small _x, t_ ) in a double recursion, improving the approximation to the _g_ and _h_ functions in turn. The large time series, on the other hand, has for its first non trivial term: _._ (C10) _?_ <sup>2</sup> _V_ ) exp <sup>(</sup> - _?_ <sup>4</sup> _tV_ <sup>2)</sup> <sup>(</sup> - _?_ <sup>4</sup> _tV_ <sup>2)</sup> sinh <sup>(</sup> _?_ <sup>2</sup> _V_ <sup>)</sup> 1 + _?_ <sup>2</sup> _V_ <sup>2</sup> _?_ <sup>2</sup> _V_ _x_ ≈ 1 − 2 _t_ exp ( - _?_ <sup>2</sup> _t_ the inverse to which is directly <u>1</u> _t_ = − _?_ <sup>2</sup> <sup>~~(~~</sup> 1 + _?_ <sup>2</sup> _V_ <sup>2</sup> <sup>~~)~~</sup> <sup>× ln</sup> The expansions may be continued in this way. [ <u>1</u> 2 _?_ <sup>2</sup> _V_ <sup>(</sup> 1 + _?_ <sup>2</sup> _V_ <sup>2)</sup> ] sinh <sup>~~(~~</sup> _?_ <sup>2</sup> _V_ <sup>~~)~~</sup> (1 − _x_ ) _._ (C11)

섹션 본문

섹션 본문이 없습니다.

참고문헌 18건

  1. Level Sets and Distance Functions Lecture notes in computer science · Springer Science+Business Media · 2000 10.1007/3-540-45054-8_38
  2. Efficient Monte Carlo Methods for Simulating Diffusion-Reaction Processes in Complex Systems WORLD SCIENTIFIC eBooks · World Scientific · 2014 10.1142/9789814590297_0023
  3. Computer simulation of diffusion-controlled reactions in dispersions of spherical sinks The Journal of Chemical Physics · American Institute of Physics · 1989 10.1063/1.456532
  4. An Independence Property of Brownian Motion with Drift The Annals of Probability · Institute of Mathematical Statistics · 1980 10.1214/aop/1176994729
  5. On a Problem of H. P. McKean: Independence of Brownian Hitting Times and Places The Annals of Probability · Institute of Mathematical Statistics · 1989 10.1214/aop/1176991179
  6. The Relation between Catheter Occlusion and Backflow during Intraparenchymal Cerebral Infusions Stereotactic and Functional Neurosurgery · Karger Publishers · 2015 10.1159/000367665
  7. Clinical utility of a patient-specific algorithm for simulating intracerebral drug infusions Neuro-Oncology · Oxford University Press · 2007 10.1215/15228517-2007-007
  8. Predictive models for pressure-driven fluid infusions into brain parenchyma Physics in Medicine and Biology · IOP Publishing · 2011 10.1088/0031-9155/56/19/003
  9. Efficient simulation technique to compute effective properties of heterogeneous media Applied Physics Letters · American Institute of Physics · 1989 10.1063/1.102184
  10. Hitting Spheres with Brownian Motion The Annals of Probability · Institute of Mathematical Statistics · 1980 10.1214/aop/1176994833
  11. Convection Enhanced Delivery of Macromolecules for Brain Tumors Current Drug Discovery Technologies · Bentham Science Publishers · 2012 10.2174/157016312803305951
  12. Stochastic differential equations and applications Advances in Mathematics · Elsevier BV · 1977 10.1016/0001-8708(77)90127-x
  13. Delivering Therapy to target: Improving the Odds for Successful Drug Development Therapeutic Delivery · Future Science Ltd · 2016 10.4155/tde-2016-0016
  14. Random walk on spheres method for solving drift-diffusion problems Monte Carlo Methods and Applications · De Gruyter · 2016 10.1515/mcma-2016-0118
  15. Functional Integration and Partial Differential Equations. (AM-109) Princeton University Press eBooks · Princeton University Press · 1985 10.1515/9781400881598
  16. Efficient numerical solutions of Neumann problems in inhomogeneous media from their probabilistic representations and applications Engineering Reports · Wiley · 2020 10.1002/eng2.12108
  17. Brownian Motion and Stochastic Calculus Graduate texts in mathematics · Springer Nature · 1988 10.1007/978-1-4684-0302-2
  18. An Introduction to Probability Theory and its Applications. Journal of the Royal Statistical Society Series A (General) · Wiley · 1972 10.2307/2344620