A package finit-difference matrix generation.
Project description
PyFinitDiff
PyFinitDiff
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:
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:
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.
PyMieSim was written by Martin Poinsinet de Sivry-Houle .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyfinitdiff-2.0.4.post0.tar.gz
.
File metadata
- Download URL: pyfinitdiff-2.0.4.post0.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 846cc17f4f3f1ffdfbf726fcafe10682be053acb1dc521b39994a0dea169a000 |
|
MD5 | 7246ad66b9b0bf93f85c0f3b89884b60 |
|
BLAKE2b-256 | 6f30af5a1e6c62aa3dddbfed25b047fd708f53eec6783d793a5d457f77e307dc |
File details
Details for the file PyFinitDiff-2.0.4.post0-py3-none-any.whl
.
File metadata
- Download URL: PyFinitDiff-2.0.4.post0-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 034d49138c99393dd7af86d66fd680a03640227dc57e505c171b70275c8d993f |
|
MD5 | 155eb7ad94ff807c71529be1ae00cf6d |
|
BLAKE2b-256 | a09bd04a7eb2262c9832399c3197f7a448067f6ffff177f0ad6ed1389c617baf |