Mathematics / Lagrange Polynomial Interpolation
FREE TO EXPLORE
LABORATORY 21 · MATHEMATICS

Lagrange Polynomial Interpolation & Uniform Error Bound Convergence

Construct the degree-n Lagrange interpolating polynomial across equidistant nodal abscissas, analyze the nodal basis functions, and quantitatively evaluate uniform error convergence as grid spacing h decreases. Explore interactive numerical methods, evaluate error attenuation and verify convergence orders.

COMPUTE · CONVERGE · ANALYSE

Your virtual mathematics laboratory.

MAXIMUM INTERPOLATION ERROR ||F - P_N||_∞—
COMPUTATION STATUS

Ready to execute Step = 1.

1 step
Basis type: Lagrange cardinal polynomials L_{n,j}(x) = ∏_{i≠j} (x - x_i) / (x_j - x_i)

Adjust Step, then execute computation.

Mathematical operations are computed deterministically using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations.

Numerical assumptions and limits

Equidistant high-degree polynomial interpolation suffers from Runge's phenomenon, restricting uniform mesh interpolation to low polynomial degrees. The simulation evaluates the degree-3 Lagrange interpolant on refined sub-elements of width h = 0.20 / 2^{k-1}. The maximum error ||f - P_3||_∞ is measured against the true function across a dense test lattice. The logarithmic fit ln(E) = α·ln(h) + ln(C) extracts the asymptotic order α = 4.000 with R² = 1.000000.

Computational tools & numerical modules.

Lagrange Cardinal Basis Generator

Synthesizes the product form basis polynomials L_{n,j}(x) satisfying the Kronecker delta property L_{n,j}(x_k) = δ_{jk} across all nodal points.

Equidistant Mesh Discretizer

Partitions the interval [a, b] into n uniform sub-elements with grid step h = (b - a)/n to study systematic mesh refinement.

Barycentric Lagrange Engine

Implements the second barycentric formula with barycentric weights w_j = 1/∏_{k≠j} (x_j - x_k) for numerical stability and O(n) per-point evaluation.

Supremum Error Norm Scanner

Samples the difference |f(x) - P_n(x)| over dense micro-grids to accurately identify the maximum error ||E||_∞.

Lebesgue Function Analyzer

Evaluates the Lebesgue function λ_n(x) = ∑ |L_{n,j}(x)| and tracks the exponential growth of the Lebesgue constant Λ_n for uniform nodes.

Log-Log Convergence Regression Pipeline

Performs ordinary least-squares regression on (ln(h), ln(E_max)) to extract the experimental convergence order α.

FOLLOW THE METHOD

A reason behind every step.

Construct the degree-n Lagrange interpolating polynomial across equidistant nodal abscissas, analyze the nodal basis functions, and quantitatively evaluate uniform error convergence as grid spacing h decreases. Standardized input settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 step.

01

Initialize Domain & Objective Function

Select the analytic test function f(x) = sin(πx) on the normalized interval [0, 1] and configure IEEE 754 double precision registers.

02

Set Mesh Refinement Level

Specify the discretization level k from 1 to 6, setting node count n = 2k + 1 and mesh spacing h = 1.0 / n.

03

Construct Lagrange Basis Polynomials

Compute the nodal points x_j = a + j·h and evaluate the cardinal polynomials L_{n,j}(x) ensuring strict unity at x_j and zero at all other nodes.

04

Assemble Global Interpolant

Construct P_n(x) = ∑_{j=0}^n f(x_j)·L_{n,j}(x) using the numerically robust barycentric formulation to prevent catastrophic cancellation.

05

Measure Supremum Interpolation Error

Evaluate the interpolation residual |f(x) - P_n(x)| over 1000 interior test points, capturing the maximum error E_max = ||f - P_n||_∞.

06

Linearize Error Telemetry & Log Fit

Transform mesh spacing and maximum error into logarithmic coordinates (ln(h), ln(E_max)), append to the notebook, and fit the convergence slope α.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into mathematical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Lagrange Polynomial Interpolation mathematical scaling.

LINEAR ASYMPTOTIC FIT · y = mx + b
ln(E_max) = α · ln(h) + ln(C)
#Mesh Refinement Level (k) (step)Maximum Interpolation Error ||f - P_n||_∞ (error norm)Logarithmic Mesh Spacing ln(h)Logarithmic Max Error ln(E_max)Remove

No readings yet. Execute a computation and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the mathematical metrics mean.

For a fixed cubic polynomial interpolant (degree n = 3) on a uniform sub-interval of width h, how does the maximum error scale as h → 0?

What is the value of the cardinal basis polynomial L_{n,j}(x_k) when evaluated at the interpolation node x_k?

What causes the severe divergence known as Runge's phenomenon near interval boundaries for uniform nodes?

What is the computational complexity of evaluating an already constructed interpolant at a new point x using the second barycentric formula?