Vous êtes sur la page 1sur 11

Travaux Pratiques d’Analyse Numérique

avec MATLAB

Cinquième Science: Portrait de phase

Hafid LALIOUI

Email: hafid.lalioui@edu.uiz.ac.ma

Université Ibn Zohr, Ecole Nationale des Sciences Appliquées, Première Année Cycle d’Ingénieur

April 2021
Contents

1 Fiche du TP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Portrait de phase et équation de Van Der Pol . . . . . . . . . . . . . . . . . . . . . . 2

2.1 Portrait de phase 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.2 Equation de Van Der Pol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

i
Portrait de phase H. LALIOUI

1 Fiche du TP

Objectif

Résolution et traçage de portrait de phase pour les systèmes linéaires d’équations différentielles de
type
(S) : Y 0 = A ∗ Y
avec A ∈ M2 (R) et Y = (y1 (t), y2 (t))T

Méthodes

Fonction Matlab prédéfinies: ode45(), quiver().

Questions

0 0
Soit le système (S1 ): y1 (t) = 2y1 (t) et y2 (t) = −2y2 (t):

1- Donner l’expression et la courbe paramétrique qui caractérisent la solution de (S1 ).

2- Tracer les courbe paramétriques pour Y0 = (1, 1)T , Y0 = (1, −1)T , Y0 = (1, −2)T et Y0 = (1, 2)T .

3- En utilisant la fonction quiver(), donner le portrait de phase du système (S1 ).

4- Donner, en utilisant la fonction ode45(), le portrait de phase du système (S1 ) avec Y0 = (1, 1)T .

Application (Équation de van der pol): Soit (E1 ) l’équation de van der pol de paramètre 1.
00
(E1 ) : y1 (t) − (1 − y12 )y10 (t) + y1 (t) = 0.
0
1- On posant y1 (t) = y2 (t), réécrire (E1 ) sous forme d’un système d’équations différentielles.

2- Utiliser la fonction ode45() pour résoudre le système obtenu en prennent Y0 = (1, 0)T . Tracer les
solutions de (E1 ) obtenues.

3- Tracer le portrait de phase de (E1 ) pour Y0 = (1, 0)T .

4- Tracer le portrait de phase de (E1 ) à l’aide de la fonction quiver().

1
Portrait de phase H. LALIOUI

2 Portrait de phase et équation de Van Der Pol

2.1 Portrait de phase 2D

Code

1 % Solve y1'=2y1
2 % y2'=−2y2
3 % Analytic y1y2=y1(0)y2(0)
4 clear;clc;
5 y1 0=1;y2 0=1;
6 y1=−4:0.1:4;
7 %Parametric Curves
8 y2=((y1 0 * y2 0)./y1);
9 Graphe1=plot(y1,y2);
10 hold on
11 plot(y1,(1*−1)./y1);
12 plot(y1,(1*−2)./y1);
13 plot(y1,(1*2)./y1);
14 legend('y0=(1,1)','y0=(1,−1)','y0=(1,−2)','y0=(1,2)')
15 xlabel('y1(t)'),ylabel('y2(t)'),title('Some parametric curves for (S)')
16 hold off
17 %Phase portrait quiver
18 figure(2)
19 [Y1,Y2]=meshgrid(−3:0.5:3,−2:0.5:2);
20 Graphe2=quiver(Y1,Y2,2*Y1,−1*Y2);
21 xlabel('y1(t)'),ylabel('y2(t)'),title('Phase portrait of (S)')
22 %Phase portrait ode45 for Y0=(1,1)
23 figure(3)
24 Ydot=@(t,Y)[2 0;0 −2]*Y;
25 [t,Y]=ode45(Ydot,[−1 1],[1,1]);
26 Graphe3=plot(Y(:,1),Y(:,2));
27 xlabel('y1(t)'),ylabel('y2(t)'),title('Phase portrait of (S) for Y0=(1,1)')
28 saveas(Graphe1,'Parametric Curves.jpg')
29 saveas(Graphe2,'Phase Portrait.jpg')
30 saveas(Graphe3,'Phase Portrait for Y0=(1,1).jpg')

2
Portrait de phase H. LALIOUI

Exécution

3
Portrait de phase H. LALIOUI

4
Portrait de phase H. LALIOUI

5
Portrait de phase H. LALIOUI

2.2 Equation de Van Der Pol

Code

1 %Solution of Van Der Pol's system/equation


2 % Equation y''−(1−yˆ2)y'+y=0
3 % System y1'=y2
4 % y2'=(1−y1ˆ2)y2−y1
5 [t,Y]=ode45('vdp1',[0 20],[1,0]);
6 Graphe1=plot(t,Y(:,1));
7 hold on
8 plot(t,Y(:,2));
9 hold off
10 legend('y1(t)','y2(t)')
11 xlabel('t'),ylabel('y1(t) & y2(t)'),title('Solutions of vdp''s system/equation ...
with Y0=(1,0)')
12 %Phase portrait ode45 for Y0=(1,0)
13 figure(2)
14 Graphe2=plot(Y(:,1),Y(:,2));
15 xlabel('y1(t)'),ylabel('y2(t)'),title('Phase portrait of (S) for Y0=(1,0)')
16 %Phase portrait quiver
17 figure(3)
18 [Y1,Y2]=meshgrid(−2:0.5:2,−2:0.5:2);
19 Graphe3=quiver(Y1,Y2,Y2,(1−Y1ˆ2)*Y2−Y1);
20 xlabel('y1(t)'),ylabel('y2(t)'),title('Phase portrait of (S)')
21 saveas(Graphe1,'Solutions of vdp.jpg')
22 saveas(Graphe2,'Phase Portrait ode45 for Y0=(1,0) vdp.jpg')
23 saveas(Graphe3,'Phase Portrait quiver vdp.jpg')

6
Portrait de phase H. LALIOUI

Exécution

7
Portrait de phase H. LALIOUI

8
Portrait de phase H. LALIOUI

Travaux Pratiques d’Analyse Numérique avec MATLAB


Cinquième Science: Portrait de phase

hafid.lalioui@edu.uiz.ac.ma

Vous aimerez peut-être aussi