Solution (source code)

= Solution

A centered nearest-neighbour discretization of drift--diffusion is obtained from
$$
\boxed{k_i^+=\frac D{h^2}+\frac{v(x_i)}{2h},
\qquad
k_i^-=\frac D{h^2}-\frac{v(x_i)}{2h}.}
$$
For sufficiently small $h$ these rates are nonnegative. Taylor expansion of the mean equations gives
$$
\partial_tc=D\partial_x^2c-\partial_x(vc).
$$
Absorption into the target to the left of the first compartment gives
$$
\boxed{c(0,t)=0,}
$$
while the absence of outward jumps at the right endpoint gives the <zero-flux boundary condition>
$$
\boxed{v(L)c(L,t)-D\partial_xc(L,t)=0.}
$$