Vous êtes sur la page 1sur 17

Méthode des différences finies : MDF

Développement en série de Taylor :


Soit une fonction f définie sur le domaine x  0, L  , elle est continue et à dérivée successives continues nous

pouvons écrire son développement en série de Taylor sous la forme :


2 n n
f  x 0  h   f  x 0   hf '  x 0   h f ''  x 0   .......  h f    x 0   o  h n 1 
      2!   n!    

Notation o :
Par définition, lorsque la fonction f est petite devant g, nous avons la notation avec : x  x 0  h
f  x   o  g  x    lim f  x  g  x   0
x x   x x 0
0

Exemple :
2
f  x 0  h   f  x 0   hf '  x 0   h f ''  x 0   o  h 3 
      2!    
 2     
f  x 0   hf '  x 0   h f ''  x 0   o  h 3   E  h   o  h 3   E  h    h 3 
 
E  h   f  x  h  
 
  0      2!    
     

1
Constitution d’un schéma :
A partir de cette écriture nous pouvons donner une expression approchée de la dérivée première de f au point x0.

i-1 i i+1 i+2


h
xi-1 xi+1 xi+2 x
xi

Dérivée première :
Nous avons :
2 3  3
1        
f x 0  h  f x 0  hf ' x 0  h f '' x 0  h f   x 0  o  h 4 
2! 3!  
 
2 3  3
 2     '
f x 0  h  f x 0  hf x 0  h
2!  
''
f x0  h
3!  
f   x 0  o  h 4 
 
 
 
1   2 
     f  x 0  h   f  x 0  h   2hf '  x 0   o  h 3 
           

Ce qui nous donne :

f '  x 0   1  f  x 0  h   f  x 0  h   o  h 2 
   
  2h        

2
Nous pouvons définir cette forme d'écriture par un schéma dit schéma de différences finies :

  1  1 0  1   o  h 2 
 
x x 2h  

 
i  

C'est un schéma centré avec une erreur d'ordre h2


On peut aussi écrire :
2
f  x 0  h   f  x 0   hf '  x 0   h f ''  x 0   0  h 3 
 
      2!    
1  f  x  h   f  x   f '  x   0  h 
    0   0  
h   0        

f '  x 0   1  f  x 0   f  x 0  h   o  h 
 
  h        

C'est un schéma décentré à droite (un schéma avancé) avec une erreur d'ordre h. Sa molécule ou son schéma est
donné par :

  1  0  1 1   o  h 
 
x x h  


 
i 

3
On peut aussi écrire :
 
f  x 0  h   f  x 0   hf '  x 0   0  h 2 
       
1  f  x  h   f  x   f '  x   0 h 
 
    0   0  
h   0        

f '  x 0   1  f  x 0  h   f  x 0   o  h 
 
  h        

C'est un schéma décentré à droite (un schéma retardé) avec une erreur d'ordre h.
Sa molécule ou son schéma est donné par :

  1  1 1 0   o  h 
 
x x h  


 
i  

Interprétation géométrique :
f(x) Le schéma retardé
Le schéma avancé Le schéma centré

h h
xi-1 xi xi+1 x

4
Dérivée seconde :
On peut de la même manière déterminer les différents schémas associés à une dérivée de second ordre :
  

f x  h  f  x   hf '  x     h 4 f  4   x   0  h 5 
  0  0  0  0  
       4!    

 

 f x  h  f  x   hf '  x     h 4 f  4   x   0  h 5 
 0  0  0  0  


      4!    


1   2  x  h2  2    4
     f x
 0  h   f x
 0  h  2f  0 f  
 x0   0 h 

             

Ce qui nous donne :

f ''  x 0   1  f  x 0  h   2 f  x 0   f  x 0  h   o  h 2 
   
  h 2          

Nous pouvons définir cette forme d'écriture par un schéma dit schéma de différences finies :
 
2  1  1  2  1   o  h 2 

x 2 x h 2     
i

C'est un schéma centré avec une erreur d'ordre h2

5
Deuxième cas d’application :

Ce schéma est un schéma centré avec une erreur de troncature d'ordre (ou de type) h2.
f  x 0  2h   f  x 0   2hf '  x 0   2h 2 f ''  x 0   o  h 3 
         

 f  x 0  2h   2 f  x 0  h    f  x 0   h 2 f ''  x 0   o  h 3 
         

f ''  x 0   1  f  x 0   2 f  x 0  h   f  x 0  2h   o  h 
 
  h 2          

6
Exemples de schémas :
Dérivée première
Ordre de X0-2 X0-1 X0 X0+1 X0+2 Coefficient
précision multiplicatif
o(hn)
Décentré gauche 1 -1 1 1/h

Décentré droite 1 -1 1 1/h

Décentré gauche 2 1 -4 3 1/2h

Décentré droite 2 -3 4 -1 1/2h

Centré 2 1 0 1 1 /2h
Centré 4 1 -8 0 8 -1 1/12h

7
Dérivée seconde
Ordre de précision X0- X0-2 X0-1 X0 X0+1 X0+2 X0+3 Coefficient
o(hn) 3 multiplicatif
Décentré gauche 1 1 -2 1 1/h2
Décentré droite 1 1 -2 1 1/h2
Décentré gauche 2 -1 4 -5 2 1/h2
Décentré droite 2 2 -5 4 -1 1/h2
Centré 2 1 -2 1 1/h2
Centré 4 -1 16 -30 16 -1 1/12h2

8
Résolution d’un problème par D. F. :
Nous allons appliquer cette méthode pour la résolution d’un problème physique.
 
 d  du x     cu x  q x =0 où 0  x  L

 dx 
a
dx     

  


 u  0   u et

 du x    Q0
0 a 


   dx 
 
 x L

Où a=a(x), c=c(x), q=q(x), u0 et Q0 sont données.


Ce problème est représentatif d’un grand nombre de problèmes physiques (voir Cours 1)
Prenons le cas où a et c sont constantes l’équation d’équilibre devient :
d 2u  x 
a  cu  x   q  x  =0 où 0  x  L
dx 2

Nous commençons par décomposer le domaine 0, L  en N segments (N+1 points) : h  h x  L . Il faut ensuite
N
choisir le schéma pour traduire la dérivée seconde présente dans l’équation. Nous choisissons un schéma centré.

9
 
2  1  1  2  1   o  h 2 
x 2 x h 2   
 
i

Application de l’équation d’équilibre :


En chaque point x i pour i  2, N (nous reviendrons sur les deux points limites i=1 et i= N+1 plus loin) nous
pouvons écrire :
d 2u  x i 
a    cu  x i   q  x i  =0
dx 2    

Ce qui donne :

a 1 u i 1  2u i  u i 1  cu i  q i  o  h 2 
 

h2    

10
Application des conditions aux limites :
En plus de l’application de l’équation d’équilibre aux différents points du domaine (en dehors des deux points
limites), nous devons appliquer (imposer et vérifier) les deux conditions aux limites.

u1  u  0   u0 et

  
 du x
 Q0
a 
   dx 
 
x  x N 1

Première condition :
L’application de la première condition est directe, la variable est connue, elle ne nécessite pas d’équation à
vérifier. Il suffit de l’appliquer dans le système discret final.
Il n’est pas nécessaire d’appliquer l’équation d’équilibre en ce point la valeur de la fonction étant connue.

Deuxième condition :
Pour la deuxième nous devons, de nouveau, à choisir un schéma pour traduire la dérivée première présente dans
la condition aux limites en xN+1.

11
Deux choix peuvent être faits :
Le premier choix consiste à utiliser un schéma retardé :

  1  1 1 0   o  h 
 
x x h  
  
i  

Ce schéma est d’ordre h qui est moins précis que celui utilisé pour l’équation.
Le second choix consiste à utiliser un schéma centré :
  1  1  0  1   o  h 2 
 
x x 2h  
  
i  

Ce schéma est de même ordre que celui utilisé pour l’équation.


Toutefois, il nécessite l’introduction d’un point supplémentaire.
Nous appelons ce nouveau point nœud fictif.
Nous aurons donc un nœud non physique (fictif) N+2
1 u  u    1 Q  o h 2 

2h  N N  2  a 0  

12
Comme uN+1 n’est pas connu nous devons appliquer l’équation d’équilibre en ce point, faisant introduire le nœud
fictif.
L’application de la condition aux limites en uN+1 va nous permettre d’éliminer ce nœud fictif uN+2 .

Système discret final :


Nous obtenons donc :

a 1 u 0  2u 2  u 3   cu 2  q 2
 
  o h 2 

 h2    



 1   2
u N  2u N 1  u N  2   cu N 1  q N 1  o  h 

a
 h 2  

 1 u  u    1 Q  o h 2 

 2h  N N 2 
 a 0  

13
Différences finies à deux dimensions :
Les schémas où molécules à deux dimensions s’obtiennent en généralisant les schémas à une dimension et en
considérant les deux variables  x, y  d’une manière séparée.
Le maillage du domaine se fait dans les deux directions x et y et les deux pas peuvent être égaux comme ils
peuvent être différents.

Dérivée première :
Pour un schéma centré par exemple, la dérivée première s’exprime :
  
 f  xi , y j 
 1  f  x i 1, y j   f  x i 1, y j  
  


 x 2h x     

 f  
 xi , y j   
 1  f  x i , y j 1   f  x i , y j 1  
 

 y 2h y      

Où h x   x  x i 1  x i et h y   y  y i 1  y i

14
Dérivée seconde : le laplacien
La dérivée seconde est donnée par :


 2 f  x i , y j 
 1  f  x i 1, y j   2 f  x i , y j   f  x i 1, y j  
  
 

 x 2 h x2        

 2 f  x i , y j   
 1  f  x i , y j 1   2 f  x i , y j   f  x i , y j 1  
  


 y 2 h y2        

Le laplacien est donné par :

 2 f  x i , y j   2 f  x i , y j 
  1  f x
     

 i 1, y j   2 f  x i , y j   f  x i 1, y j  
 
x 2 y 2 h x2        
 
 1  f  x i , y j 1   2 f  x i , y j   f  x i , y j 1 
h y2        

15
Lorsque nous prenons hx = hy = h, ce schéma peut se mettre sous la forme moléculaire suivante :

i 1 i i 1 y

  j 1
 1 
 
 1 
 2  1 4 1


 j 
2

 o  h 

x



 ij h  1  j 1  
 

D’autres schémas peuvent être construits sur le même principe.

16
Dérivées croisées :

 2 f  x i , y j 
   1  f  x , y 
 f 
x , y 
 f 
x , y 
 f 
x , y 
xy
 i 1
h x h y  

j 1   i 1

j  


i j 1   i

j  

Lorsque nous prenons hx = hy = h, ce schéma peut se mettre sous la forme moléculaire suivante :

y
i 1 i i 1
j 1
0  1 1 



x  2  1 0 1 1 j  o  h 


xy h 2
0 1 0


j 1
 
 
ij 




17

Vous aimerez peut-être aussi