When simulating a Langevin equation, how is a vertical potential barrier handled?
I have the time overdamped evolution of the position $x$, described by
$\gamma\frac{dx}{dt}=-V'(x)+\eta(t)$
where $V(x)$ is the potential, $\gamma$ the drag, and $\eta(t)$ the thermal noise. When I want to simulate a particular trajectory, I discretize the time in steps of a small finite $\Delta t$, and I use simply iterations with
$x_i = x_{i-1} - \frac{1}{\gamma}V'(x_{i-1})\Delta t +\sqrt{2D\Delta t} \, \eta_i$
where $D=K_BT/\gamma$ is the diffusion coefficient, and $\eta_i$ a random number.
Now, imagine $V(x)$ has an infinitely high barrier, whose slope can be tuned (and made vertical). I was wondering: if the particle by chance hits the barrier, there the value of the derivative $V'$ can be indefinitely large. In the simulation, this means that $x_i$ can be seriously "kicked" away by the term $-V'(x_{i-1})$. It seems unphysical.
I guess reducing the $\Delta t$ used helps, but is there a standard way to handle this? Or too much vertical barriers cannot be simulated?
NDSolve
that can deal with this issue and prevent diverging results (so long as you are a Mathematica-whisperer)... $\endgroup$