root-finding

Solid

Problem-solving strategies for root finding in numerical methods

AI & Automation 496 stars 41 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
90
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Root Finding ## When to Use Use this skill when working on root-finding problems in numerical methods. ## Decision Tree 1. **Characterize the Problem** - Single root or multiple roots? - Bracketed (know interval containing root)? - Derivatives available? 2. **Method Selection** | Situation | Method | Implementation | |-----------|--------|----------------| | Bracketed, no derivatives | Bisection, Brent | `scipy.optimize.brentq` | | Derivatives available | Newton-Raphson | `scipy.optimize.newton` | | No derivatives | Secant method | `scipy.optimize.newton` (no fprime) | | System of equations | `scipy.optimize.fsolve` | Requires Jacobian ideally | 3. **Implement Root Finding** - `scipy.optimize.brentq(f, a, b)` - guaranteed convergence if bracketed - `scipy.optimize.newton(f, x0, fprime=df)` - quadratic convergence near root - For systems: `scipy.optimize.fsolve(F, x0)` 4. **Handle Multiple Roots** - Deflation: divide out found roots - Multiple starting points - `sympy_compute.py solve "f(x)" --var x` for symbolic solutions 5. **Verify Solutions** - Check |f(root)| < tolerance - Verify root is in expected domain - `z3_solve.py prove "f(root) == 0"` ## Tool Commands ### Scipy_Brentq ```bash uv run python -c "from scipy.optimize import brentq; root = brentq(lambda x: x**2 - 2, 0, 2); print('Root:', root)" ``` ### Scipy_Newton ```bash uv run python -c "from scipy.opt...

Details

Author
vibeeval
Repository
vibeeval/vibecosystem
Created
2 months ago
Last Updated
1 months ago
Language
C#
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category