Académique Documents
Professionnel Documents
Culture Documents
avec MATLAB
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
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
Questions
0 0
Soit le système (S1 ): y1 (t) = 2y1 (t) et y2 (t) = −2y2 (t):
2- Tracer les courbe paramétriques pour Y0 = (1, 1)T , Y0 = (1, −1)T , Y0 = (1, −2)T et Y0 = (1, 2)T .
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.
1
Portrait de phase H. LALIOUI
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
Code
6
Portrait de phase H. LALIOUI
Exécution
7
Portrait de phase H. LALIOUI
8
Portrait de phase H. LALIOUI
hafid.lalioui@edu.uiz.ac.ma