  We consider the numerical integration of Langevin equations for particles in
a channel, in the presence of boundary conditions fixing the concentration
values at the ends. This kind of boundary condition appears for instance when
considering the diffusion of ions in molecular channels, between the different
concentrations at both sides of the cellular membrane. For this application the
overdamped limit of Brownian motion (leading to a first order Langevin
equation) is most convenient, but in previous works some difficulties
associated with this limit were found for the implementation of the boundary
conditions. We derive here an algorithm that, unlike previous attempts, does
not require the simulation of particle reservoirs or the consideration of
velocity variables or adjustable parameters. Simulations of Brownian particles
in simple cases show that results agree perfectly with theory, both for the
local concentration values and for the resulting particle flux in
nonequilibrium situations. The algorithm is appropriate for the modeling of
more complex ionic channels and, in general, for the treatment of analogous
boundary conditions in other physical models using first order Langevin
equations. ***This version corrects misprints in two equations of the published
paper***
