0% found this document useful (0 votes)
13 views58 pages

AN2 Sur 5

Uploaded by

safia ouyoub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views58 pages

AN2 Sur 5

Uploaded by

safia ouyoub
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Analyse Numérique 1

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

Si on décide d’ajouter un point à l’ensemble des points, on


doit recalculer toutes les fonctions de base

Existe il une autre alternative ?


C’est l’interpolation de Newton. Il permet d’avoir une
relation de recurrence entre et
Interpolation de Newton et différences
divisées
=0

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

• Est ce possible ? oui.


Tableau des diff. divisées
Exemple
Erreur
Thm. d’erreur d’interpolation d’Hermite
Cubic Spline
Introduction to Splines
• An alternative approach to using a single (n-1)th order polynomial to
interpolate between n points is to apply lower-order polynomials in a
piecewise fashion to subsets of data points.
• These connecting polynomials are called spline functions.
• Splines minimize oscillations and reduce round-off error due to their
lower-order nature.
Higher Order vs. Splines
• Splines eliminate oscillations by using small subsets of points
for each interval rather than every point. This is especially
useful when there are jumps in the data:
a) 3rd order polynomial
b) 5th order polynomial
c) 7th order polynomial
d) Linear spline
• seven 1st order polynomials generated by using pairs of
points at a time
Spline Development
a) First-order splines find straight-line equations
between each pair of points that
• Go through the points
b) Second-order splines find quadratic equations
between each pair of points that
• Go through the points
• Match first derivatives at the interior points
c) Third-order splines find cubic equations between
each pair of points that
• Go through the points
• Match first and second derivatives at the interior
points

Note that the results of cubic spline interpolation


are different from the results of an interpolating
cubic.
Spline Development
• Spline function (si(x))coefficients are calculated for each interval of a
data set.
• The number of data points (fi) used for each spline function depends
on the order of the spline function.
Cubic Splines

• 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

1.0 0.038461 Figure : 5th order polynomial vs. exact function

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

Figure : Higher order polynomial interpolation is a bad idea


http://numericalmethods.eng.usf.edu 37
Linear Interpolation
Given  x0 , y0 , x1 , y1 ,......, x n 1 , y n 1  x n , y n  , fit linear splines to the data. This simply involves
forming the consecutive data through straight lines. So if the above data is given in an ascending
order, the linear splines are given by  yi  f ( xi ) 
Figure : Linear splines

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy