Inputs
Choose drift and diffusion models, set the domain and time, then compute the numerical density at the final time.
Formula Used
This calculator solves the one dimensional Fokker-Planck equation for a probability density p(x,t):
- A(x) is the drift term that moves probability in space.
- B(x) is the diffusion variance rate, often written as B(x)=2D(x).
- Reflecting boundaries approximate zero probability flux at the domain edges.
- Absorbing boundaries force p=0 at the edges, removing probability.
Numerical method: explicit time stepping with finite differences. It is fast, but stability depends on dt, dx, and the largest drift/diffusion values.
How to Use This Calculator
- Set a spatial domain using x min, x max, and choose Nx.
- Pick the final time T and a time step dt.
- Select a drift model and enter its parameters.
- Select a diffusion model and enter its parameters.
- Choose an initial condition and its settings.
- Press Solve Now to compute the final density and moments.
- Use Download CSV for the full (x,p) grid, or Download PDF to print the result block.
Example Data Table
Sample configuration for an Ornstein-Uhlenbeck drift with constant diffusion. Values below are illustrative for learning and validation.
| Case | x range | Nx | T | dt | Drift | Diffusion | Initial |
|---|---|---|---|---|---|---|---|
| OU-1 | -5 to 5 | 401 | 1.0 | 0.0005 | A=-k(x-mu), k=1.0, mu=0.0 | B=2D, D=0.6 | Gaussian mu0=0.0, sig0=0.6 |
| OU-2 | -6 to 6 | 601 | 2.0 | 0.0004 | A=-k(x-mu), k=0.7, mu=1.0 | B=2D, D=0.4 | Gaussian mu0=-1.0, sig0=0.8 |
| DW-1 | -4 to 4 | 501 | 1.5 | 0.00025 | U=ax^4-bx^2, a=0.25, b=1.0, gamma=1.0 | B=2D0(1+alpha x^2), D0=0.35, alpha=0.10 | Delta-like x0=0.0, sig0=0.15 |
Article
1. What this solver does
The Fokker-Planck Solver Calculator numerically evolves a one dimensional probability density p(x,t) under user defined drift and diffusion. It targets stochastic motion models used in optics, plasma transport, soft matter, and noisy control systems. You can select the domain, time horizon, and boundary behavior, then obtain the final density and summary moments.
2. Physical meaning of drift and diffusion
Drift A(x) represents systematic motion of probability, such as a restoring force, a constant bias, or motion in a potential landscape. Diffusion B(x) controls spreading due to noise. Many texts use B(x)=2D(x), where D is the diffusion coefficient and sets the variance growth rate of the underlying stochastic process.
3. Included drift models
Three common choices are provided. Ornstein-Uhlenbeck drift A=-k(x-mu) models relaxation toward a mean value mu, with k controlling the return rate. Constant drift A=v produces uniform translation of the density. A double well potential uses U=ax^4-bx^2 with drift proportional to -dU/dx, producing two preferred regions separated by a barrier.
4. Included diffusion models
Constant diffusion B=2D is appropriate for additive Gaussian noise with fixed strength. The quadratic option B=2D0(1+alpha x^2) introduces state dependent noise that grows away from the origin. This is useful for multiplicative noise approximations and for exploring how broader fluctuations reshape the density tails.
5. Boundary conditions and probability flow
Reflecting boundaries approximate zero gradient at the edges and are often used when the domain is a truncated representation of a larger space. Absorbing boundaries set p=0 at the edges, removing probability that reaches the boundary. This can represent loss, escape, or detection outside the modeled region.
6. Numerical method and stability data
The solver uses an explicit finite difference update with a flux form for advection and a second derivative for diffusion. Upwind advection is offered for improved robustness. Explicit schemes are fast but require stable time steps. A rough guideline is dt less than about 0.45*dx^2/Bmax for diffusion and dt less than about 0.45*dx/Amax for advection.
7. Outputs you can trust and compare
After solving, the calculator reports mean, variance, standard deviation, skewness, and the peak location. A query value p(x) at a chosen point helps track local probability changes. The preview table samples the final grid, while the CSV export provides the full resolution data for plotting and comparison in external tools.
8. Practical workflow for advanced studies
Start with moderate Nx and a conservative dt, then refine Nx to capture sharp features before shrinking dt further. Expand the domain if the density approaches the edges under drift. When exploring double well dynamics, compare how changing diffusion strength alters barrier crossing probability, peak splitting, and long time equilibrium structure.
FAQs
1) Which equation is solved here?
It solves dp/dt = -d[A(x)p]/dx + 1/2*d^2[B(x)p]/dx^2 on a uniform spatial grid, evolving the density from your chosen initial condition to the final time.
2) Why do I see a stability warning?
Explicit updates can become unstable when dt is too large relative to dx and the largest drift or diffusion values. Reduce dt, increase Nx, or select upwind advection to improve robustness.
3) What do reflecting boundaries mean?
Reflecting boundaries approximate zero gradient at the edges, limiting probability flow across the boundary. They are useful when your domain is a truncated window of a wider physical space.
4) What do absorbing boundaries mean?
Absorbing boundaries set p=0 at the edges, removing probability that reaches the boundary. This can represent escape, loss, or a measurement region where trajectories terminate.
5) How should I choose Nx?
Use higher Nx when your density is narrow, has steep gradients, or splits into multiple peaks. For smoother cases, moderate Nx is sufficient and will run faster.
6) What does p(x) at the query point represent?
It is the final density value at your chosen x, obtained by linear interpolation from the computed grid. It helps track changes at a specific location across parameter sweeps.
7) How do I export results for plotting?
Use the Download CSV button to save the full x,p grid. You can then plot p versus x in any spreadsheet, scripting tool, or plotting application you prefer.