Interpolation
Description
This article describes linear and cubic spline data interpolation methods.
Model theory
Linear interpolation
Linear interpolation is a technique for approximating the value of a function between two known data points. It involves constructing a straight line that passes through the two given points and using this line to estimate the value of the function at an intermediate point.
Given two data points and , where , the linear interpolation formula to estimate the value at a point within the interval is:
Linear interpolation provides a simple and computationally efficient method for approximating function values.
Cubic spline interpolation
Cubic spline interpolation uses a piecewise cubic polynomial to approximate a function smoothly between known data points.
Given a set of distinct data points , where , a cubic spline interpolator constructs a piecewise cubic polynomial that satisfies the following conditions:
- Interpolation: for . (The spline passes through all data points.)
- Smoothness: and its first two derivatives are continuous across the entire interval . (The spline has no abrupt changes in its slope or curvature.)
Cubic splines offer enhanced accuracy and flexibility compared to linear interpolation, especially for functions with nonlinear behavior.
The following features are also applied for this implementation of cubic splines:
- Linear extrapolation at the extents of the data set, as illustrated in Figure 1, and
- Monotonicity of the spline may be optionally enforced.
Please see the Wikipedia articles on Spline interpolation and Monotone cubic interpolation, or references such as Napier-Munn et al. (1996) for a more detailed description of cubic spline interpolation.[1]
Excel
The interpolation methods may be invoked from the Excel formula bar with the following function calls:
=mdInterp_Linear(known_xs as Range, known_ys as Range, xs as Range)
and
=mdInterp_CubicSpline(known_xs as Range, known_ys as Range, xs as Range, Optional monotonic as Boolean = false)
Invoking the function with no arguments will print Help text associated with the model, including a link to this page.
The input parameters and calculation results are defined below in matrix notation, along with an example image showing the selection of the same cells and arrays in the Excel interface:
|
|
References
- ↑ Napier-Munn, T.J., Morrell, S., Morrison, R.D. and Kojovic, T., 1996. Mineral comminution circuits: their operation and optimisation. Julius Kruttschnitt Mineral Research Centre, Indooroopilly, QLD.