# py-pde
<img src="docs/source/_images/logo.png" width="200em" align="right" />
[![PyPI version](https://badge.fury.io/py/py-pde.svg)](https://badge.fury.io/py/py-pde)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-pde.svg)](https://anaconda.org/conda-forge/py-pde)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://github.com/zwicker-group/py-pde/actions/workflows/tests_all.yml/badge.svg)](https://github.com/zwicker-group/py-pde/actions/workflows/tests_all.yml)
[![codecov](https://codecov.io/gh/zwicker-group/py-pde/branch/master/graph/badge.svg)](https://codecov.io/gh/zwicker-group/py-pde)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/zwicker-group/py-pde/master?filepath=examples%2Fjupyter)
[![Documentation Status](https://readthedocs.org/projects/py-pde/badge/?version=latest)](https://py-pde.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.02158/status.svg)](https://doi.org/10.21105/joss.02158)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
`py-pde` is a Python package for solving partial differential equations (PDEs).
The package provides classes for grids on which scalar and tensor fields can be
defined. The associated differential operators are computed using a
numba-compiled implementation of finite differences. This allows defining,
inspecting, and solving typical PDEs that appear for instance in the study of
dynamical systems in physics. The focus of the package lies on easy usage to
explore the behavior of PDEs. However, core computations can be compiled
transparently using numba for speed.
[Try it online!](https://mybinder.org/v2/gh/zwicker-group/py-pde/master?filepath=examples%2Fjupyter)
Installation
------------
`py-pde` is available on `pypi`, so you should be able to install it through `pip`:
```bash
pip install py-pde
```
In order to have all features of the package available, you might want to
install the following optional packages:
```bash
pip install h5py pandas mpi4py numba-mpi
```
Moreover, `ffmpeg` needs to be installed for creating movies.
As an alternative, you can install `py-pde` through [conda](https://docs.conda.io/en/latest/)
using the [conda-forge](https://conda-forge.org/) channel:
```bash
conda install -c conda-forge py-pde
```
Installation with `conda` includes all dependencies of `py-pde`.
Usage
-----
A simple example showing the evolution of the diffusion equation in 2d:
```python
import pde
grid = pde.UnitGrid([64, 64]) # generate grid
state = pde.ScalarField.random_uniform(grid) # generate initial condition
eq = pde.DiffusionPDE(diffusivity=0.1) # define the pde
result = eq.solve(state, t_range=10) # solve the pde
result.plot() # plot the resulting field
```
PDEs can also be specified by simply writing expressions of the evolution rate.
For instance, the
[Cahn-Hilliard equation](https://en.wikipedia.org/wiki/Cahn–Hilliard_equation)
can be implemented as
```python
eq = pde.PDE({'c': 'laplace(c**3 - c - laplace(c))'})
```
which can be used in place of the `DiffusionPDE` in the example above.
More information
----------------
* Tutorial notebooks in the [tutorials folder](https://github.com/zwicker-group/py-pde/tree/master/examples/tutorial)
* [Examples gallery](https://py-pde.readthedocs.io/en/latest/examples_gallery/)
with an overview of the capabilities of the package
* The [Discussions on GitHub](https://github.com/zwicker-group/py-pde/discussions)
* [Full documentation on readthedocs](https://py-pde.readthedocs.io/)
or as [a single PDF file](https://py-pde.readthedocs.io/_/downloads/en/latest/pdf/).
* The [paper published in the Journal of Open Source Software](https://doi.org/10.21105/joss.02158)
* [Practical tutorial on pattern formation in biological cells](https://github.com/zwicker-group/tutorial-pattern-formation-in-cells)
Raw data
{
"_id": null,
"home_page": null,
"name": "py-pde",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.9",
"maintainer_email": null,
"keywords": "pdes, partial-differential-equations, dynamical-systems",
"author": null,
"author_email": "David Zwicker <david.zwicker@ds.mpg.de>",
"download_url": "https://files.pythonhosted.org/packages/e9/51/279ff369d94222540c55170918516e91af24eb7241c20d1ae54ffc9f4d23/py_pde-0.41.0.tar.gz",
"platform": null,
"description": "# py-pde\n\n<img src=\"docs/source/_images/logo.png\" width=\"200em\" align=\"right\" />\n\n\n[![PyPI version](https://badge.fury.io/py/py-pde.svg)](https://badge.fury.io/py/py-pde)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/py-pde.svg)](https://anaconda.org/conda-forge/py-pde)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://github.com/zwicker-group/py-pde/actions/workflows/tests_all.yml/badge.svg)](https://github.com/zwicker-group/py-pde/actions/workflows/tests_all.yml)\n[![codecov](https://codecov.io/gh/zwicker-group/py-pde/branch/master/graph/badge.svg)](https://codecov.io/gh/zwicker-group/py-pde)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/zwicker-group/py-pde/master?filepath=examples%2Fjupyter)\n[![Documentation Status](https://readthedocs.org/projects/py-pde/badge/?version=latest)](https://py-pde.readthedocs.io/en/latest/?badge=latest)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.02158/status.svg)](https://doi.org/10.21105/joss.02158)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n`py-pde` is a Python package for solving partial differential equations (PDEs). \nThe package provides classes for grids on which scalar and tensor fields can be\ndefined. The associated differential operators are computed using a\nnumba-compiled implementation of finite differences. This allows defining,\ninspecting, and solving typical PDEs that appear for instance in the study of\ndynamical systems in physics. The focus of the package lies on easy usage to\nexplore the behavior of PDEs. However, core computations can be compiled\ntransparently using numba for speed.\n\n[Try it online!](https://mybinder.org/v2/gh/zwicker-group/py-pde/master?filepath=examples%2Fjupyter)\n\n\nInstallation\n------------\n\n`py-pde` is available on `pypi`, so you should be able to install it through `pip`:\n\n```bash\npip install py-pde\n```\n\nIn order to have all features of the package available, you might want to \ninstall the following optional packages:\n\n```bash\npip install h5py pandas mpi4py numba-mpi\n```\n\nMoreover, `ffmpeg` needs to be installed for creating movies.\n\nAs an alternative, you can install `py-pde` through [conda](https://docs.conda.io/en/latest/)\nusing the [conda-forge](https://conda-forge.org/) channel:\n\n```bash\nconda install -c conda-forge py-pde\n```\n\nInstallation with `conda` includes all dependencies of `py-pde`.\n\nUsage\n-----\n\nA simple example showing the evolution of the diffusion equation in 2d:\n\n```python\nimport pde\n\ngrid = pde.UnitGrid([64, 64]) # generate grid\nstate = pde.ScalarField.random_uniform(grid) # generate initial condition\n\neq = pde.DiffusionPDE(diffusivity=0.1) # define the pde\nresult = eq.solve(state, t_range=10) # solve the pde\nresult.plot() # plot the resulting field\n```\n\nPDEs can also be specified by simply writing expressions of the evolution rate.\nFor instance, the\n[Cahn-Hilliard equation](https://en.wikipedia.org/wiki/Cahn\u2013Hilliard_equation)\ncan be implemented as\n```python\neq = pde.PDE({'c': 'laplace(c**3 - c - laplace(c))'})\n```\nwhich can be used in place of the `DiffusionPDE` in the example above.\n\n\nMore information\n----------------\n* Tutorial notebooks in the [tutorials folder](https://github.com/zwicker-group/py-pde/tree/master/examples/tutorial)\n* [Examples gallery](https://py-pde.readthedocs.io/en/latest/examples_gallery/)\n with an overview of the capabilities of the package\n* The [Discussions on GitHub](https://github.com/zwicker-group/py-pde/discussions)\n* [Full documentation on readthedocs](https://py-pde.readthedocs.io/)\n or as [a single PDF file](https://py-pde.readthedocs.io/_/downloads/en/latest/pdf/).\n* The [paper published in the Journal of Open Source Software](https://doi.org/10.21105/joss.02158)\n* [Practical tutorial on pattern formation in biological cells](https://github.com/zwicker-group/tutorial-pattern-formation-in-cells)\n\n \n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python package for solving partial differential equations",
"version": "0.41.0",
"project_urls": {
"documentation": "http://py-pde.readthedocs.io",
"homepage": "https://github.com/zwicker-group/py-pde",
"repository": "https://github.com/zwicker-group/py-pde"
},
"split_keywords": [
"pdes",
" partial-differential-equations",
" dynamical-systems"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "df425e730d0d532b91fdfd3ca13f5796568011a0198ff320d2d913af75325004",
"md5": "a2ca6ebcbcde2962369b73eb74728d1e",
"sha256": "203032565ecf1b7fe44fb5a7842fed6742e5ff501da7e3e0e82108a857c35167"
},
"downloads": -1,
"filename": "py_pde-0.41.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a2ca6ebcbcde2962369b73eb74728d1e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.9",
"size": 322877,
"upload_time": "2024-08-05T09:22:42",
"upload_time_iso_8601": "2024-08-05T09:22:42.785848Z",
"url": "https://files.pythonhosted.org/packages/df/42/5e730d0d532b91fdfd3ca13f5796568011a0198ff320d2d913af75325004/py_pde-0.41.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e951279ff369d94222540c55170918516e91af24eb7241c20d1ae54ffc9f4d23",
"md5": "3a61719b7bc7e0cd552e0e254815d83a",
"sha256": "78bc52c1bd7fbc78c6f9afaaaeada2e4827f1985fc540d032471061463488010"
},
"downloads": -1,
"filename": "py_pde-0.41.0.tar.gz",
"has_sig": false,
"md5_digest": "3a61719b7bc7e0cd552e0e254815d83a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.9",
"size": 1639772,
"upload_time": "2024-08-05T09:22:44",
"upload_time_iso_8601": "2024-08-05T09:22:44.924399Z",
"url": "https://files.pythonhosted.org/packages/e9/51/279ff369d94222540c55170918516e91af24eb7241c20d1ae54ffc9f4d23/py_pde-0.41.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-05 09:22:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zwicker-group",
"github_project": "py-pde",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "matplotlib",
"specs": [
[
">=",
"3.1"
]
]
},
{
"name": "numba",
"specs": [
[
">=",
"0.59"
]
]
},
{
"name": "numpy",
"specs": [
[
">=",
"1.22"
]
]
},
{
"name": "scipy",
"specs": [
[
">=",
"1.10"
]
]
},
{
"name": "sympy",
"specs": [
[
">=",
"1.9"
]
]
},
{
"name": "tqdm",
"specs": [
[
">=",
"4.66"
]
]
}
],
"lcname": "py-pde"
}