Interpolation

From Met Dynamics
Jump to navigation Jump to search

Description

This article describes linear and cubic spline data interpolation methods.

Model theory

Figure 1. An example of cubic spline interpolation with linear extrapolation at the extents. The spline shown is non-monotonic.

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:

  1. Interpolation: for . (The spline passes through all data points.)
  2. 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:

where:

  • is the number of data points
  • is the number of interpolation points
  • is an array of the known independent data values
  • is an array of the known dependent data values
  • is an array of the independent data values at which the dependant variable is to be interpolated
  • is an array of the interpolated dependant variable values
Figure 1. Example showing the selection of the known_xs (blue frame), known_ys (red frame), xs (purple frame), and Results (light blue frame) arrays in Excel.

References

  1. 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.