# NumRoot
[](https://badge.fury.io/py/numroot)
[](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)
Raw data
{
"_id": null,
"home_page": null,
"name": "numroot",
"maintainer": "Galhardo Jules",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "numerical-analysis, mathematics, solver, equations",
"author": "Galhardo Jules",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ef/95/dccc3de94a998b6ecb0d639a775d0f05aa45913fab964428ea134c07ddd5/numroot-0.1.1.tar.gz",
"platform": null,
"description": "# NumRoot\n\n[](https://badge.fury.io/py/numroot)\n[](https://www.python.org/downloads/)\n\nPython package for numerical resolution of nonlinear equations with several numerical analysis methods.\n\n## \ud83d\ude80 Installation\n\n```bash\npip install numroot\n```\n\n### Development installation\n\n```bash\npip install numroot[dev]\n```\n\n## \ud83d\udcd6 Quick use\n\n```python\nfrom numroot import NonlinearSolver\n\n# Create a solver object\nsolver = NonlinearSolver()\n\n# Define a function to analyse (example: x\u00b2 - 2 = 0)\ndef f(x):\n return x**2 - 2\n\n# Bissection method\nresult = solver.bisection(f, x_a=0, x_b=2, epsilon=1e-6)\nprint(f\"Root found: {result.root}\") # \u2248 1.414\nprint(f\"Number of iterations: {result.iterations}\")\n\n# Newton-Raphson method\ndef df(x):\n return 2*x\n\nresult = solver.newton_raphson(f, df, x_0=1.5, epsilon=1e-6)\nprint(f\"Root found: {result.root}\") # \u2248 1.414\nprint(f\"Number of iterations: {result.iterations}\")\n\n# Secant method\nresult = solver.secant(f, x_0=1.0, x_1=2.0, epsilon=1e-6)\nprint(f\"Root found: {result.root}\") # \u2248 1.414\nprint(f\"Number of iterations: {result.iterations}\")\n```\n\n## \ud83d\udd27 Available methods\n\n### Bissection method\n- **Advantages**: Always convergent, robust\n- **Disadvantages**: Slow convergence\n- **Usage**: When you have an interval [a,b] where f(a) and f(b) have opposite signs\n\n```python\nresult = solver.bisection(func, a, b, epsilon=1e-6, maxiter=100)\n```\n\n### Newton-Raphson method\n- **Advantages**: Very fast quadratic convergence\n- **Disadvantages**: Requires derivative, may diverge\n- **Usage**: When you know the derivative and have a good initial estimate\n\n```python\nresult = solver.newton_raphson(func, dfunc, x0, epsilon=1e-6, maxiter=100)\n```\n\n### Secant method\n- **Advantages**: No derivative needed, super-linear convergence\n- **Disadvantages**: Can be unstable with bad initial points.\n- **Uses**: Compromise between bisection and Newton-Raphson\n\n```python\nresult = solver.secant(func, x0, x1, epsilon=1e-6, maxiter=100)\n```\n\n## \ud83c\udfaf Typical use cases\n\n- Solving physical equations (trajectories, oscillations)\n- Engineering calculations (balance points, intersections)\n- Mathematical modeling (zeros of complex functions)\n- Research and education in numerical analysis\n\n## \ud83d\udccb Requirements\n\n- Python 3.8+\n- NumPy >= 1.20.0\n\n## \ud83d\udd17 Links\n\n- [Documentation compl\u00e8te](https://numroot.readthedocs.io/)\n- [PyPI](https://pypi.org/project/numroot/)\n- [Issues GitHub](https://github.com/Onniryss/numroot/issues)\n- [Code source](https://github.com/Onniryss/numroot)\n\n## \ud83d\udcc8 Roadmap\n\n- [ ] Systems of non-linear equations\n- [ ] Ordinary differential equations\n- [ ] Numerical optimization\n- [ ] Graphical interface\n- [ ] Interactive visualizations\n\n## \ud83d\udcda References\n\n- [Geeks for Geeks - Secant method](https://www.geeksforgeeks.org/secant-method-of-numerical-analysis/)\n- [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)\n- [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)\n",
"bugtrack_url": null,
"license": null,
"summary": "Numerical analysis solver for equations and optimization",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/Onniryss/numroot/issues",
"Documentation": "https://numroot.readthedocs.io/",
"Homepage": "https://github.com/Onniryss/numroot",
"Repository": "https://github.com/Onniryss/numroot.git"
},
"split_keywords": [
"numerical-analysis",
" mathematics",
" solver",
" equations"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a05f3b0bad377a9ad387b78a12b48e275a7ba814519320efd8901028d141ce99",
"md5": "a49d4888226498cc1eba505e21e0d92f",
"sha256": "83840dbb00fbc844744af4e4ba6ec22d1a0190d31f3580c6c34a8b45e56ab4ab"
},
"downloads": -1,
"filename": "numroot-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a49d4888226498cc1eba505e21e0d92f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2599,
"upload_time": "2025-08-28T11:52:00",
"upload_time_iso_8601": "2025-08-28T11:52:00.106495Z",
"url": "https://files.pythonhosted.org/packages/a0/5f/3b0bad377a9ad387b78a12b48e275a7ba814519320efd8901028d141ce99/numroot-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ef95dccc3de94a998b6ecb0d639a775d0f05aa45913fab964428ea134c07ddd5",
"md5": "8cd9d9ca0a0acea523c120984cf7cef1",
"sha256": "98484f1c098de6859c81d7e80fef74644aa43f3e1f4c9fb3b8c2d295607d9a4c"
},
"downloads": -1,
"filename": "numroot-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "8cd9d9ca0a0acea523c120984cf7cef1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3419,
"upload_time": "2025-08-28T11:52:01",
"upload_time_iso_8601": "2025-08-28T11:52:01.175595Z",
"url": "https://files.pythonhosted.org/packages/ef/95/dccc3de94a998b6ecb0d639a775d0f05aa45913fab964428ea134c07ddd5/numroot-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 11:52:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Onniryss",
"github_project": "numroot",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "pytest",
"specs": []
}
],
"lcname": "numroot"
}