projects / proj-math-005
Next task →
Projects/Foundations/Runge phenomenon and Chebyshev interpolation — controlled synthetic benchmark
Level 2 · foundational · ~9 h

Runge phenomenon and Chebyshev interpolation — controlled synthetic benchmark

Interpolate the Runge function with equispaced and Chebyshev nodes for n=5..40 and demonstrate the divergence of the first and convergence of the second. Use a fixed seed, a controlled ground truth, and an ablation grid over the key hyperparameter.
Add to portfolio →
Prerequisites

Problem statement

  • 01Interpolate the Runge function with equispaced and Chebyshev nodes for n=5..40 and demonstrate the divergence of the first and convergence of the second. Use a fixed seed, a controlled ground truth, and an ablation grid over the key hyperparameter.

Real-world motivation

  • 01Node placement, not polynomial degree alone, determines interpolation quality. The controlled synthetic benchmark setting forces concrete choices about data, scale and evaluation.

Learning objectives

  • 01Implement barycentric interpolation
  • 02Compare node families
  • 03Plot Lebesgue constants
  • 04Report relative error against the analytic ground truth alongside the baseline metrics.

Technical architecture

  • 01barycentric weights for each node family
  • 02evaluation on a dense grid
  • 03Lebesgue constant estimator

Mathematical foundations

  • 01$\ell_j(x)=\frac{w_j/(x-x_j)}{\sum_k w_k/(x-x_k)}$ with barycentric weights $w_j$
  • 02Lebesgue constant $\Lambda_n=\max_x\sum_j|\ell_j(x)|$

Dataset and sources

  • 01synthetic matrices generated with numpy.random.default_rng(42)
  • 02condition numbers 1, 10, 100, 1000

Step-by-step tasks

  • 01Frame the task and freeze the controlled synthetic benchmark evaluation protocol with a fixed random seed.
  • 02Implementation 1: Compute weights in O(n^2)
  • 03Implementation 2: Vectorize evaluation over a 10k-point grid
  • 04Implementation 3: Estimate max error on the grid
  • 05Verification 1: Verify interpolation at nodes to machine precision
  • 06Verification 2: Check partition of unity sum(ell_j)=1
  • 07Run the ablation grid and report relative error against the analytic ground truth over three independent trials.

Implementation requirements

  • 01Compute weights in O(n^2)
  • 02Vectorize evaluation over a 10k-point grid
  • 03Estimate max error on the grid
  • 04Log all hyperparameters and the random seed for the controlled synthetic benchmark run.

Testing requirements

  • 01Verify interpolation at nodes to machine precision
  • 02Check partition of unity sum(ell_j)=1
  • 03Measure relative error against the analytic ground truth over at least three seeds.

Evaluation metrics

  • 01max interpolation error
  • 02Lebesgue constant
  • 03relative error against the analytic ground truth

Expected outputs

  • 01overlay plot of interpolants
  • 02error versus n curve

Common failure modes

  • 01barycentric formula divides by zero at nodes without special handling
  • 02high-degree equispaced interpolation diverges near endpoints
  • 03ill-conditioning above 1e3 makes double precision futile

Stretch goals

  • 01implement Clenshaw-Curtis quadrature from the same nodes
  • 02test piecewise cubic splines
  • 03repeat in float32 and quantify the extra error floor

Research extensions

  • 01derive the exponential growth rate of the Lebesgue constant
  • 02study least-squares polynomial fits as an alternative

GitHub submission requirements

  • 01A repository whose README states the controlled synthetic benchmark protocol and the exact command to reproduce it.
  • 02Source for the scratch implementation, a test file, and a results table with uncertainty estimates.
  • 03A two-page report explaining failures on synthetic matrices generated with numpy.random.default_rng(42) and what the ablation revealed.

Completion rubric

  • 01barycentric weights correct
  • 02both node families tested
  • 03divergence explained by node density
  • 04Extra credit: repeat in float32 and quantify the extra error floor

Submit when every rubric item is satisfied and your repository contains runnable code plus a reproduction command.