Skip to main content

PDEPy

Supported Python versions PyPI version Build Status Coverage Status Code style: black

A Python 3 library for solving initial and boundary value problems of some linear partial differential equations using finite-difference methods.

  • Laplace
    • Implicit Central
  • Parabolic
    • Explicit Central
    • Explicit Upwind
    • Implicit Central
    • Implicit Upwind
  • Wave
    • Explicit
    • Implicit

Usage

Installation

pip install pdepy

Examples

Laplace's Equation

import numpy as np
from pdepy import laplace

xn, xf, yn, yf = 30, 3.0, 40, 4.0

x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)

f = lambda x, y: (x - 1) ** 2 - (y - 2) ** 2
bound_x0 = f(0, y)
bound_xf = f(xf, y)
bound_y0 = f(x, 0)
bound_yf = f(x, yf)

axis = x, y
conds = bound_x0, bound_xf, bound_y0, bound_yf

laplace.solve(axis, conds, method="ic")

Parabolic Equation

import numpy as np
from pdepy import parabolic

xn, xf, yn, yf = 40, 4.0, 50, 0.5

x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)

init = x ** 2 - 4 * x + 5
bound = 5 * np.exp(-y)

p, q, r, s = 1, 1, -3, 3

axis = x, y
conds = init, bound, bound
params = p, q, r, s

parabolic.solve(axis, params, conds, method="iu")

Wave Equation

import numpy as np
from pdepy import wave

xn, xf, yn, yf = 40, 1.0, 40, 1.0

x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)

d_init = 1
init = x * (1 - x)
bound = y * (1 - y)

axis = x, y
conds = d_init, init, bound, bound

wave.solve(axis, conds, method="i")

Development

Create virtual environment and install requirements:

bin/setup_venv

Other commands

Run command in virtual environment:

bin/run <command>

Install requirements:

bin/install_requirements

Format codebase:

bin/format

Lint codebase:

bin/lint

Run unit tests:

bin/test

Publish

Package and distribute:

bin/publish

Metadata

Release files for pdepy 1.0.4

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

Source distribution (sdist)

Source distribution for pdepy 1.0.4
File Size Uploaded Provenance Actions
pdepy-1.0.4.tar.gz 6.3 kB Without provenance Details for pdepy-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pdepy 1.0.4
File Interpreter ABI Platform Actions
pdepy-1.0.4-py3-none-any.whl Python 3 none any Details for pdepy-1.0.4-py3-none-any.whl

Total release size: 14.3 kB

Release files / pdepy-1.0.4.tar.gz

Download URL pdepy-1.0.4.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d8fe1f6089794e8c7e1df089894b5c7bef954ccd4f15e979e3a41bb12ec7053a
BLAKE2b-256 checksum
How to use checksums
a2aff05c48054e21aa50953c1cc685780d274abeb3a152b07a45b982b45d48a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Release files / pdepy-1.0.4-py3-none-any.whl

Download URL pdepy-1.0.4-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7414de3288fc9b07c574bab6deb4edd0aac3fe97e8459727e241ab4019e65ff
BLAKE2b-256 checksum
How to use checksums
26fc62568f2c7761b5b06435d8b588f2e640d759945e01d580a79e3a80c8dcf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

Security for pdepy 1.0.4

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.

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