previous up next SYLLABUS  Previous: 1.4.3 Finite elements  Up: 1.4 Numerical discretization  Next: 1.4.5 Harmonic functions


1.4.4 Splines

Starting from an approximation on an inhomogeneous mesh, the idea of splines is to provide a global interpolation that is continuous up to a certain derivative. For example, take a cubic Hermite spline with the 4 parameters $ f_j,f_{j+1},f^{\prime\prime}_j,f^{\prime\prime}_{j+1}$ , which completely determine all 4 coefficients of the cubic polynomial

$\displaystyle f(x)=Af_j + Bf_{j+1} +Cf^{\prime\prime}_j +Df^{\prime\prime}_{j+1}$ (1.4.4#eq.1)

\begin{displaymath}\begin{array}{cclccl} A(x)&=&(x_{j+1}-x)/(x_{j+1}-x_j) \hspac...
...-A)/6 \hspace{1cm} &D(x)&=&(x_{j+1}-x_j)^2(B^3-B)/6 \end{array}\end{displaymath}    

It is straight forward to calculate the first and second derives

$\displaystyle f^\prime(x)= \frac{f_{j+1}-f_j}{x_{j+1}-x_j} -\frac{3A^2-1}{6}(x_{j+1}-x_j)f^{\prime\prime}_j +\frac{3B^2-1}{6}(x_{j+1}-x_j)f^{\prime\prime}_{j+1}$ (1.4.4#eq.2)

$\displaystyle f^{\prime\prime}(x)= Af^{\prime\prime}_j + Bf^{\prime\prime}_{j+1}$ (1.4.4#eq.3)

Starting with only sampled values and no information about the curvature, $ f^{\prime\prime}_i$ are usually calculated so as to guarantee a smooth interpolation. Most common is to require that $ f^\prime(x)$ be continuous from one interval to the next, leading to a tridiagonal system that holds for $ j=2,N-1$

$\displaystyle \frac{x_j -x_{j-1}}{6} f^{\prime\prime}_{j-1} + \frac{x_{j+1}-x_{...
...rime}_{j+1} = \frac{f_{j+1}-f_j}{x_{j+1}-x_j} - \frac{f_j-f_{j-1}}{x_j-x_{j-1}}$ (1.4.4#eq.4)

and can be solved efficiently with $ \mathcal{O}(N)$ operations. Two free parameters at the boundaries are used to impose the boundary conditions by choosing $ f^\prime_1$ and $ f^\prime_N$ (1.4.4#eq.2).
Figure: Approximation of $ \sin(x^2)$ with cubic Hermite splines.
\includegraphics[width=10cm]{figs/AprxSPL.psc}
Figure (1.4.4#fig.1) illustrates the procedure and shows the excellent quality of a cubic approximation until it breaks down at the limit of 2 mesh points per wavelength.

SYLLABUS  Previous: 1.4.3 Finite elements  Up: 1.4 Numerical discretization  Next: 1.4.5 Harmonic functions

      
back up next contents bibliography Copyright © Lifelong-learners at 18:49:06, November 18th, 2017