Metadata-Version: 2.4
Name: numroot
Version: 0.1.1
Summary: Numerical analysis solver for equations and optimization
Author: Galhardo Jules
Maintainer: Galhardo Jules
Project-URL: Homepage, https://github.com/Onniryss/numroot
Project-URL: Documentation, https://numroot.readthedocs.io/
Project-URL: Repository, https://github.com/Onniryss/numroot.git
Project-URL: Bug Tracker, https://github.com/Onniryss/numroot/issues
Keywords: numerical-analysis,mathematics,solver,equations
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.20.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"

# NumRoot

[![PyPI version](https://badge.fury.io/py/numroot.svg)](https://badge.fury.io/py/numroot)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)

Python package for numerical resolution of nonlinear equations with several numerical analysis methods.

## 🚀 Installation

```bash
pip install numroot
```

### Development installation

```bash
pip install numroot[dev]
```

## 📖 Quick use

```python
from numroot import NonlinearSolver

# Create a solver object
solver = NonlinearSolver()

# Define a function to analyse (example: x² - 2 = 0)
def f(x):
    return x**2 - 2

# Bissection method
result = solver.bisection(f, x_a=0, x_b=2, epsilon=1e-6)
print(f"Root found: {result.root}")  # ≈ 1.414
print(f"Number of iterations: {result.iterations}")

# Newton-Raphson method
def df(x):
    return 2*x

result = solver.newton_raphson(f, df, x_0=1.5, epsilon=1e-6)
print(f"Root found: {result.root}")  # ≈ 1.414
print(f"Number of iterations: {result.iterations}")

# Secant method
result = solver.secant(f, x_0=1.0, x_1=2.0, epsilon=1e-6)
print(f"Root found: {result.root}")  # ≈ 1.414
print(f"Number of iterations: {result.iterations}")
```

## 🔧 Available methods

### Bissection method
- **Advantages**: Always convergent, robust
- **Disadvantages**: Slow convergence
- **Usage**: When you have an interval [a,b] where f(a) and f(b) have opposite signs

```python
result = solver.bisection(func, a, b, epsilon=1e-6, maxiter=100)
```

### Newton-Raphson method
- **Advantages**: Very fast quadratic convergence
- **Disadvantages**: Requires derivative, may diverge
- **Usage**: When you know the derivative and have a good initial estimate

```python
result = solver.newton_raphson(func, dfunc, x0, epsilon=1e-6, maxiter=100)
```

### Secant method
- **Advantages**: No derivative needed, super-linear convergence
- **Disadvantages**: Can be unstable with bad initial points.
- **Uses**: Compromise between bisection and Newton-Raphson

```python
result = solver.secant(func, x0, x1, epsilon=1e-6, maxiter=100)
```

## 🎯 Typical use cases

- Solving physical equations (trajectories, oscillations)
- Engineering calculations (balance points, intersections)
- Mathematical modeling (zeros of complex functions)
- Research and education in numerical analysis

## 📋 Requirements

- Python 3.8+
- NumPy >= 1.20.0

## 🔗 Links

- [Documentation complète](https://numroot.readthedocs.io/)
- [PyPI](https://pypi.org/project/numroot/)
- [Issues GitHub](https://github.com/Onniryss/numroot/issues)
- [Code source](https://github.com/Onniryss/numroot)

## 📈 Roadmap

- [ ] Systems of non-linear equations
- [ ] Ordinary differential equations
- [ ] Numerical optimization
- [ ] Graphical interface
- [ ] Interactive visualizations

## 📚 References

- [Geeks for Geeks - Secant method](https://www.geeksforgeeks.org/secant-method-of-numerical-analysis/)
- [Math Libretexts - Bisection Method](https://math.libretexts.org/Workbench/Numerical_Methods_with_Applications_(Kaw)/3:_Nonlinear_Equations/3.03:_Bisection_Methods_for_Solving_a_Nonlinear_Equation)
- [Math Libretexts - Newton-Raphson Method](https://math.libretexts.org/Workbench/Numerical_Methods_with_Applications_(Kaw)/3:_Nonlinear_Equations/3.04:_Newton-Raphson_Method_for_Solving_a_Nonlinear_Equation)
