A library for solving linear and nonlinear systems of equations using various methods.
Project description
Linear and Nonlinear Solver
This project provides a Python library for solving both linear and nonlinear systems of equations using various numerical methods. The library includes implementations of the following methods:
Linear Methods
- Gauss Elimination: A method for solving linear systems by transforming the system into an upper triangular matrix.
- Gauss-Jordan Elimination: An extension of Gauss elimination that reduces the matrix to reduced row echelon form.
- Cramer's Rule: A method for solving linear systems using determinants, applicable when the system has a unique solution.
- LU Decomposition: A method that factors a matrix into a lower triangular matrix and an upper triangular matrix to simplify solving linear systems.
Nonlinear Methods
- Jacobi Method: An iterative method for solving a system of nonlinear equations.
- Gauss-Seidel Method: An improvement over the Jacobi method that uses the latest available values for faster convergence.
- Bisection Method: A root-finding method that repeatedly bisects an interval and selects a subinterval in which a root exists.
Installation
To install the library, clone the repository and run the following command:
pip install .
Usage
Linear Methods
from solver.linear.gauss_elimination import gauss_elimination
from solver.linear.gauss_jordan import gauss_jordan
from solver.linear.cramer_rule import cramer_rule
from solver.linear.lu_decomposition import lu_decomposition
# Example usage
matrix = [[2, 1, -1], [3, 3, 9], [3, 3, 5]]
b = [8, 0, 4]
solution = gauss_elimination(matrix, b)
Nonlinear Methods
from solver.nonlinear.jacobi import jacobi_method
from solver.nonlinear.gauss_seidel import gauss_seidel_method
from solver.nonlinear.bisection import bisection_method
# Example usage
def func(x):
return x**3 - x - 2
root = bisection_method(func, 1, 2)
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hg22017uno-0.2.3.tar.gz.
File metadata
- Download URL: hg22017uno-0.2.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2622cd6abf5b2b836869fbb948c1469cb28110f46750fa505152489db2580c9e
|
|
| MD5 |
b250e9dc71fa9a20cabb8cdb0a3bece1
|
|
| BLAKE2b-256 |
00201375914e6ba52eb6ce4ee7cd8ee7dc5ae24ec45591156a4481613a8763e1
|
File details
Details for the file hg22017uno-0.2.3-py3-none-any.whl.
File metadata
- Download URL: hg22017uno-0.2.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5861df1b95f81c108d46d04fbe69c5411bd8ddd0f595f42e7d1214b54b1195f8
|
|
| MD5 |
d87c950e2f7f25bcf9520d7401a48473
|
|
| BLAKE2b-256 |
475d7e0886097ed20c7cfc4f1490d0513f2db28ffebe33511b480b24e21e855c
|