Skip to main content
. 2009 Mar 4;130(9):094104. doi: 10.1063/1.3074302

Algorithm 1.

. Diffusion in one dimension with diffusion radius s=1

Choose s and ε  
Calculated Δtmax as a function of ε, s, and κ=Dl2  
Choose Δt⩽Δtmax  
whilettfinaldo  
  fori=1 to ndo  
    ΔXi(i+1)=B(p^i(i+1)(Δt),Xi)  
    ΔXi(i1)=B(p^i(i1)(Δt)1p^i(i+1)(Δt),XiΔXi(i+1))
  end for  
  fori=1 to ndo  
    Xi=Xi−ΔXi(i+1)−ΔXi(i−1)X(i+1)iX(i−1)i
  end for  
  t=tt  
end while