Skip to main content

py-pde

py-pde Logo

PyPI version Conda Version License: MIT Build Status codecov Binder Documentation Status DOI

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 finite differences, which 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, jax, or torch for speed.

Try it online!

Installation

PyPI / pip

py-pde is available on pypi, so you should be able to install it through pip:

pip install py-pde

In order to have all features of the package available, you might want to install the following optional packages manually (all or a subset of these):

pip install h5py pandas mpi4py numba-mpi py-modelrunner napari ffmpeg-python

or using the py-pde package variants mpi, io and/or interactive (any combination):

pip install py-pde[mpi]
pip install py-pde[io]
pip install py-pde[interactive]
pip install py-pde[mpi,io,interactive]

Moreover, ffmpeg needs to be installed for creating movies.

conda

As an alternative, you can install py-pde through conda using the conda-forge channel:

conda install -c conda-forge py-pde

Installation with conda includes the optional dependencies of py-pde.

Arch Linux package

py-pde is also available as an Arch package.

Usage

A simple example showing the evolution of the diffusion equation in 2d:

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 can be implemented as

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

Metadata

Release files for py-pde 0.61.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-pde 0.61.0
File Size Uploaded Provenance Actions
py_pde-0.61.0.tar.gz 3.0 MB Without provenance Details for py_pde-0.61.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-pde 0.61.0
File Interpreter ABI Platform Actions
py_pde-0.61.0-py3-none-any.whl Python 3 none any Details for py_pde-0.61.0-py3-none-any.whl

Total release size: 3.5 MB

Release files / py_pde-0.61.0.tar.gz

Download URL py_pde-0.61.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
df3417f521b0a7da11206bc4119f6e61350fc2bcaf3c6d78256c7d8ad16c0d0f
BLAKE2b-256 checksum
How to use checksums
d23d41d6a5f69bd7cac2e5add1457b4b8d44a27acde8ac8a0229a267986a152b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / py_pde-0.61.0-py3-none-any.whl

Download URL py_pde-0.61.0-py3-none-any.whl
Size 476.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c67bba3aeb20dea0605e35b5455926c4e6b8c2d1341eee9a931367b2d7bbeb7
BLAKE2b-256 checksum
How to use checksums
6124c0ab937f10cb9eb0216dc5fd4377d892ea9d8cb0405bdc3c1c6a8f9bf1c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for py-pde 0.61.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.61.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page