Skip to main content

A package for generating finite-difference matrices, particularly suited for physics and engineering applications.

Project description

PyFinitDiff logo

Meta

Python

Documentation Status

Testing

Unittest Status

Unittest coverage

PyPi

PyPi version

PyPi version

Anaconda

Anaconda version

Anaconda downloads

PyFinitDiff is a robust Python package designed to compute finite-difference matrices with an intuitive API. This package provides an efficient and user-friendly interface for generating finite-difference approximations, making it ideal for numerical analysis and scientific computing.

Features

  • Intuitive API: PyFinitDiff offers an easy-to-use interface that allows users to generate finite-difference matrices with minimal effort.

  • Versatile Applications: Suitable for a wide range of numerical methods including solving partial differential equations (PDEs), performing numerical differentiation, and more.

  • Comprehensive Documentation: Detailed documentation and examples to help users get started quickly.

Installation

PyFinitDiff requires Python 3.10+ and is available on PyPi for various operating systems including Linux and macOS.

Install PyFinitDiff via pip:

pip install PyFinitDiff

Documentation

Comprehensive and up-to-date documentation is available online. You can access it here or by clicking the badge below:

Documentation Status

Usage Example

Below is a simple example to illustrate how to use PyFinitDiff:

from PyFinitDiff.finite_difference_1D import FiniteDifference
from PyFinitDiff.finite_difference_1D import Boundaries

boundaries = Boundaries(left='none', right='none')

n_x = 100
fd = FiniteDifference(
   n_x=n_x,
   dx=1,
   derivative=2,
   accuracy=2,
   boundaries=boundaries
)

fd.triplet.plot()

dense_matrix = fd.triplet.to_scipy_sparse()

sparse_matrix = fd.triplet.to_scipy_sparse()

This would produce the following figure:

example_triplet_0

This example demonstrates the creation of a second-order finite-difference matrix with a specified grid spacing and size.

Testing

To test PyFinitDiff locally, clone the GitHub repository and run the tests with coverage:

git clone https://github.com/MartinPdeS/PyFinitDiff.git
cd PyFinitDiff
pip install PyFinitDiff[testing]
pytest

Contributing

As PyFinitDiff is under continuous development, contributions are welcome! If you would like to collaborate or suggest improvements, feel free to fork the repository and submit a pull request. For major changes, please open an issue first to discuss your ideas.

Contact Information

As of 2024, the project is still under development. If you want to collaborate, it would be a pleasure! I encourage you to contact me.

PyFinitDiff was written by Martin Poinsinet de Sivry-Houle .

Email:martin.poinsinet.de.sivry@gmail.ca .

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

pyfinitdiff-2.1.3.post0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

PyFinitDiff-2.1.3.post0-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file pyfinitdiff-2.1.3.post0.tar.gz.

File metadata

  • Download URL: pyfinitdiff-2.1.3.post0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for pyfinitdiff-2.1.3.post0.tar.gz
Algorithm Hash digest
SHA256 216b8a447e5b254b438d006d9e45b83b0c02c9696f226e9453c1af03ae92292d
MD5 5fab273962a78edfbebce293ec1f7104
BLAKE2b-256 1af7ac56007c4e302871e16a89a066527e004615b309229f9ed1b64028411daa

See more details on using hashes here.

File details

Details for the file PyFinitDiff-2.1.3.post0-py3-none-any.whl.

File metadata

File hashes

Hashes for PyFinitDiff-2.1.3.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a97d6e4fc4b2d03b589410ae6575efb28fa2b861fb4e6c298a1f02c5fb9d6c1
MD5 519442a5a84a3f6aba601ac60a0d81b0
BLAKE2b-256 a3ecfdd085223b0a452cd1a552514bdc4caf6c22292322e3a6320d2b08d214c1

See more details on using hashes here.

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