interpolation

Solid

Problem-solving strategies for interpolation in numerical methods

AI & Automation 3,795 stars 297 forks Updated 4 months ago MIT

Install

View on GitHub

Quality Score: 86/100

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

Skill Content

# Interpolation ## When to Use Use this skill when working on interpolation problems in numerical methods. ## Decision Tree 1. **Assess Data Characteristics** - How many data points? Spacing uniform or non-uniform? - Is data smooth or noisy? - Need derivatives at endpoints? 2. **Select Interpolation Method** - Few points (<10): Polynomial (Lagrange, Newton) - Many points, smooth data: Cubic splines - Noisy data: Smoothing splines or least squares - High dimensions: Use simplex-based (n+1 neighbors vs 2^n) 3. **Implement with SciPy** - `scipy.interpolate.CubicSpline(x, y)` - natural cubic spline - `scipy.interpolate.make_interp_spline(x, y, k=3)` - B-spline - `scipy.interpolate.interp1d(x, y, kind='cubic')` - 1D interpolation 4. **Validate Results** - Check for Runge's phenomenon at boundaries (high-degree polynomials) - Cross-validate: leave-one-out error estimation - Visual inspection of interpolated curve - `sympy_compute.py limit "interp_error" --at boundaries` 5. **High-Dimensional Considerations** - Coxeter-Freudenthal-Kuhn triangulation for O(n log n) point location - Barycentric subdivision for balanced performance ## Tool Commands ### Scipy_Cubic_Spline ```bash uv run python -c "from scipy.interpolate import CubicSpline; import numpy as np; x = np.array([0,1,2,3]); y = np.array([0,1,4,9]); cs = CubicSpline(x, y); print(cs(1.5))" ``` ### Scipy_Bspline ```bash uv run python -c "from scipy.interpolate import ma...

Details

Author
parcadei
Repository
parcadei/Continuous-Claude-v3
Created
5 months ago
Last Updated
4 months ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category