Mathematical background
The mathematical foundation of the interpolation algorithms used in Cubinterpp is based on the mathematical formulations outlined by Lalescu, 20091. Lalescu treats Hermite splines as well as grid splines. Cubinterpp only uses the former type of splines.
First, the general definition of 1
-Dimensional (1D
) splines and the
generalization to N
-Dimensional (ND
) Hermite splines for \(n^\textrm{th}\)
order splines shall be introduced here.
Spline definitions are only given for a specific interval (a.k.a. cell). E.g.
for the 1
-Dimensional case this would be \(x \in [x_0, x_0 + h]\) for which the
values of \(f(x)\) are provided on the interval edges, i.e. \(x_0\) and \(x_0 + h\).
Note
The extension to piecewise interpolation with a series neighboring cells is not treated here.
1
dimension
The main goal is to find an approximating interpolation of \(f(x)\) on an
interval \(x \in [x_0, x_0 + h]\), given values and derivatives of \(f(x)\) on the boundaries of that interval.
In the following the interval is normalized from \(x \in [x_0, x_0 + h]\) to \(\bar
x \in [0, 1]\).
Tip
The sections for the linear and cubic interpolation will give the non-normalized formulations.
For the 1
-Dimensional case, the goal is to obtain a polynomial
that approximates \(f(x)\) in the interpolation interval. Here, \(n\) is the order of the spline, \(\bar x\) the variable coordinate and \(\bar a_k\) are the to-be-determined coefficients.
The (derivate) values \(f^{(l)}(\bar x)\), where \(f^{(l)}(\bar x) \equiv \frac{\textrm{d}^lf(\bar x)}{\textrm{d}\bar x^l}\), are assumed to coincide with those of \(s^{(n)}(\bar x)\) on the boundaries of the interval.
Given this, according to Lalescu, 20091, \(s^{(n)}(\bar x)\) can be written as follows:
where \(m \equiv (n-1)/2\) and \(\alpha^{(n,l)}_i\) becomes
Using this, it's possible to determine the values of \(a_k\).
N
dimensions
For the ND
case, the polynomial to describe the interpolation with \(N\)
variables \(\bar x_i\) for \(i=1,\dots,N\) defined for the interval \([0, 1]^N\)
reads
The 1D
spline definition, now depending on the input values of
\(f^{(l_1,\dots,l_N)}(\bar x_1,\dots,\bar x_N)\) can be directly be generalized to
the following:
For multiple dimensions, we're now also dealing with (combined) derivatives in multiple directions. That is, \(f^{(l_1,\dots,l_N)}\), which is defined as:
Using this, it's possible to determine the values of \(\bar a_{i_1,\dots,i_N}\).
Specific implementations
Specific derivations for linear (\(n=1\)) and cubic splines (\(n=3\)) can be found
in the sections linear interpolation and cubic
interpolation. These sections will show how to determine the values
of \(a_k\) and \(a_{i_1,\dots,i_N}\) for the 1D
, 2D
and ND
cases, and will
also present the non-normalized formulations.
-
Lalescu, C.C., 2009, Two hierarchies of spline interpolations. Practical algorithms for multivariate higher order splines. arXiv:0905.3564 ↩↩