Runge's phenomenon: equally spaced high-degree polynomial interpolation ($n \geq 7$) produces large oscillations near the interval endpoints.
Results
—
Linear value
—
Lagrange value
—
Spline value
—
Condition no. (est.)
Interp
Interpolated values at query x = 0.5
CAE Relevance
Spline fitting of stress-strain curves for FEM material models / LS-DYNA *DEFINE_CURVE / field quantity interpolation between mesh nodes / NURBS and B-spline geometry (rational extensions of spline interpolation). PCHIP is recommended for monotone material data.
What is Interpolation?
🙋
What exactly is interpolation? I know it's about drawing a curve through points, but why are there so many different methods in this simulator?
🎓
Basically, interpolation is the process of constructing a new function that passes exactly through a set of known data points. The "why so many methods" is key: each one makes different trade-offs. For instance, a Lagrange polynomial gives you a single, smooth equation, but it can oscillate wildly between points—that's the famous Runge's phenomenon you can see in the simulator when you select the "Runge's Function" example dataset.
🙋
Wait, really? So a smoother curve can actually be worse? What's the alternative?
🎓
Exactly! A high-degree polynomial can be too "wiggly." In practice, we often use piecewise methods. Try switching the method from "Lagrange" to "Cubic Spline" in the simulator. Instead of one giant polynomial, it builds a separate cubic function between each pair of points and glues them together so the overall curve is smooth. The simulator visually shows you each piece.
🙋
Okay, I see "PCHIP" and "Spline" are both piecewise cubics. They look similar, but the simulator shows PCHIP is less wiggly sometimes. What's the physical difference?
🎓
Great observation! The physical difference is in the "continuity conditions." A cubic spline ensures the second derivative is continuous ($C^2$), which gives a very smooth-looking curve. PCHIP (Piecewise Cubic Hermite Interpolating Polynomial) only ensures the first derivative is continuous ($C^1$), and it chooses slopes specifically to preserve the shape of the data—like avoiding overshoots. This is crucial for material data. Try the "Non-monotonic" example: PCHIP won't create a new peak between the points, while the spline might.
Physical Model & Key Equations
The Lagrange interpolating polynomial constructs a single global $n$-th degree polynomial through $n+1$ points. It uses a clever basis where each basis function $L_i(x)$ is 1 at its own node $x_i$ and 0 at all others.
Here, $L(x)$ is the interpolant, $y_i$ are the known function values at nodes $x_i$. The product term $\prod_{j\neq i}$ constructs the $i$-th basis polynomial. While elegant, this global form is susceptible to large oscillations (Runge's phenomenon) for many equally-spaced points.
Cubic splines use a piecewise approach. On each interval $[x_i, x_{i+1}]$, a cubic polynomial $S_i(x)$ is defined. These pieces are "glued" together at the nodes (or "knots") by enforcing continuity of the function, its first derivative, and its second derivative.
These $C^2$ continuity conditions lead to a very smooth-looking curve. The "natural" spline adds the boundary condition $S''(x_0)=S''(x_n)=0$. Solving the resulting system of equations determines all the cubic coefficients.
Frequently Asked Questions
The Runge phenomenon is a problem that occurs with high-order polynomial interpolation (especially Lagrange interpolation) when using equally spaced data points, causing large oscillations at the interval edges. In this tool, you can intuitively observe the divergence at the edges by comparing the graphs of Lagrange interpolation and cubic spline interpolation for a smooth curve such as a sine function.
Lagrange/Newton interpolation is suitable when exact matching is required for a small number of points; cubic spline interpolation is suitable for curve approximation where smoothness is needed; PCHIP is suitable for data where monotonicity must be preserved (e.g., experimental values); and linear interpolation is suitable for simple interpolation with low computational cost. Check the characteristics of each method by comparing the graphs.
With equally spaced data, high-order Lagrange interpolation exhibits a pronounced Runge phenomenon, while cubic spline and PCHIP are relatively stable. With unequally spaced data (e.g., Chebyshev points), the oscillations in Lagrange interpolation may be suppressed. You can add or move points in the tool to test the differences in behavior.
Yes, you can click on the graph to add data points or drag existing points to move them. However, if points are placed extremely close together or if abrupt changes are introduced, unexpected oscillations may occur in high-order interpolation. Explore appropriate point arrangements while comparing the results.
Real-World Applications
CAE Material Modeling: In finite element analysis (FEA) software like LS-DYNA, material stress-strain curves are defined using tabular data (e.g., *DEFINE_CURVE). PCHIP interpolation is often recommended for this because it preserves monotonicity—if the stress increases with strain in your data, the interpolated curve won't create non-physical dips or peaks, ensuring solver stability.
Field Quantity Interpolation: When solving partial differential equations on a mesh, the solution (like temperature or pressure) is known at discrete nodes. To get values anywhere inside an element, linear or higher-order spline interpolation is used. This is fundamental to post-processing and visualizing results in any CAE software.
Computer-Aided Geometric Design (CAD): The NURBS (Non-Uniform Rational B-Splines) surfaces that define car bodies or aircraft fuselages in CAD are rational extensions of B-spline interpolation. They provide local control and high continuity, which is essential for manufacturing smooth surfaces.
Signal and Data Processing: When resampling or reconstructing a continuous signal from discrete measurements (like digital audio or sensor data), choosing the right interpolation (linear, cubic spline) directly affects the fidelity and smoothness of the reconstructed output.
Common Misconceptions and Points to Caution
First, the idea that "higher-degree interpolation is always better" is a major misconception. The Runge phenomenon in Lagrange interpolation is a classic example; for instance, taking 10 equally spaced points can cause the interpolating curve to oscillate wildly and deviate significantly from the actual data near the ends. This not only looks bad but can also reduce the prediction accuracy at intermediate points. In practice, the golden rule is to choose your method based on "the underlying physical behavior of the data" rather than just the number of data points.
Next, while "spline interpolation is often seen as a universal tool that smoothly handles everything," there are pitfalls. One such pitfall is "monotonicity preservation." When interpolating monotonically increasing data, like in the plastic deformation region of a material, using a spline can introduce slight decreases (overshoot), leading to physically unnatural results. Try using this tool to compare spline and PCHIP on monotonically increasing points like (1,1), (2,4), (3,9). You'll see that the PCHIP curve correctly preserves monotonicity.
Furthermore, it's dangerous to casually use interpolation for extrapolation (prediction) under the assumption "it works outside the interpolation points." Interpolation functions are designed to fill the "gaps" between given points; outside this range, they often diverge to completely meaningless values. You need to be especially careful about this when setting initial or boundary conditions in CAE.