Skip to main content

Solve the Fokker-Planck equation in N dimensions

Project description

Build Status PyPi Version Conda Version

FPlanck

FPlanck is a Python library for numerically solving the Fokker-Planck partial differential equation (also known as the Smoluchowski equation) in N dimensions using a matrix numerical method:

The method is based on the paper "Physically consistent numerical solver for time-dependent Fokker-Planck equations" by V. Holubec, K. Kroy, and S. Steffenoni, available on arXiv and published in APS.

Features

  • Can specify an external potential (conservative) and force field (non-conservative) in N-dimensions
  • Solve for the steady-state probability distribution and probability currents
  • Propagate any initial probability distribution to the solution at any later time
  • Periodic and reflecting boundary conditions (can be mixed along different dimensions)

Installation

FPlanck can be installed with pip

pip install fplanck

or conda

conda install -c japarker fplanck

Examples

On the left: a single particle in a titled periodic potential with periodic boundary conditions. The animation shows the time evolution of the probability distribution for the particle location. The PDF is driven in the positive direction due to the tilted potential.

On the right: a single particle in a 2D harmonic potential. The particle is initially away from the center of the harmonic well, and over time is restored to the center.

Usage

See the examples folder for how to use FPlanck.

License

FPlanck is licensed under the terms of the MIT license.


References

[1] Wikipedia contributors, "Fokker–Planck equation," Wikipedia, The Free Encyclopedia, https://en.wikipedia.org/w/index.php?title=Fokker%E2%80%93Planck_equation&oldid=906834519

[2] Holubec, V., Kroy, K. and Steffenoni, S., 2019. Physically consistent numerical solver for time-dependent Fokker-Planck equations. Physical Review E, 99(3), p.032117.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fplanck-0.2.2.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

fplanck-0.2.2-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page