Drift–Diffusion Model

where μ is the mean drift and dξ is a Gaussian random variable with mean zero and standard deviation σ √ dt. The FPT is the smallest time t that v(t) > vth. • Generate n diffusion trajectories vi(t), i = 1, . . . , n with 0 < t < T and n as large as you can. Use dt = 0.001, μ = 0.1, σ = 0.1, vth = 1 and total time T = 20. Hint: it is very efficient in Matlab or Python to vectorize your code. In this case, you can do a dynamics step for all trajectories simulaneously as a vector v of length the number of trials.