166
10
•
Différences finies en dimension 1
D=zeros(N,1);
D(1)=-alpha;D(N)=beta;
Bmod=B+h/2*D;
✝
✆
et modifier les conditions initiales et les noms de variables dans la boucle.
Ce qu’ilfaut retenir de cetexercice
Si le programme initial pendul5.m aété bien fait, il n’y apas grand chose àmodifier.
Pour pendul92.m,mêmes changements àpartir de pendul7.m
10.3 Schéma de Numerov
1. En chaque point x i , i = 2 ,..., N +1,pour une fonction f de classe C
6
,par la formule de
Taylor,ilexiste a j ∈ ]0, 1[, j = 1 , 2 , 3 , 4tels que
f ( x i − 1 ) = f ( x i ) − h f
( x i )+
h
2
2
f
( x i ) −
h
3
6
f
(3)
( x i )+
h
4
24
f
(4)
( x i ) −
h
5
120
f ( x i )
+
h
6
720
f
(6)
( x i − a 1 h ) ,
f ( x i +1 ) = f ( x i )+h f
( x i )+
h
2
2
f
( x i )+
h
3
6
f
(3)
( x i )+
h
4
24
f
(4)
( x i )+
h
5
120
f ( x i )
+
h
6
720
f
(6)
( x i + a 2 h ) ,
f
( x i − 1 ) = f
( x i ) − h f
(3)
( x i )+
h
2
2
f
(4)
( x i ) −
h
3
6
f
(5)
( x i )+
h
4
24
f
(6)
( x i − a 3 h ) ,
f
( x i +1 ) = f
( x i )+h f
(3)
( x i )+
h
2
2
f
(4)
( x i )+
h
3
6
f
(5)
( x i )+
h
4
24
f
(6)
( x i + a 4 h ) .
On en déduit, en utilisant le théorème des valeurs intermédiaires pour f
(6)
que
1
h 2
f ( x i − 1 ) − 2 f ( x i )+f ( x i +1 )
−
1
12
f
( x i − 1 )+10 f
( x i )+f
( x i +1 )
= f
( x i )+
h
2
12
f
(4)
( x i )+
h
4
720
f
(6)
( x i − a 1 h )+f
(6)
( x i + a 2 h )
−
1
12
12f
( x i )+h
2
f
(4)
( x i )+
h
4
24
f
(6)
( x i − a 3 h )+f
(6)
( x i + a 4 h )
=
h
4
360
f
(6)
( x i + a 5 h ) −
h
4
144
f
(6)
( x i + a 6 h ) , a 5 , a 6 ∈ ] − 1 , 1[.
Précédent

- 145/188

Suivant