Académique Documents
Professionnel Documents
Culture Documents
Pr. A. RADID
Université Hassan II
ENSEM
Département de Génie électrique
Introduction 1
1 Interpolation polynomiale 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 Exemple et motivation . . . . . . . . . . . . . . . . . . . . . 3
1.2 Méthode directe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Intepolation dans l’espace de référence . . . . . . . . . . . . 6
1.3 Méthode de Lagrange . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3.1 Pincipe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3.2 Estimation de l’erreur . . . . . . . . . . . . . . . . . . . . . 8
1.3.3 Majoration de l’erreur . . . . . . . . . . . . . . . . . . . . . 9
1.4 Méthode des di¤érences divisées (de Newton) . . . . . . . . . . . . 10
1.4.1 Organisation du calcul des di¤érences divisées de Newton . . 12
1.5 Approximation au sens des moindres carrés . . . . . . . . . . . . . . 15
1.5.1 Droite des moindres carrés, ou régression linéaire : . . . . . . 16
1.5.2 Interpolation linéaire et non linéaire . . . . . . . . . . . . . . 20
1.6 Interpolation polynomiale par morceaux . . . . . . . . . . . . . . . 23
1.7 Interpolation par des splines cubiques . . . . . . . . . . . . . . . . . 24
1.8 Interpolation avec Matlab . . . . . . . . . . . . . . . . . . . . . . . 25
2
Chapitre 1
Interpolation polynomiale
1.1 Introduction
Exemple 1.1 Un pays fait un recensement de sa population tous les dix ans par
exemple :
Année ti 1970 1980 1990 2000 2010 2020
Population pi 1000 123230 131669 150697 179323 203212 226505
3
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
5 graphe de la population
10
2.4
2.2
2
P
1.8
1.6
1.4
1.2
1970 1980 1990 2000 2010 2020
t
f (ti ) = pi pour i = 1; : : : ; n:
4
La matrice de Q
ce système linéaire est appelé matrice de VANDERMONDE, de
déterminant (xi xj ) 6= 0; car les points xi sont distincts.
0 i<j n
La résolution de ce système conduit bien sûr à l’unique polynôme d’interpolation
de f . Cependant, la résolution numérique n’est pas une tâche triviale.
>> cond(A)
ans =
97.0374
5
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
Exemple 1.3 On considère 3 couples de points (xi ,fi ) à interpoler par un polynôme
de degré 2 :
xi fi
1010 0
; i = 0; 1; 2
1030 -1
1050 2
p2 (x) = a0 + a1 x + a2 x2
On détermine les coe¢ cients a2 ; a1 et a0 ; en résolvant le système suivant :
2 32 3 2 3 2 3
1 1010 10102 a0 f0 0
4 1 1030 10302 5 4 a1 5 = 4 f1 5 = 4 1 5
1 1050 10502 a2 f2 2
2 3 2 3 1 2 3 2 32 3
a0 1 1010 10102 0 1351:875 2651:25 1300:375 0
4 a1 5 = 4 1 1030 10302 5 4 1 5=4 2:6 5:15 2:55 5 4 1 5
a2 1 1050 10502 2 0:00125 0:0025 0:00125 2
x; xi X,Xi
1010 -1
1030 0
1050 1
D’où le nouveau tableau des points à interpoler :
Xi fi
-1 0
0 -1
1 2
6
La même démarche que pour l’espace réel, conduit à :
2 32 3 2 3 2 3
1 1 ( 1)2 a0 f0 0
4 1 0 02 5 4 a1 5 = 4 f1 5 = 4 1 5
1 1 12 a2 f2 2
P2 (x) = 1 + X + 2X 2
(x 1030)
or X = donc P2 (x) = 5:10 3 x2 1025:10 2 x + 5252
20
X
n
Pn (x) = f (xi ) Li (x)
i=0
où
Y (x xk ) (x x0 ) : : : (x xi 1 ) (x xi+1 ) : : : (x xn )
Li (x) = =
k=0;k6=i
xi xk (xi x0 ) : : : (xi xi 1 ) (xi xi+1 ) : : : (xi xn )
1 si i=j
Li (xj ) = ij =
0 sinon.
7
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
Corollaire 1.1 Soit f 2 C n+1 ([a; b]) : Si f possède au moins n+2 zéros distincts
sur [a; b]; alors f (n+1) a au moins un zéro sur [a,b].
n (x) (n+1)
8x 2 [a; b] ; 9 x 2 [a; b] ; En (x) = f (x) Pn (x) = f ( x) :
(n + 1)!
Q
n
avec n (x) = (x xi ) :
i=0
(n + 1)!
W (n+1) (t) = f (n+1) (t) (f (x) Pn (x))
q(x)
8
donc
(n + 1)!
0 = W (n+1) ( ) = f (n+1) ( ) (f (x) Pn (x))
q(x)
On en déduit la relation.
Mn+1 Mn+1
jEn (x)j = jf (x) Pn (x)j j n (x)j sup j n (y)j
(n + 1)! (n + 1)! y2[a;b]
Cette inégalité permet donc de majorer l’erreur commise en remplaçant f par son
polynôme d’interpolation.
3. Lorsque la fonction f tend vers une fonction polynomiale, l’erreur tend vers
0.
i 0 1 2 3 4
xi 0 2 3 5 6
yi 1 3 2 5 6
9
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
donc
x4 16x3 +91x2 216x+180 x4 14x3 +63x2 90x x4 13x3 +52x2 60x
P (x) = 180 8
+ 9
x4 11x3 +36x2 36x x4 10x3 +31x2 30x
6
+ 12
11 4 73 3 601 2 413
= 120
x + 60
x 120
x + 60
x+1
Exercice 1.1 L’espérance de vie dans un pays a évoluée dans le temps selon le
tableau suivant :
Année 1975 1980 1985 1990
Espérance 7218 7412 7512 7614
Utiliser l’interpolation de Lagrange pour estimer l’espérance de vie en 1977,
1983 et 1988.
10
Lemme 1.1 Soient fx0 ; x1 ; : : : ; xn g un ensemble de n + 1 réels tous distincts (n
2) de l’ensemble de dé…nition d’une fonction f alors
(x x0 ) Pfx1 ;x2 ;:::;xn g (x) (x xn ) Pfx0 ;x1 ;:::;xn 1g (x)
Pfx0 ;x1 ;:::;xn g (x) =
xn x0
(x x0 )Pfx1 ;x2 ;:::;xn g (x) (x xn )Pfx (x)
0 ;x1 ;:::;xn 1 g
Démonstration 1.2 Posons Q(x) = xn x0
Q est un polynôme de degré n:
Pour x = x0 , on a :
(x0 x0 ) Pfx1 ;x2 ;:::;xn g (x0 ) (x0 xn ) Pfx0 ;x1 ;:::;xn 1g (x0 )
Q(x) =
xn x0
= Pfx0 ;x1 ;:::;xn 1 g (x0 ) = f (x0 )
Pour x = xn , on a :
(xn x0 ) Pfx1 ;x2 ;:::;xn g (xn ) (xn xn ) Pfx0 ;x1 ;:::;xn 1g (xn )
Q(x) =
xn x0
= Pfx1 ;x2 ;:::;xn g (xn ) = f (xn )
Pour 1 i n 1; on a
(xi
x0 ) Pfx1 ;x2 ;:::;xn g (xi ) (xi xn ) Pfx0 ;x1 ;:::;xn 1 g (xi )
Q(xi ) =
xn x0
(xi x0 ) f (xi ) (xi xn ) f (xi )
=
xn x0
xn x0
= f (xi ) = f (xi )
xn x0
Q prend donc les mêmes valeurs que f aux points x0 ; x1 ; : : : ; xn ; et a un degré
n : c’est donc le polynôme d’interpolation de f en ces points (unicité du polynôme
d’interpolation de Lagrange).
On a bien Q(x) = Pfx0 ;x1 ;:::;xn g pour tout x.
Dé…nition 1.1 (Notation) On note f [x0 ; x1 ; : : : ; xn ] le coe¢ cient de xn dans
Pfx0 ;x1 ;:::;xn g (x): C’est le coe¢ cient dominant du polynôme d’interpolation de f aux
points x0 ; x1 ; : : : ; xn sous réserve que ce polynôme soit e¤ectivement de degré n ;
s’il est de degré < n, on a f [x0 ; x1 ; : : : ; xn ] = 0:
Proposition 1.1 (Formule de Newton) Avec les notations que l’on a introduites,
on a :
Pn (x) = f [x0 ] +f [x0 ; x1 ] (x x0 ) +f [x0 ; x1 ; x2 ] (x x0 ) (x x1 ) + : : :
+f [x0 ; x1 ; : : : ; xn ] (x x0 ) (x x1 ) : : : (x xn 1 )
X
= f (x0 )+ f [x0 ; x1 ; : : : ; xk ] (x x0 ) (x x1 ) : : : (x xk 1 )
1 k n
11
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
12
On retrouve sur la diagonale les coe¢ cients de la formule de Newton.
f [xi ] = f (xi )
f (xj ) f (xi )
f [xi ; xj ] =
xj xi
f [xj ; xk ] f [xi ; xj ]
f [xi ; xj ; xk ] =
xk xi
f [xj ; xk ; xl ] f [xi ; xj ; xk ]
f [xi ; xj ; xk ; xl ] =
xl xi
etc
Remarques 1.1 Nous avons (n+1)(n+2)
2
coe¢ cients à calculer pour obtenir
les n + 1 coe¢ cients de la formule (f [x0 ] ; f [x0 ; x1 ] ; . . . ;f [x0 ; x1 ; : : : ; xn ]).
On peut songer a utiliser un tableau bi-dimensionel (n+1)(n+2) pour stocker
ces coe¢ cients
Avec cet algorithme, il est très facile d’ajouter un point x 1 et d’obtenir les
coe¢ cients du polynôme Pn+1 sans être obligé de refaire tous les calculs :
x 1 f [x 1 ]
f [x 1 ; x0 ]
x0 f [x0 ] f [x 1 ; x0 ; x1 ]
f [x0 ; x1 ] f [x 1 ; x0 ; x1 ; x2 ]
x1 f [x1 ] f [x0 ; x1 ; x2 ]
f [x1 ; x2 ] f [x0 ; x1 ; x2 ; x3 ]
x2 f [x2 ] f [x1 ; x2 ; x3 ]
f [x2 ; x3 ] f [1 ; x 2 ; x 3 ; x 4 ]
x3 f [x3 ] f [x2 ; x3 ; x4 ]
Exemple 1.5 A partir des valeurs suivantes:
x 2 4 6 8
y 4 8 14 16
Déterminons les valeurs utiles des di¤érences divisées f [xi ; : : : ; xj ]
xi f [xi ] f [xi 1 ; xi ] f [xi 2 ; xi 1 ; xi ] f [xi 3 ; xi 2 ; xi 1 ; xi ]
2 4
8 4
4 2
=2
3 2
4 8 6 2
= 14
1 1
14 8 1
6 4
=3 2
8 2
4
= 8
1 3 1
6 14 8 4
= 2
16 14
8 6
=1
8 16
13
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
On a donc
1 1
p3 (x) = 4 + 2 (x 2) + (x 2) (x 4) (x 2) (x 4) (x 6)
4 8
Lemme 1.2 Soit f (x) n-fois di¤erentiable et yi = f (xi ) pour i = 0; 1; :::; n (xi
distincts). Alors, il existe un 2 (min xi ; max xi ) tel que :
f (n) ( )
f [x0 ; x1 ; : : : ; xn 1 ; xn ] =
n!
Démonstration 1.5 Soit pn (x) le polynôme d’interpolation de degré n passant
par (xi ; yi ) et notons d(x) = f (x) pn (x): Par dé…nition de pn (x), la di¤érence
d(x) s’annule en n + 1 points distincts :
d (xi ) = 0 pour i = 0; 1; : : : ; n:
f (n) ( ) = p(n)
n ( ) = n!f [x0 ; x1 ; : : : ; xn 1 ; xn ] : (1.2)
14
xi f [xi ] f [xi 1 ; xi ] f [xi 2 ; xi 1 ; xi ] f [xi 3 ; xi 2 ; xi 1 ; xi ]
1 1
1
+1 9
2
1
+1
= 4
3
9
1 1 0 27
3 2 1
4
= 16
2. 3
+1
0 0
9
1 1 0 27
3 2
4
1+ 13
= 16
9
4
1 1
P (x) = 1 + 94 (x + 1) 27
16
(x + 1) x + 1
3
= 11
16
27 2
16
x:
sup f (4) ( x )
1 x 1 1
jf (x) P (x)j x2 1 x2
4! 9
4
1
jf (x) P (x)j x2 1 x2 ; 8x 2 [ 1; 1] :
4! 9
4
4. jf (0) P (0)j 4! 9
= 0:45097:
11
ou encore f (0) P (0) = 1 16
= 0:3125
15
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
d0 = f0 pn (x0 )
..
.
dm = fm pn (xm )
On peut alors, intuitivement, dire que si tous les di ! 0; (i = 0; : : : ; m) alors
pn est une bonne approximation.
Le critère des moindres carrés est donc d’imposer :
X1
m
d2 = (fi pn (xi ))2 à minimiser
i=0
Ti ( C) Ri (ohms)
20:5 765
32:7 826
51:0 873
73:2 942
95:7 1032
Lissage par moindres carrés (régression linéaire)
Quelle est la meilleure droite ? (observation ou théorie)
16
R = aT + b
But :Trouver un polynôme de degré faible passant par beaucoup de points.
Déterminer Pn (x) avec n m 1qui minimise l’écart quadratique :
P1
m
R= d2i avec di = yi Pn (xi )
i=0
P1
m P1
m
(di )2 = (yi axi b)2 = R (a; b)
i=1 i=1
P1
m P1
m P1
m
a x2i + b xi = yi xi
i=0 i=1 i=0
mP1 P1
m
a xi + mb = yi
i=0 i=1
P1
m P1
m
yi xi xi
i=0 i=1
P1
m P1
m P1
m P1
m
yi m m yi x i xi yi
i=1 i=0 i=1 i=1
a= 2 = 2
P1
m P1
m P1
m P1
m
m x2i xi m x2i xi
i=0 i=1 i=0 i=1
P1
m P1
m
x2i yi xi
i=0 i=0
P1
m P1
m P1
m P1
m P1
m P1
m
xi yi x2i yi yi xi xi
i=0 i=1 i=0 i=1 i=0 i=0
b= 2 = 2
P1
m P1
m P1
m P1
m
m x2i xi m x2i xi
i=0 i=1 i=0 i=1
ou encore
17
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
1050
1000
950
R(Ohms)
900
850
800
750
20 30 40 50 60 70 80 90 100
T(°C)
Ti ( C) Ri (ohms) Ti2 Ti Ri
20:5 765 420; 25 15682; 5
32:7 826 1069; 29 27010; 2
51:0 873 2601 44523
73:2 942 5358; 24 68954; 4
95:7 1032 9158; 49 98762; 4
T otal 273; 1 4438 18607; 27 254932; 5
Pn (x) = a0 + a1 x + : : : + an xn
Soit di = yi Pn (xi )
18
P
m P
m
d= d2i = (yi Pn (xi ))2
i=1 i=1
Minimum pour :
@e mP1
=2 (yi Pn (xi )) xji = 0; 8j; 0 j n
@aj i=0
P1
m
(yi a0 a1 x i : : :) xji = 0; j = 0; : : : ; n
i=0
P1
m P
ce qui donne, en remplaçant : par
i=0
8 P P n P
>
> ma
P 0 + a 1 x
P 2 i + : : : + a n Pxi n+1 = P yi
<
a0 xi + a1 xi + : : : + an xi = xi yi
>
> P P P P
:
a0 xni + a1 xn+1
i + : : : + an x2n
i = xni yi
La matrice des coe¢ cients du système est symétrique. Elle peut être obtenue
par H t H
2 3
1 x1 xn1
6 1 x2 xn2 7
H=6 4
7
5
n
1 xm xm
x 0 1 2 3 4 5 6
y 2 3 5 5 9 8 10
19
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
Corrigé de l’exercice 1.3 Le système linéaire à résoudre pour trouver les co-
e¢ ents du polynôme p(x) = a0 + a1 x est le suivant :
0 m 1 1 0 m 1 1
P P1
m P
B 1 xi C B yi C
B i=0 i=0 C a0 B i=0 C
@ mP1 P1 2 A
m = @ mP1 A
a1
xi xi xi yi
i=0 i=0 i=0
ou encore 0 1 0 1
P
6 P
6
B 7 xi C
a0 B yi C
B i=0 C =B i=0 C
@ P
6 P6
2
A a1 @ P
6 A
xi xi xi yi
i=0 i=0 i=0
,
P
6 P
6 P
6
yi xi 7 yi
i=0 i=0 i=0
P
6 P6 P
6 P
6
xi yi x2i xi xi yi
i=0 i=0 i=0 i=0
a0 = et a1 =
P
6 P6
7 xi 7 xi
i=0 i=0
P
6 P6 P
6 P6
xi x2i xi x2i
i=0 i=0 i=0 i=0
On obtient donc
P
6 P
6 P
6 P
6 P
6 P
6 P
6
yi x2i xi yi xi 7 xi yi xi yi
i=0 i=0 i=0 i=0 i=0 i=0 i=0
a0 = 2 et a1 = 2
P
6 P
6 P
6 P
6
7 x2i xi 7 x2i xi
i=0 i=0 i=0 i=0
20
1. ln(y) = ln(a) + b ln(x)
Modi…cations qui conduisent à la méthode linéaire :
z = A + bw
2. ln(y) = ln(a) + bx
Modi…cations qui conduisent à la méthode linéaire :
z = A + bx
ln y = ln a + bx
x 1.0 2.0 4.0
ln(y) 0.693 1.974 6.215
On obtient :
x z=ln(y) x2 xln(y)
1 0.693 1 0.693
2 1.974 4 3.948
4 6.215 16 24.859
alors P 2 P P
P xi xi b
= Pxi zi
xi m A zi
21 7 b 29:5 b = 1:88
= =)
7 3 A 8:882 a = e 1:427 = 0:24
z = 0:24 + 1:88 ln x
2. D = f(1; 0); (0; 3); (1; 4); (3; 2), polynôme de degré 2.
21
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
ou encore 0 1 0 1
P
2 P
2
B 3 xi C
a0 B i=0yi C
B i=0 C =B C
@ P
2 P2
2
A a1 @ P
2 A
xi xi xi yi
i=0 i=0 i=0
ou encore
3 5 a0 7
=
5 13 a1 17
ce qui équivalent à :
3
3a0 + 5a1 = 7 a0 = 7
=) 8
5a0 + 13a1 = 17 a1 = 7
xi 1 0 1 3
yi 0 3 4 2
Le système linéaire à résoudre pour trouver les coe¢ cients est le suivant :
0 1 2 3
P
3 P
3 P
3 P
3
B i=01 i=0xi x2i
C 0 1 6 i=0yi 7
B i=0 C a 6 7
B P3 P3 P3 C 0 6 P3 7
B x x2i 3 C @
x i C : a1 A =6 xi yi 7
B i 6 7
B i=0 i=0 i=0 C a2 6 i=0 7
@ P3
2
P3 P1 4 A
m 4 P3 5
xi x3i xi x2i yi
i=0 i=0 i=0 i=0
22
0 1 0 1 2 3
4 3 11 a0 9
@ 3 11 27 A : @ a1 A = 4 10 5
11 27 83 a2 22
4 = 440:
On obtient:
157 223 17
a0 = ; a1 = ; a2 =
55 110 22
3. f(0; 1); (1; 2); (2; 3)g ; polynôme de degré 1.
xi 0 1 2
yi 1 2 3
3 3 a0 6
=
3 5 a1 8
ou encore
3a0 + 3a1 = 6 a0 = 1
=)
3a0 + 5a1 = 8 a1 = 1
Le résultat est donc :
P1 (x) = 1 + x
23
Pr. A. Radid CHAPITRE 1. INTERPOLATION POLYNOMIALE
1. (a) ' (x) = 'i (x) si x 2 [xi ; xi+1 ] : 'i est une fonction a¢ ne sur [xi ; xi+1 ] ; i =
0; 1; : : : ; n 1:
(b) ' (xi ) = fi (x); i = 0; 1; : : : ; n; i.e. ' interpole la fonction f:
On a :
x xi+1 x xi
'i (x) = f (xi ) + f (xi+1 )
xi xi+1 xi+1 xi
xi x xi+1 ; i = 0; : : : ; n 1
8
>
> '0 (x); x0 x x1
>
< '1 (x); x1 x x2
'(x) = ..
>
> .
>
: ' (x); x
n 1 n 1 x xn
a. s (x) = si (x) si [xi ; xi+1 ] :si est une fonction polynomiale de degré 3 sur
[xi ; xi+1 ] ; i = 0; 1; : : : ; n 1:
b. s(xi ) = f (xi ); i = 0; 1; : : : ; n; i:e: s interpole la fonction f:
Soit
si (x) = ai x3 + bi x2 + ci x + di ; i = 0; : : : ; n 1
On a alors 4n inconnues à déterminer :
a0 ; : : : ; d0 ; a1 ; : : : ; d1 ; an 1 ; : : : ; dn 1
Il faut satisfaire les conditions suivantes :
24
hi = xi+1 xi ; 0 i n 1
ui = 2 (xi 1 + hi ) ; 0 i n 1
1
bi = hi
(f (xi+1 ) f (xi )) :
1
i = hi
(bi bi 1 )
yi = f (xi )
25