How this calculation works
Evolve a one-dimensional probability density under a drift field and constant positive diffusion on a finite interval with zero-flux boundaries. The calculator uses a conservative Scharfetter–Gummel spatial flux and implicit time stepping. It reports the final density, mass, mean, variance and a time-refinement comparison. The initial density is normalized explicitly, and the boundaries describe a confined model rather than an unbounded-space diffusion.
∂_t p=−∂_x(vp−D∂_x p), with zero probability flux at both endpoints.A worked example
On [0,1], zero drift and an initially uniform density give the stationary solution p=1. The finite-volume scheme keeps total mass one and mean 1/2. The page reports the cell-center variance rather than claiming an exact continuous variance from a finite grid.
Good to know
Finite bounded interval, constant positive diffusion, 10–100 cells and 20–2000 coarse steps. Initial nonnegative cell values are normalized visibly. Conservative Scharfetter–Gummel flux with implicit time stepping; time refinement is not a spatial-error certificate. No unbounded-domain or multidimensional density.
The probability conservation equation
The Fokker–Planck equation tracks density as drift transports probability and diffusion spreads it. In this convention the diffusion coefficient multiplies the second spatial derivative.
For a corresponding Itô equation, the constant noise amplitude is the square root of twice that coefficient. Confusing the coefficient with the noise amplitude changes the evolution. The page solves density dynamics on a fixed one-dimensional mesh, not individual sample paths.
Enforces probability flux, drift and nonnegative mass; the existing fixed-end heat solver does not represent that conservation model. The Finite horizon linear quadratic control calculator with terminal cost offers a complementary calculation under its own stated assumptions.
Zero flux is a boundary condition
At each interval endpoint, total advective-plus-diffusive probability flux is set to zero. This confines mass inside the domain and differs from absorbing boundaries, prescribed densities or an infinite domain.
A drift pointing outward does not simply remove mass under these conditions. If the interval is a numerical approximation to an unbounded problem, choose it wide enough and assess boundary influence rather than assuming no-flux confinement is physically harmless.
Worked example and mathematical rule
On [0,1], zero drift and an initially uniform density give the stationary solution p=1. The finite-volume scheme keeps total mass one and mean 1/2. The page reports the cell-center variance rather than claiming an exact continuous variance from a finite grid.
∂_t p=−∂_x(vp−D∂_x p), with zero probability flux at both endpoints.
Initial density and normalization
The initial expression is sampled at cell centers and must be nonnegative with positive total discrete mass. The solver divides by that mass so the grid starts with probability total one, and reports the pre-normalization value.
This allows a proportional density shape but does not excuse a badly resolved narrow peak. A delta function is not an ordinary expression supported by this sampling rule. Use a resolved initial profile and state how it approximates any concentrated starting distribution.
Conservative spatial fluxes
The Scharfetter–Gummel formula balances drift and diffusion through exponentially fitted intercell fluxes. The implicit tridiagonal step updates neighboring cell probabilities while respecting the no-flux endpoints.
Conservation is checked through the cell-width-weighted density sum, and substantial negative values are rejected. These structural checks are valuable, but they do not prove the grid resolves every feature. A conservative coarse approximation can preserve total probability while misplacing or oversmoothing its distribution.
Time refinement does not test space
The reported comparison doubles time steps on the same spatial grid and integrates the density difference in an L1 sense. It diagnoses time-discretization sensitivity only.
To assess spatial error, change cell count separately and compare moments or interpolated densities. Drift-dominated layers may require a finer mesh even when the time-refinement difference is small. The tool does not claim a global error bound or automatically perform a full two-dimensional convergence study over space and time resolutions.
Interpreting moments of a confined model
The mean and variance are discrete moments of the final normalized density on the chosen interval. They are not Monte Carlo estimates and do not have a simulation standard error.
Constant zero drift with a uniform initial density should remain uniform under no-flux boundaries, providing a simple benchmark. For nonzero drift, compare long-time behavior with the appropriate stationary no-flux density when one exists. Keep boundary conditions, diffusion convention, cell count and time step with any shared result.
A few questions, answered
Is diffusion the SDE noise amplitude?
No. A constant Itô noise amplitude is the square root of twice this diffusion coefficient.
Do particles leave the interval?
Not in this model; both endpoints have zero total probability flux.
Why normalize the initial expression?
It may specify a proportional shape; the grid density must have unit total mass.
Does the refinement output assess spatial error?
No. It compares time steps on the same spatial mesh.