Explorer les Livres électroniques
Catégories
Explorer les Livres audio
Catégories
Explorer les Magazines
Catégories
Explorer les Documents
Catégories
NUMERIQUE
Résolution des problèmes demandés
Membres du projet
-guibinga dann yannick/20170340
- Mohamed D Diarra / 20170785
2017/2018
L3D/S5B
2Ei
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Remerciement
L’ensemble de cet ouvrage a été réalisé grâce au logiciel Word (qui appartient à
la suite Microsoft office) et le logiciel scilab qui nous ont permis réaliser les
différents algorithmes. Je remercie vivement tous les acteurs du monde de
l’éducation libre pour leur programme et leur mise à disposition du public.
Nous sommes également reconnaissants envers M. Babacar Lèye Professeur de
Méthode numérique. Enfin nous adressons nos remerciements à nos camarades
de la classe de la L3D-S5D pour leur contribution majeure aux efforts rendus et
nous disons merci à la TERRE AFRICAINE pour ces biens faits.
1
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
2
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Avant-propos
3
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Introduction
4
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Problème 1
On résout numériquement l’intégrale
10 1
I(f)= ∫−10 𝑑𝑥 = 2 arctan(10) ≃ 2.9422553
1+𝑥 2
1
(i) Tracer la courbe de 𝑥 → sur l’intervalle [-10,10].
1+𝑥 2
5
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Résolution du problème 1
1
(i) traçons la courbe de 𝑥 →
1+𝑥 2
1
Ainsi le tracer de la courbe 𝑥 → fait avec le logiciel scilab nous donne
1+𝑥 2
la figure ci-dessous :
Figure 1
6
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Tracé demandé
7
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
8
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Interprétation
La solution exacte est 2.95. Lorsque le pas augmente la valeur de la solution
approchée se rapproche de la valeur de la solution exacte. Cela s’observe pour
toutes les méthodes.
9
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Problème 2
On veut résoudre numériquement l’équation différentielle suivante :
1
𝑦 ′ (𝑡) = 𝑦(𝑡) 𝑡 ∈ ]0, 10[,
{ 1+𝑡 2 (2)
𝑦(0) = 1
1
(i) Calculer la solution exacte, sachant que la primitive de est
1+𝑡 2
arctan(t).
(ii) Afficher la courbe t → y(t).
(iii) Résoudre cette équation en utilisant:
10
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Résolution du problème 2
1
(i) calculons la solution du problème sachant que la primitive de est
1+𝑡 2
arctan(t).
1
𝑦 ′ (𝑡) = 𝑦(𝑡) (*)
1+𝑡 2
𝑑𝑦(𝑡)
y’(t)=
𝑑𝑡
Donc (*) devient :
𝑑𝑦(𝑡) 1
= y(t)
𝑑𝑡 1+𝑡 2
Ensuite,
𝑑𝑦(𝑡) 1
= dt
𝑦(𝑡) 1+𝑡 2
En intégrant,
𝑑𝑦(𝑡) 1
∫ =∫ dt (**)
𝑦(𝑡) 1+𝑡 2
𝑑𝑦(𝑡)
Or nous connaissons une primitive de ∫ qui est ln( ∣ 𝑦(𝑡) ∣)
𝑦(𝑡)
11
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
en remplaçant on a :
y(0) = k1𝑒 arctan(0) =1
D’où
k1= 1
y(t) = 𝑒 arctan(t)
12
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Tracé de la courbe
13
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Ensuite,
1
Yn+ 1 = yn +h[ ]yn
1+tn2
Et puis
ℎ
Yn+ 1 = yn[1+ ]
1+tn2
-condition de stabilité :
Ainsi Le schéma est stable si et seulement si :
ℎ
∣1+ ∣˂1
1+tk2
Suivit de,
1+𝑡𝑘 2 +ℎ
-1˂ ˂1
1+𝑡𝑘 2
Suivit de,
-1-𝑡𝑘 2 ˂1 + 𝑡𝑘 2 + ℎ˂ 1 + 𝑡𝑘 2
Suivit de,
14
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
-2-𝑡𝑘 2 ˂ h˂ 0
Enfin
0˂∣h∣˂2+𝑡𝑘 2
Ensuite,
1
Yn+ 1 - h× 𝑦 𝑛+1 = yn
1+𝑡 𝑛+1
Ensuite,
ℎ
𝑦 𝑛+1 (1 − ) = 𝑦𝑛
1 + 𝑡 𝑛+1
Ensuite,
1
𝑦 𝑛+1 = × 𝑦𝑛
ℎ
1−
1 + 𝑡 𝑛+1
Enfin,
1
𝑦𝑛 = × 𝑦0
ℎ
(1 − )𝑛+1
1 + 𝑡 𝑛+1
15
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
1
𝑦𝑘 = × 𝑦0
ℎ
{ (1 − )𝑘+1
1 + 𝑡𝑘+1
𝑦0 = 1
-condition de stabilité
Ainsi Le schéma est stable si et seulement si :
1
∣ ∣ ˂1
ℎ 𝑘+1
(1 − )
1 + 𝑡𝑘+1
Ensuite,
1
∣ ∣ ˂1𝑘+1
ℎ
(1 − )𝑘+1
1 + 𝑡𝑘+1
Ensuite,
1
∣ ∣ ˂1
ℎ
1−
1 + 𝑡𝑘+1
Ensuite,
1
−1˂ ˂1
ℎ
1−
1 + 𝑡𝑘+1
Ensuite,
16
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
ℎ ℎ
− 1˂ 1 ˂ 1 −
1 + 𝑡𝑘+1 1 + 𝑡𝑘+1
Ensuite,
ℎ
˂2
1 + 𝑡𝑘+1
ℎ
𝑘1 = ℎ𝑓 (𝑡𝑘 , 𝑦𝑘 ) 𝑘1 = 𝑦
1+𝑡𝑘 2 𝑘
ℎ 𝑘1 ℎ 𝑘1
𝑘2 = ℎ𝑓 (𝑡𝑘 + , 𝑦𝑘 + ) 𝑘2 = ( ℎ ) (𝑦𝑘 + )
2 2 1+(𝑡𝑘 + 2 )2 2
ℎ 𝑘2 ℎ 𝑘2
𝑘3 = ℎ𝑓 (𝑡𝑘 + , 𝑦𝑘 + ) 𝑘3 = ( ℎ ) (𝑦𝑘 + )
2 2 1+(𝑡𝑘 + 2 ) 2 2
ℎ
𝑘4 = ℎ𝑓 (𝑡𝑘 + ℎ, 𝑦𝑘 + 𝑘3 ) 𝑘1 = 𝑦
1+𝑡𝑘 2 𝑘
17
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
1
𝑦𝑘+1 = 𝑦𝑘 + (𝑘1 +2𝑘2 + 2𝑘3 + 𝑘4 )
6
Pour h=0.05
18
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Pour h=0.1
19
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Pour h=0.5
20
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Pour h=0.9
21
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
22
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Interprétation
Nous remarquons pour toutes ces valeurs du pas h donné la méthode de Runge
Kutta (d’ordre 4) est toujours plus proche de la solution exacte par rapport aux
deux autres méthodes.
De plus, lorsque le pas diminue les courbes représentatives des solutions
approchées convergent vers la solution exacte c’est à dire la diminution du pas
augmente la précision des méthodes ou des formules utilisées comme approche
RUNG KUTTA
EULER EXPLICITE
Lorsque le pas diminue la valeur de la solution approche de plus en plus de
celle de la solution exacte et nous avons un Schéma inconditionnellement stable
EULER IMPLICITE
Lorsque le pas diminue la valeur de la solution approche de plus en plus de
celle de la solution exacte et nous avons un Schéma inconditionnellement stable
23
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Problème 3
On considère l’équation de la chaleur
𝜕𝑢 𝜕2 𝑢
= µ 𝜕𝑥 2 , 𝑥 𝜖 ] − 𝑙, 𝑙 [, 𝑡 𝜖 ]0, 𝑇[,
𝜕𝑡
U n+1 = MUn,
Ou la matrice M et le vecteur Un sont à préciser.
24
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Résolution du problème
1- Discrétisation du domaine
Subdivisons les intervalles [−𝐿, 𝐿]𝑒𝑡[0, 𝑇] respectivement en N et
M 𝑥
𝑥𝑖 𝑖+1 𝑡𝑖 𝑡𝑖+1 𝑡𝑀
𝑥𝑁 𝑡0
∆𝑥 ∆𝑡
25
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
T−0 𝑇
∆t= =
M M
𝜕2 𝑢
Déterminons une discrétisation de :
𝜕𝑥 2
𝜕 𝑢
𝑢(𝑥𝑖+1 , 𝑡𝑘, ) = 𝑢(𝑥𝑖 + ∆x, 𝑡𝑘, ) = 𝑢(𝑥𝑖 , 𝑡𝑘, ) + ∆x (𝑥𝑖, 𝑡𝑘, ) +
𝜕𝑥
∆x2 𝜕2 𝑢
2! 𝜕𝑥 2
(𝑥𝑖, 𝑡𝑘, ) + ∆x 2 𝜀1 (∆x 2 ) (*)
𝜕 𝑢 ∆x2 𝜕2 𝑢
𝑢(𝑥𝑖−1 ) = 𝑢(𝑥𝑖 − ∆x, 𝑡𝑘, ) = 𝑢(𝑥𝑖 , 𝑡𝑘, ) − ∆x (𝑥𝑖, 𝑡𝑘, ) + (𝑥𝑖, 𝑡𝑘, ) +
𝜕𝑥 2! 𝜕𝑥 2
∆x 2 𝜀2 (∆x 2 ) (**)
(*)+(**)
∆x2
𝑢(𝑥𝑖+1 , 𝑡𝑘, ) + 𝑢(𝑥𝑖−1 , 𝑡𝑘, ) = 2 𝑢(𝑥𝑖 , 𝑡𝑘, ) + 𝑢(𝑥𝑖 , 𝑡𝑘, ) + 2 𝑢′′(𝑥𝑖 , 𝑡𝑘, ) + 𝜀(ℎ)
2!
26
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Posons
𝑢1 (𝑡𝑘 )
𝑢2 (𝑡𝑘 ) 2 −1 ⋯ ⋯ 0
. −1 2 −1 … 0
𝑑 𝜇
𝑈= . 𝐴 = (∆x)2 0 −1 ⋱ ⋱ 0
𝑑𝑡
. 0 ⋱ ⋱ −1
𝑢𝑁−2 (𝑡𝑘 ) (0 0 −1 2)
(𝑢𝑁−1 (𝑡𝑘 ))
𝑑(𝑈(𝑡𝑘 ))
Alors + 𝐴𝑈 = 0
𝑑𝑡
𝑑(𝑈(𝑡𝑘 ))
= −𝐴𝑈
𝑑𝑡
𝑑𝑈(𝑡𝑘 )
= 𝑓(𝑡, 𝑈) ⇒ 𝑓(𝑡𝑘 , 𝑈(𝑡𝑘 ) ) = −𝐴𝑈(𝑡𝑘 )
𝑑𝑡
𝑈 𝑛+1 = 𝑈 𝑛 + ∆𝑡𝑓(𝑡𝑛 , 𝑈 𝑛 )
𝑈 𝑛+1 = 𝑈 𝑛 − ∆𝑡𝐴𝑈 𝑛
4-) Itération
𝑈 𝑛+1 = 𝑈 𝑛 − ∆𝑡𝐴𝑈 𝑛
𝑈 𝑛+1 = (𝐼 − ∆𝑡𝐴)𝑈 𝑛
Posons = (𝐼 − ∆𝑡𝐴) = 𝑀
𝑈 𝑛+1 = 𝑀𝑈 𝑛 avec 𝑛 ∈ {0,1,2, … , 𝑀}
5-) Condition de stabilité du schéma obtenu
27
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
2∆𝑡 1
< Pour θ = 0 on a :
(∆𝑥)2 1−2𝜃
2∆𝑡
<1
(∆𝑥)2
28
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Cas de la stabilité
29
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Cas de l’instabilité
30
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Conclusion
Avec le problème 1, on a pu établir les tracé de la méthode du rectangle, du
trapèze de Simpson en fonction du nombre de sous-intervalle (abscisse), cela
nous permis de dire que La solution exacte est 2.95 .Lorsque le pas augmente la
valeur de la solution approchée se rapproche de la valeur de la solution exacte.
Cela s’observe pour toutes les méthodes.
Le problème 2, nous permis d’évaluer les formules de quadrature d’Euler
explicite, implicite et de RUNGE KUTTA, pour finalement dire que Nous
remarquons pour toutes ces valeurs du pas h donné la méthode de Runge Kutta
(d’ordre 4) est toujours plus proche de la solution exacte par rapport aux deux
autres méthodes. De plus, lorsque le pas diminue les courbes représentatives des
solutions approchées convergent vers la solution exacte c’est à dire la
diminution du pas augmente la précision des méthodes ou des formules utilisées
comme approche.
Le problème 3, à consterné la méthode de différence finies ainsi nous avons pu
conclure sur la stabilité et l’instabilité du schéma.
31
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
Problème 1
Code du Premier tracé
clear; clf();
function y=f(x) // la fonction intervenant dans l'intégrale
y=1 ./(1+x^2)
endfunction
//on fait tracer la courbe de f en vert
a=-10:0.1:10
plot2d(a,f(a),style=3)
a=-10;
b=10;
function res=f(x)
res=1/(1+x^2);
endfunction
endfunction
for i=1:6
T(i)=meth_rect(10*i);
end
N=[10:10:60]';
plot2d(N,T(N/10),style=color("red3"));// affichage methode du rectangle
32
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
end
endfunction
for i=1:6
T(i)=meth_trap(10*i);
end
N=[10:10:60]';
plot2d(N,T(N/10),style=color("green"));// affichage methode du trapeze
end
endfunction
for i=1:6
T(i)=meth_simp(10*i);
end
N=[10:10:60]';
plot2d(N,T(N/10),style=color("blue"));// affichage methode de Simpson
hl=legend(['rectangle';'trapeze';'simpson'],('in_upper_left'));
Problème 2
Code premier trace
x=[0:0.1:10];
plot2d(x,exp(atan(x)),style=color("blue4"));
legend('solution exacte','in_upper_left');
endfunction
a=0;
b=10;
33
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
h=(b-a)/100;
X=a:h:b;
Y=f(X);
//plot(X,Y);
//title(SOLUTION EXACTE")
// solutions approchees
function z=g(t, y)
z=y/(1+t.^2);
endfunction
// solution approchee d'Euler Explicite
function y=EulerExplicite(h)
N=10/h;
t=0:h:10;
y=zeros(N+1);
y(1)=1;
for i=1:N
y(i+1)=y(i)+h*g(t(i),y(i));
end
endfunction
// solution approchee d'Euler Implicite
function y=EulerImplicite(h)
N=10/h;
t=0:h:10;
y=zeros(N+1);
y(1)=1;
for i=1:N
y(i+1)=y(i)/(1-h/(1+(t(i+1)).^2));
end
endfunction
// solution approchee RK4
function y=RK4(h)
N=10/h;
t=0:h:10;
y=zeros(N+1);
y(1)=1;
for i=1:N
t1=t(i);
y1=y(i);
K1=h*g(t1,y1);
t2=t1+h/2;
y2=y1+K1/2;
34
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
K2=h*g(t2,y2);
t3=t1+h/2;
y3=y1+K2/2;
K3=h*g(t3,y3);
t4=t1+h;
y4=y1+K3;
K4=h*g(t4,y4);
y(i+1)=y(i)+(K1+2*K2+2*K3+K4)/6;
end
endfunction
35
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
//Implicite3=EulerImplicite(h);
//RK3=RK4(h);
Problème 3
Code premier tracé
//CODE POUR CALCULER Un
N=201;//espace
M=1010;//temps
dt=0.001; // choix du pas en temps
dx=0.1;//choix du pas en espace
mu=1;
a=(mu*dt)/(dx*dx);
U=zeros(N,M);
//conditions initiales
for i=1:90
U(i,1)=0;
end
36
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
for i=91:111
x=-1+0.1*(i-91);
U(i,1)=1-x^2;
end
for i=112:201
U(i,1)=0;
end
//ILLUSTRATION DE LA STABILITE
x=0;
t=0;
N=201;//espace
M=1010;//temps
dt=0.001; // choix du pas en temps
dx=0.1;//choix du pas en espace
mu=1;
a=(mu*dt)/(dx*dx); // a=0.1 inferieur à 0.5 donc schema stable
y=zeros(N,M);
//conditions initiales
for i=1:90
y(i,1)=0;
end
for i=91:111
x=-1+0.1*(i-91);
y(i,1)=1-x^2;
37
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
end
for i=112:201
y(i,1)=0;
end
plot2d((i-101)/10,y(i,1),style=color("yellow")) ;
plot2d((i-101)/10,y(i,201),style=color("blue4"));
plot2d((i-101)/10,y(i,401),style=color("green4"));
plot2d((i-101)/10,y(i,601),style=color("red2"));
plot2d((i-101)/10,y(i,801),style=color("magenta3"));
plot2d((i-101)/10,y(i,1001),style=color("black"));
hl=legend(['t=0s';'t=0.2s';'t=0.4s';'t=0.6s';'t=0.8s';'t=1s'],('in_upper_left'));
x=0;
t=0;
N=201;//espace
M=1010;//temps
dt=0.008; // choix du pas en temps
dx=0.1;//choix du pas en espace
mu=1;
a=(mu*dt)/(dx*dx); // a=0.8 superieur à 0.5 donc schema instable
y=zeros(N,M);
//conditions initiales
38
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
for i=1:90
y(i,1)=0;
end
for i=91:111
x=-1+0.1*(i-91);
y(i,1)=1-x^2;
end
for i=112:201
y(i,1)=0;
end
plot2d((i-101)/10,y(i,1),style=color("BLUE")) ;
plot2d((i-101)/10,y(i,125),style=color("GREEN"));
hl=legend(['t=0s';'t=1s'],('in_upper_left'));
39
Error! Use the Home tab to apply Titre 1 to the text that you want to appear here.
40