Spline Functions

This page describes AMA Spline Library functions to evaluate, differentiate and integrate tensor product splines and other functions for manipulating a AMA_SPLINE structure.

The AMA Spline Library provides the Univariate Data Functions and Multivariate Data Functions to compute a spline $s({\bf X}):{\rm R}^n\rightarrow{\rm R}^1$ which either approximates or interpolates univariate data, $n=1$, or multivariate data, $n>1$, respectively. These splines are represented as

\[ s({\bf X}) = \sum_{j_n=1}^{m_n}\cdots\sum_{j_1=1}^{m_1}\alpha_{j_1,\ldots,j_n}B_{d_1,j_1}(x_1|{\bf\Lambda}_1)\cdots B_{d_n,j_n}(x_n|{\bf\Lambda_n}) \]

where ${\bf X}\in{\rm R}^n$ is a vector of independent variables ${\bf X} = (x_1,x_2,\ldots,x_n)$. The $\alpha_{j_1,\ldots,j_n}$ 's are the coefficients of the tensor product B-splines

\[ \Phi_{j_1,\ldots,j_n}({\bf X}) = B_{d_1,j_1}(x_1|{\bf\Lambda}_1)\cdots B_{d_n,j_n}(x_n|{\bf\Lambda}_n) \]

where the $B_{d_k,j_k}(x_k|{\bf\Lambda}_k)$ 's are the $m_k$ univariate B-splines of degree $d_k$ defined by the knot vector

\[ {\bf\Lambda}_k = ( \lambda_{k,1}, \cdots, \lambda_{k,d_k+1}, \lambda_{k,d_k+2}, \cdots,\lambda_{k,m_k}, \lambda_{k,m_k+1}, \cdots, \lambda_{k,m_k+d_k+1})^T. \]

This section presents AMA Spline Library functions which can be employed to compute the spline's partial derivative

\[ {\partial^{q} s({\bf X})\over \partial x^{p_1}_1\cdots\partial x^{p_n}_n} \]

where the partial order $q=\sum_{k=1}^np_k$ and $p_k$ is the partial order in $x_k$, for $1\le k\le n$; to compute the spline's indefinite integral

\[ \int\cdots\int s({\bf X}) dx^{p_1}_1\cdots dx^{p_n}_n \]

where $p_k$ is the integral order in $x_k$, for $1\le k\le n$; to compute the spline's value $s({\bf X^o})$ at a point ${\bf X^o}=(x^o_1,\cdots,x^o_n)$; and to compute the value of the spline's partial derivative

\[ {\partial^{q} s({\bf X}_o)\over \partial x^{p_1}_1\cdots\partial x^{p_n}_n} \]

at a point ${\bf X^o}=(x^o_1,\cdots,x^o_n)$. Functions for reading, writing, freeing and insuring the AMA Spline Library AMA_SPLINE structure is properly defined are also provided. Following is a list of the AMA Spline Library functions for working with the AMA_SPLINE structure:

The program exampleAMA_Spline.c provides an example of using these functions. It was used to produced Figure Interpolants, Derivatives and Integrals of Lift Coefficient which contains the interpolant of the $c_{L_\alpha}(M)$ data computed by AMA_UnvInterp() and the monotonic interpolant computed by AMA_UnvMonoInterp(), see Univariate Data Functions. Both interpolants are shown in the left hand panel where the AMA_UnvInterp() interpolant is given in blue and the interpolant computed by AMA_UnvMonoInterp() is given in green, the red squares represent the data. The center panel contains the derivative of the two interpolants computed with AMA_SplinePartial() and the right hand panel contains their indefinite integrals computed with AMA_SplineIntegral().

Interpolants, Derivatives and Integrals of Lift Coefficient
Interpolant of $c_{L_\alpha}(M)$ Derivative of $c_{L_\alpha}(M)$ Integral of $c_{L_\alpha}(M)$