AN2 Sur 5
AN2 Sur 5
Salem Nafiri
Ecole Hassania des Travaux Publics
Interpolation et Approximation
Interpolation de Lagrange
Joseph Louis Lagrange
(1736-1813)
5
exist
unique
6
8
Example 4.1
e-1/2
9
10
Discussion
• The construction presented in this section is called Lagrange
interpolation.
• How good is interpolation at approximating a function? (Sections 4.3,
4.11)
• Consider another example:
• If we use a fourth-degree interpolating polynomial to approximate this
function, the results are as shown in Figure 4.3 (a).
11
n=4 n=8
n = 16
Error for n=8
12
Discussion
• There are circumstances in which polynomial interpolation as approximation will work very well,
and other circumstances in which it will not.
• The Lagrange form of the interpolating polynomial is not well suited for actual computations, and
there is an alternative construction that is far superior to it.
13
L’erreur d’interpolation
Inconvenient de la formule de Lagrange
17
Exemple
Discussion
• Les coefficients s’appellant differences divisées.
• On peut utiliser le tableau des differences divisées
pour les trouver.
19
Exemple
21
Exemple: (suite)
Table 4.5
23
Interpolation d’Hermite
• Problème d’interpolation d’Hermite
• While data of a particular size presents many options for the order of spline
functions, cubic splines are preferred because they provide the simplest
representation that exhibits the desired appearance of smoothness.
• In general, the ith spline function for a cubic spline can be written as:
s i x ai bi x xi ci x xi di x xi
2 3
• For n data points, there are n-1 intervals and thus 4(n-1) unknowns to evaluate to
solve all the spline function coefficients.
• There is no ‘one equation’ that can represent the whole spline function on the
domain
Why Splines ?
1
f ( x)
1 25 x 2
Table : Six equidistantly spaced points in [-1, 1]
1
x y
1 25 x 2
-1.0 0.038461
-0.6 0.1
-0.2 0.5
0.2 0.5
0.6 0.1
http://numericalmethods.eng.usf.edu 36
Why Splines ?
1.2
0.8
0.4
y
0
-1 -0.5 0 0.5 1
-0.4
-0.8
x
19th Order Polynomial f (x) 5th Order Polynomial
http://numericalmethods.eng.usf.edu 38
Quadratic Interpolation
Given x0 , y0 , x1 , y1 ,......, x n 1 , y n 1 , x n , y n , fit quadratic splines through the data. The splines
are given by
f ( x ) a1 x 2 b1 x c1 , x 0 x x1
a 2 x 2 b2 x c2 , x1 x x 2
.
.
.
a n x 2 bn x cn , x n 1 x x n
Find a i , bi , ci , i 1, 2, …, n
http://numericalmethods.eng.usf.edu 39
Cubic Splines
Cubic Splines
Cubic Splines - Construction
Cubic Splines - Construction
Cubic Splines – Boundary conditions
Natural Splines – Construction
Natural Splines – Construction
Natural Splines – Construction
Natural Splines – Construction
Natural Splines – Construction
Least square method
Ajustement des données par la méthode des
moindres carrées
51
52
53
Example
57
58
Références
1. http://mathworld.wolfram.com/LagrangeInterpolatingPolynomial.html
2. https://pdfs.semanticscholar.org/fc86/7badcf1b36685bb3f33950c6870075adbd70.pdf
3. https://en.wikipedia.org/wiki/Ordinary_least_squares
4. https://en.wikipedia.org/wiki/Linear_regression
5. http://users.rowan.edu/~hassen/NumerAnalysis/Interpolation_and_Approximation.pdf
6. http://www.rajgunesh.com/resources/downloads/numerical/cubicsplineinterpol.pdf
7. http://www.tf.uns.ac.rs/~omorr/radovan_omorjan_003_prII/s_examples/Scilab/Gilberto/scilab08.pdf
8. http://www.maths.lth.se/na/courses/FMN081/FMN081-06/lecture11.pdf