Académique Documents
Professionnel Documents
Culture Documents
: interpolation polynomiale
Interpolation polynômiale
Problème :
On cherche f sous forme d’un polynôme passant par les n points, donc de
degré n
Interpolation de Lagrange :
Théorème
Pn ( x i) =f ( x i ) ∀ i=0 … … … … .. n
Le polynôme s’écrit
n n
( x−x k )
Pn ( x ) =∑ f ( x i ) Li ( x ) avec Li ( x )=∏
i=0 k ≠i ( x i−x k )
M n+1
e ( x )=|f ( x )−P(x )|≤ |π ( x )|
( n+1 ) ! n
Où
1
Chapitre IV : interpolation polynomiale
n
M n+1 ( x )=Max x |f n +1 ( x)|
0 ≤ x≤ x n
et π n ( x ) =∏ ( x−x i)
i=0
x 2 2.5 4
f (x) 0.5 0.4 0.25
1
Sachant que la fonction f ( x )= x :
Solution :
(x−x 1)(x−x 2)
L0 ( x ) = =x 2−6.5 x +10
( x 0−x 1)(x 0−x 2)
( x−x 0 )(x−x 2) −4
L1 ( x ) = = ( x ¿¿ 2−6 x +8)¿
( x1−x 0 )(x 1−x 2) 3
( x −x0 )(x−x 1) 1 2
L2 ( x ) = = ( x −4.5 x+5)
( x2 −x0 )(x 2−x 1) 3
P2 ( x ) =f ( x 0 ) L0 ( x ) +f ( x 1 ) L1 ( x )+ f ( x 2 ) L2 ( x )
P2 (3 )=0.325
L’erreur a x=3:
−6 6
f 3 ( x )= , max |f 3 ( x )|= =0.375
x4 24
Programme Matlab ;
2
Chapitre IV : interpolation polynomiale
f [ x 1 ]−f [ x0 ] f ( x1 ) −f ( x0 )
f [ x 0 , x 1 ]= =
x 1−x 0 x 1−x 0
f [ x 2 ] −f [ x1 ]
f [ x 1 , x 2 ]=
x 2−x 1
……..
3
Chapitre IV : interpolation polynomiale
f [ x n ] −f [ x n−1]
f [ x n−1 , x n ] =
x n −xn −1
f [ x 1 , x 2 ]−f [ x 0 , x 1 ]
f [ x 0 , x 1 , x 2 ]=
x 2−x 0
f [ x 2 , x 3 ]−f [ x 1 , x 2]
f [ x 1 , x 2 , x 3 ]=
x 3−x 1
f [ x 3 , x 4 ] −f [ x 2 , x 3 ]
f [ x 2 , x 3 , x 4 ]=
x 4 −x2
……….
f [ x 1 , x 2 , x 3 ]−f [ x 0 , x 1 , x 2 ]
f [ x 0 , x 1 , x 2 , x3 ] =
x3 −x 0
f [ x 2 , x 3 , x 4 ] −f [ x 1 , x 2 , x 3 ]
f [ x 1 , x 2 , x 3 , x 4 ]=
x 4 −x 1
f [ x 3 , x 4 , x5 ]−f [x 2 , x 3 , x 4 ]
f [ x 2 , x 3 , x 4 , x 5 ]=
x 5−x 2
f [ x 1 , x 2 ,… … …. , x n ]−f [x 0 , x1 , x2 , … … … . , x n−1 ]
f [ x 0 , x 1 , x 2 , … … … . , x n ]=
x n−x 0
4
Chapitre IV : interpolation polynomiale
x f (x)
x0 f [x 0 ]
f [x 0 , x1 ]
x1 f [x 1 ] f [x 0 , x1 , x2 ]
f [x 1 , x 2 ] f [x 0 , x1 , x2 , x 3]
x2 f [x 2 ] f [x 1 , x 2 , x3 ] f [x 0 , x1 , x2 , x 3 , x 4 ]
f [x 2 , x3 ] f [x 1 , x 2 , x3 , x 4 ] f [x 0 , x1 , x2 , x 3 , x 4 , x 5 ]
x3 f [x 3 ] f [x 2 , x3 , x 4 ] f [x 1 , x 2 , x3 , x 4 , x 5 ]
f [x 3 , x 4 ] f [x 2 , x3 , x 4 , x 5 ]
x4 f [x 4 ] f [x 3 , x 4 , x 5 ]
f [x 4 , x 5 ]
x5 f [x 5 ]
Exemple : Ecrire le tableau des différences divisées de la fonction y=f (x )
définir par le tableau suivant :
x 0 1 2 4
f (x) 1 1 2 5
Solution :
x f (x)
0 1
0
1 1 1
2
1 −1
12
2 2 1
6
3
2
4 5
Interpolant de Newton :
Pn ( x 0 )=f [ x 0 ] =f (x 0 )
5
Chapitre IV : interpolation polynomiale
f [ x 1 ] −f [ x 0 ]
Pn ( x 1) =f [ x 0 ] +f [ x 0 , x 1 ] ( x−x 0 )=f [ x 0 ] + ( x 1−x 0 )=f [ x 1]
x 1−x 0
f [ x 1 ] −f [ x 0 ] f [ x 1 , x 2 ]−f [ x 0 , x 1 ]
Pn ( x 2) =f [ x 0 ] + f [ x 0 , x 1 ] ( x2 −x0 ) + f [ x 0 , x 1 , x 2 ] ( x 2−x 0 ) ( x 2−x 1 )=f [ x 0 ] + ( x 2−x 0 ) +
x 1−x 0 x 2−x 0
Et ainsi de suite :
Pn ( x n )=f [ xn ]
x 0 2 3 5 6
f (x) 1 3 2 5 6
Solution :
x f ( x )= y
0 1
1
2 3 −2
3
−1 0.3
3 2 5 −0.55
6 6
3 −0.25
2
5 5 −1
6
1
6 6
6
Chapitre IV : interpolation polynomiale
Programme Matlab
%méthode des différences divisées
clear all ; clc
x=[0 2 3 5 6];
y=[1 3 2 5 6];
x0=1;
n = size(x،1);
if n == 1
n = size(x،2);
end
%le première colonne du tableau
for i = 1:n
F(i،1) = y(i);
end
%les autres colonnes du tableau
for i = 2:n
for j = 2:i
F(i،j)=(F(i،j-1)-F(i-1 ، j-1))/(x(i)-x(i-j+1));
end
end
%la valeur approchée de y a x0
7
Chapitre IV : interpolation polynomiale
fx0 = F(n،n);
for i = n-1:-1:1
fx0 = fx0*(x0-x(i)) + F(i،i);
end
x0
disp(‘la valeur approchée de y a x0’)
fx0
disp(‘Tableau des différences divisées’)
Si la différence entre deux points d’appuis successifs est constante tel
que :
f [ x 1 ]−f [ x0 ] f ( x1 ) −f ( x0 ) y1 − y 0 1
f [ x 0 , x 1 ]= = = = ∆ y0
x 1−x 0 x 1−x 0 h 1!h
y 2 − y 1 y 1− y 0
−
f [ x 1 , x 2 ]−f [ x 0 , x 1 ] x 2−x 1 x 1−x 0 1 1
f [ x 0 , x 1 , x 2 ]= = = y −2 y 1 + y 2 )=
2( 0
∆2 y 0
x 2−x 0 2h 2!h 2 ! h2
……….
1
f [ x 0 , x 1 , x 2 , … … … . , x n ]= n
∆n y 0
n!h
0α α (α −1) 2 α ( α −1 ) … … (α −n+1) n
Pn ( x ) = y 0 + ∆ y0 + ∆ y 0 +… … …+ ∆ y0
1!h 2!h
2
n !h
n
x−x 0
Avec α =
h
L’erreur :
8
Chapitre IV : interpolation polynomiale
x 0 0.2 0.3
f (x) 0 0.20134 0.30452
Solution :
x y=f (x )
0 0
1.0067
0.2 0.20134 0.08367
1.0318
0.3 0.30452
P2 (x)=0.08367 x2 +0.98997 x
L’erreur :
ε ( 23 ) =−0.0000404