A package for approximating roots using various methods.
Project description
RootDescent
rootdescent is a Python package for numerical analysis, offering tools for approximating roots and performing numerical integration.
Features
rootdescent currently includes the following classes and methods:
RootApproximator
This class provides methods for finding the roots of functions using various numerical approximation techniques. The available methods are:
- Bisection method (
bisection) - Fixed-point iteration (
fixed_point_iteration) - Regula Falsi method (
regula_falsi) - Newton-Raphson method (
newton_raphson) - Secant method (
secant)
Integration
This class provides methods for approximating definite integrals of functions using various numerical integration techniques. The available methods are:
- Trapezoidal rule (
trapezoidal_rule) - Simpson's 1/3 rule (
simpsons_13_rule) - Simpson's 3/8 rule (
simpsons_38_rule)
Usage
Here's an example of how to use rootdescent to approximate the root of a function and the integral of another function:
from rootdescent import RootApproximator, Integration
# Define the functions for root approximation and integration
def f(x):
return x**2 - 4
def g(x):
return x**3 - 6 * x**2 + 4 * x + 12
# Initialize the RootApproximator and Integration classes
root_approx = RootApproximator()
integration = Integration()
# Approximate the root of f(x) using the bisection method
root = root_approx.bisection(f, 0, 4, error=1e-6, display_iterations=False)
print(f"Root: {root}")
# Approximate the integral of g(x) using the trapezoidal rule
integral = integration.trapezoidal_rule(g, 1, 4, n=100)
print(f"Integral: {integral}")
## Installation
To install RootDescent, download the package and run the following command in your terminal or command prompt:
Replace my_function with your desired function and adjust the initial guesses and error according to your needs.
Contributing
Contributions are welcome! Please submit pull requests with bug fixes or new features.
License
This project is released under the MIT License.
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
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 rootdescent-0.1.0.tar.gz.
File metadata
- Download URL: rootdescent-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2eaacdf2bfb7d6f78f25c5fd982aba85c326c3d27f6ac2d427f1d661be5da6
|
|
| MD5 |
62462bfdde2f0acd7e9a59e0f126da4f
|
|
| BLAKE2b-256 |
64db76a31c86c8acd614308038128625614f7c2aeea5449891816fcb2d7abb0f
|
File details
Details for the file rootdescent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rootdescent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c07d26cef69cb8361785ce6acdc8835eec7e861bee7d7daead99f02cc909ada
|
|
| MD5 |
ea4ffe95e964764f9586787fc4cac39d
|
|
| BLAKE2b-256 |
7c3a2f6c25d8c6617bc1830c3118c6b8043c4e4799fdad29098cfd3d2882563e
|