Sunteți pe pagina 1din 11

1

g(x
i
) = f(x
i
) i = 0,...,n.
- Approximation par collocation :
Problme : dterminer une autre fonction de forme donne, qui approche
le mieux possible la fonction f .
Position du problme
f : fonction dfinie gnralement de faon discrte
- Moindre carrs ( voir plus loin)
g(x
i
) = f(x
i
) i = 0,...,n.
g'(x
i
) = f'(x
i
) i = 0,...,n.
.
.
g
(p)
(x
i
) = f
(p)
(x
i
) i = 0,...,n.
- Courbes osculatoires :
APPROXIMATION ET INTERPOLATION
2
1. Approximation polynomiale :
On veut approcher l'ensemble discret dune fonction discrte f dont les points
sont reprsents par (x
i
, y
i
) par une fonction g ayant la forme d'un polynme de
degr n :
g(x)=P
n
(x) = a
0
+ a
1
x + a
2
x
2
+...+ a
n-1
x
n-1
+ a
n
x
n
Approximation par collocation simple :
En galant l'expression de P
n
en tout point (x
i
,y
i
), nous obtenons le systme
suivant, permettant la dtermination des coefficients du polynme
d'interpolation.
y
i
= P
n
(x
i
) = a
0
+ a
1
x
i
+ a
2
x
i
2
+...+ a
n-1
x
i
n-1
+ a
n
x
i
n
i = 0,n
3
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(

n
1
0
n
1
0
n
n
1 n
n
2
n n
n
1
1 n
1
2
1 1
n
0
1 n
0
2
0 0
y
y
y
a
a
a
x x x x 1
.
.
.
x x x x 1
x x x x 1
Limitations :
Apparition doscillations dans certains cas, lorsquon augmente le degr du
polynme dinterpolation.
4
2. Mthode de Newton :
Base sur la notion de diffrences divises :


Diffrence divise d'ordre 1 d'une fonction f relativement deux
abscisses distinctes et :


=

) ( f ) ( f
f
1
,
Pente de la corde
f
1
,
Drive premire du polynme d'interpolation de degr 1
5
Si f est continue et drivable sur l'intervalle [ , ], il existe de cet intervalle tel que
f ) ( ' f
1
,
=
Pour n+1 abscisses distinctes : x
i
i = 0,,n
0 1
0 1 1
x , x
x x
) x ( f ) x ( f
f
1 0

=
1 2
1 2 1
x , x
x x
) x ( f ) x ( f
f
2 1

=
n 1 n
n 1 n 1
x , x
x x
) x ( f ) x ( f
f
n 1 n

.
.
.
6
On forme ensuite les diffrences divises d'ordre 2 :
0 2
1
x x
1
x x
2
x x x
x x
f f
f
1 0 2 1
2 1 0


=
1 3
1
x x
1
x x
2
x x x
x x
f f
f
2 1 3 2
3 2 1


=
2 n n
1
x x
1
x x
2
x x x
x x
f f
f
1 n 2 n n 1 n
n 1 n 2 n


=


.
.
.
7
On montre que l'on a l'identit suivante :
) )...( )( (
) (
...
) )...( )( (
) (

) )...( )( (
) (

1 2 1
1 2 1 0 1
1
0 2 0 1 0
0
...
0


+ +

+

=
n n n n
n
n n
n
x x
x x x x x x
x f
x x x x x x
x f
x x x x x x
x f
f
n

ou encore :

=
=
=
=

=
n j
0 j
n i
j i , 0 i
i j
j n
x ... x
) x x (
) x ( f
f
n 0
A titre d'exercice : tablir cette dernire formule pour n = 2 et n = 3.
8
Si f admet une drive nime continue, alors il existe x de [a,b] :
le plus petit intervalle contenant les x
i
tel que :
! n
) ( f
f
n
n
x ... x
n 0

=
Si f est un polynme P de degr n-1 :
0 P
n
x ... x
n 0
=
Formule de Newton :
Ordre 0 : Diffrence divise d'ordre 1 base sur x0 et x :
0
0 1
x , x
x x
) x ( f ) x ( f
f
0

=
9
f ) x x ( ) x ( f ) x ( f
1
x x 0 0
0
+ =
: formule de Newton d'ordre 0
Polynme d'ordre 0
Diffrence divise d'ordre 2 base sur x
0
, x
1
et x :
) )( (
) (
) )( (
) (
) )( (
) (
0 1 1
1
1 0 0
0
1 0
2
, ,
1 0
x x x x
x f
x x x x
x f
x x x x
x f
f
x x x

+

+

=
soit :
) (
) ( ) (
) (
) ( ) (
) ( ) )( (
0 1
1 1
1 0
0 1 2
, ,
1 0
1 0
x x
x f x x
x x
x f x x
x f f x x x x
x x x

=
|
|

\
|

=
) (
) ( ) (
) ( ) ( ) ( ) )( (
0 1
0 1
0 0
2
, ,
1 0
1 0
x x
x f x f
x x x f x f f x x x x
x x x

f
x x
1
1 0

10
On en tire :
2
, ,
1 0
1
0 0
1 0 1 0
) )( ( ) ( ) ( ) (
x x x x x
x x x x f x x x f x f + + =
f est alors un polynme de degr 1 et un reste qui s'annule si f est un
polynme de degr 1
La fonction peut donc tre approche par le polynme de degr 1 :
f x x x f x P
x x
1
0 0 1
1 0
) ( ) ( ) ( + =
A l'ordre n :
Polynme d'interpolation :
f x x x x x x
f x x x x f x x x f x P
n
x x n
x x x x x n
n
1
... 1 0
2
1 0
1
0 0
0
1 0 1 0
) )....( )( ( .... .......... .......... .......... ..........
) )( ( ) ( ) ( ) (
+
+ +
+ + =
11
Mthode de Lagrange
Polynme d'interpolation Pn(x) calcul sous la forme d'une
combinaison linaire des polynmes de Lagrange.

=
=
n
0 i
i i n
) x ( L y ) x ( P
avec

=
n
i j
0 j
j i
n
i j
0 j
j
i
) x x (
) x x (
) x ( L
(polynmes de Lagrange)
12
Interpolation spline
Principe.
La fonction interpolante S(x) est constitue de morceaux de
polynmes de degr r qui se raccordent, ainsi que leurs drives
jusq' l'ordre r-1, aux points d'interpolation.
Splines usuelles : r = 3 Splines cubiques
La fonction d'interpolation concide avec les points interpoler,
ses drives premire et seconde se raccordent
Donc, sur chaque intervalle [x
i-1
, x
i
], la restriction de S(x) est un polynme
P
i
(x) de degr 3 (ou plutt 3) tel que:
P
i
(x
i
-1) = y
i
-1
P
i
(x
i
) = y
i
P'
i
(x
i
) = P'
i+1
(x
i
)
et P''
i
(x
i
) = P''
i+1
(x
i
)
13
) x x (
h
1
) x x ( y
h
1

h 6
) h ) x x )(( x x (
M
h 6
) h ) x x )(( x x (
M ) x ( P
1 i
i
i i
i
i
2
i
2
1 i 1 i i
i
i
2
i
2
i i
1 i i

+ +

+

=
i = 1,,n
avec hi = xi - xi-1 , i = 1,... n
Exercice :
Montrer que M
0
, M
1
,... M
n
sont solutions du systme linaire suivant :
( ) ( )
1 i i
i
i 1 i
1 i
1 i
1 i
i
1 i i
1 i
i
y y
h
1
y y
h
1
M
6
h
M
3
h h
M
6
h
+
+
+
+ +

= +
+
+
i = 1,,n
avec M
0
et M
n
arbitraires (par exemple M
0
= M
n
= 0)
14
Moindres carrs :
Principe :
Minimiser la somme des carrs des distances entre les points (xi, yi) et (xi, g(xi)) :
( )

=
=
n
0 i
2
i i
) x ( g y D
Cas o g est un polynme de degr r (non ncessairement gal n)
( )

=
+ + + + =
n
0 i
2
r
r
k
k 1 0 i
) x a ... x a ... x a a ( y D
Les valeurs recherches sont les coefficients du polynme
d'interpolation qui doivent rendre minimum la quantit D :
On doit donc crire :
( ) 0 ) x .( ) x a ... x a ... x a a ( y 2
a
D
n
0 i
k
i
r
r
k
k 1 0 i
k
= + + + + =

=
15
soit :

= =
+
=
+
=
= |

\
|
+ |

\
|
+ |

\
|
n
0 i
i
k
i r
n
0 i
r k
i 1
n
0 i
1 k
i 0
n
0 i
k
i
) y . x ( a x .... a x a x
En crivant ces relations pour k = 0,1,2,,r; on obtient le systme suivant
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(





+ +
+
+
i
r
i
i i
i i
i
r
r
i
r
i
r
i
r
i
r
i i i i
r
i i i i
r
i i i
y x
y x
y x
y
a
a
a
x x x x
x x x x
x x x x
x x x n
2
1
0
2 2 1
2 4 3 2
1 3 2
2
.
.
1
16
17
Interpolation linaire :
On cherche la droite dquation y = ax +b, qui approche un
nuage de points au sens des moindres carrs
) x ( V
) y , x cov(
a =
x a y
) x ( V
) y , x cov( . x
y b = =
y x
.
) y , x cov(

=
2
3

Coefficient de corrlation :
Bonne corrlation si
Rappels
( )

=
=
+
=
n
i
i
x x x x
n
x V
0
2 2
2
1
1
) (
y x y x x y x x
n
y x
n
i
i i
. . ) )( (
1
1
) , cov(
0
=
+
=

=
18
Approximation des drives d'une fonction
1. Drives premires
Intuitivement :
i i
i i
i
x x
x f x f
x f

+
+
1
1
) ( ) (
) ( '
ou
1
1
) ( ) (
) ( '

i i
i i
i
x x
x f x f
x f
Dveloppement limit de f au voisinage de x
i
) ( ) ( ' ) ( ) (
2
h o x hf x f h x f
i i i
+ + = +
) (
) ( ) (
) ( ' h o
h
x f h x f
x f
i i
i
+
+
=
Valeur approch de f'(x
i
)
h = x
i
- x
i-1
Premier ordre droite
19
) ( ) ( ' ) ( ) (
2
h o x hf x f h x f
i i i
+ =
) (
) ( ) (
) ( ' h o
h
h x f x f
x f
i i
i
+

=
Valeur approch de f'(x
i
)
ou encore :
Premier ordre gauche
Diffrences dcentres
20
Diffrences centres
) ( ) ( ' ) ( ) (
2
h o x hf x f h x f
i i i
+ + = +
) ( ) ( ' ) ( ) (
2
h o x hf x f h x f
i i i
+ =
) ( ) ( ' 2 ) ( ) (
3
h o x hf h x f h x f
i i i
+ = +
) (
2
) ( ) (
) ( '
2
h o
h
h x f h x f
x f
i i
i
+
+
=
Valeur approch de f'(x
i
)
Diffrence centre :
second ordre
Remarques : formule non utilisables sur la frontire (x
0
ou x
n
)
21
Remarque :
La formule prcdente peut tre obtenue en approchant la fonction
driver par un polynme (interpolation de Lagrange) de degr 1
1 0
0
1
1 0
0
0
1 1 0 0 1
) ( ) (
) ( ) ( ) ( ) ( ) (
x x
x x
x f
x x
x x
x f
x L x f x L x f x P

=
+ =
La drive de P
1
en x
0
vaut alors :
0 1
0 1
0 1
) ( ) (
) ( '
x x
x f x f
x P

=
22
n impair
n pair
2 25 150 600 2100 2520 10
3 32 168 672 840 8
1 9 45 60 6
1 8 12 4
1 2 2
A
5
A
4
A
3
A
2
A
1
A
0
p
n=1
n=2
8 125 1000 6000 42000 25200 10
9 128 1008 8064 5040 8
2 27 270 180 6
1 8 12 4
1 1 2
A
5
A
4
A
3
A
2
A
1
A
0
p

S-ar putea să vă placă și