Vous êtes sur la page 1sur 6

RÉPUBLIQUE ALGÉRIENNE DÉMOCRATIQUE ET POPULAIRE

UNIVERSITÉ DE BOUMERDES
FACULTE DES HYDROCARBURES ET CHIMIE DEPARTEMENT

TP N°02:

Les caractéristiques des systèmes non linaires

Groupe : maca19

Etudiant : Benour Abderrahim

Année Universitaire
2022-2023
Le but du TP :
-Mise en équation de la méthode variationnelle sur un problème de commande
d’un système mécanique.
-Implémentation sur Matlab l’algorithme de synthèse.
-Evaluation des performances de la commande optimale obtenue.

Partie pratique :
1. Le système d'équations canoniques :
L'équation de mouvement est donnée par :
2
d l (t)
M =F ( t )−F r (t )−F a ( t ) −Z ( t )
dt 2
Avec :
3
F r (t)=k 1 l (t )+k 3 l (t)
F a (t )=k a l̇ (t)
Z ( t )=Z1 ( 1−e−at ) +Z 0 e−at
x 1 ( t )=l(t) Et x 2 ( t )=l̇(t )
On sait que :
tf

J=s ( x 1 ( t f ) , t f )+∫ L( x ( t ) ,u ( t ) , t) dt
t0

L'équation de LAGRANGE est :


~
F ( x , ẋ ,u , λ , , t )=−L+ λT ( f − ẋ )
T T
¿−L+ λ f −λ ẋ

H=−L+ λ f  ; est appelé Hamiltonien.


T

La forme canonique d'Hamilton :

∂H
+ λ̇=0 ⟹ H X =− λ̇
∂x
∂H
− ẋ =0 ⟹ H λ = ẋ
∂λ
∂H
=0⟹ H u =0
∂u
Après identification :
2 2 2
L=q1 (x 1 ( t )−x 1 d ) + q2 ( x 2 ( t )−x 2 d ) + p u (t)
2 2
S=g 1( x1 ( t f ) −x 1d ) + g2 ( x 2 ( t f )−x 2 d )
T
H=−L+ λ f
H=−L+ λT f
2 2
H=−q1 ( x 1 ( t )−x 1 d ) +q 2 ( x 2 ( t ) −x2 d ) + p u ( t ) + λ 1 x 1
2

+ λ 2 ¿]
−λ2
Alors la condition nécessaire d’optimalité : u ( t )=
2 MP

Le système d’équations canoniques est :

ẋ 1 ( t )=x 2
ẋ 2 ( t )=−0.8 x 1−0.25 x 2 −1.3 x 2−1.25 x 4 −1.1 ( 1−e )−( 0.2−e−0.1t )
3 −0.1t

=-1.25*L2-0.8*x2-0.25*x1^3-1.3*x2-(2.2*(1exp (0.1*t)) +0.4*exp (0.1*t)) /2


2
λ 3=−1.6 x 4−4.8 x 4 x 1 −1000 x 1
λ 4=x 3−2.6 x 4 −0.1 x2

Avec :
dL1=-1000*x1+0.8*L2+0.75*L2*x1^2

dL2=-0.1*x2-L1+1.3*L2

2. Le programme élaboré :

t0=0;
tf=0.5;
h=0.001;
x10=-0.3;
x20=-0.15;
l10=-79.278;
l20=-10.106;
T=[t0:h:tf];
N=(tf-t0)/h;
X1(1)=x10;
X2(1)=x20;
L1(1)=l10;
L2(1)=l20;
X1=zeros(N+1,1);
X2=zeros(N+1,1);
L1=zeros(N+1,1);
L2=zeros(N+1,1);
for i=1:N
M1=f11(X1(i),X2(i),L1(i),L2(i),T(i));
N1=f22(X1(i),X2(i),L1(i),L2(i),T(i));
P1=f33(X1(i),X2(i),L1(i),L2(i),T(i));
W1=f44(X1(i),X2(i),L1(i),L2(i),T(i));
M2=f11(X1(i)+0.5*h*M1,X2(i)+0.5*h*N1,L1(i)+0.5*h*P1,L2(i)+0.5*h*W1,T(i)+0.5*h);
N2=f22(X1(i)+0.5*h*M1,X2(i)+0.5*h*N1,L1(i)+0.5*h*P1,L2(i)+0.5*h*W1,T(i)+0.5*h);
P2=f33(X1(i)+0.5*h*M1,X2(i)+0.5*h*N1,L1(i)+0.5*h*P1,L2(i)+0.5*h*W1,T(i)+0.5*h);
W2=f44(X1(i)+0.5*h*M1,X2(i)+0.5*h*N1,L1(i)+0.5*h*P1,L2(i)+0.5*h*W1,T(i)+0.5*h);
M3=f11(X1(i)+0.5*h*M2,X2(i)+0.5*h*N2,L1(i)+0.5*h*P2,L2(i)+0.5*h*W2,T(i)+0.5*h);
N3=f22(X1(i)+0.5*h*M2,X2(i)+0.5*h*N2,L1(i)+0.5*h*P2,L2(i)+0.5*h*W2,T(i)+0.5*h);
P3=f33(X1(i)+0.5*h*M2,X2(i)+0.5*h*N2,L1(i)+0.5*h*P2,L2(i)+0.5*h*W2,T(i)+0.5*h);
W3=f44(X1(i)+0.5*h*M2,X2(i)+0.5*h*N2,L1(i)+0.5*h*P2,L2(i)+0.5*h*W2,T(i)+0.5*h);
M4=f11(X1(i)+h*M3,X2(i)+h*N3,L1(i)+h*P3,L2(i)+h*W3,T(i)+h);
N4=f22(X1(i)+h*M3,X2(i)+h*N3,L1(i)+h*P3,L2(i)+h*W3,T(i)+h);
P4=f33(X1(i)+h*M3,X2(i)+h*N3,L1(i)+h*P3,L2(i)+h*W3,T(i)+h);
W4=f44(X1(i)+h*M3,X2(i)+h*N3,L1(i)+h*P3,L2(i)+h*W3,T(i)+h);
X1(i+1)=X1(i)+(h/6)*(M1+2*M2+2*M3+M4);
X2(i+1)=X2(i)+(h/6)*(N1+2*N2+2*N3+N4);
L1(i+1)=L1(i)+(h/6)*(P1+2*P2+2*P3+P4);
L2(i+1)=L2(i)+(h/6)*(W1+2*W2+2*W3+W4);
u(i+1)=-2.5*L2(i)
end
figure(1)
subplot(2,2,1)
plot(T,X1,'r'), grid on
title('X1*')
subplot(2,2,2)
plot(T,X2,'g'), grid on
title('X2*')
subplot(2,2,3)
plot(T,L1,'r'), grid on
title('l1*')
subplot(2,2,4)
plot(T,L2,'g'), grid on
title('l2*')
figure(2)
plot(T,u),grid on,title('u*')

Les fonctions utilisées :

F1 :
function [dx1] = F1(x1,x2,L1,L2,t)
dx1=x2;
end
F2 :
function [dx2] = F2(x1,x2,L1,L2,t)
dx2=-1.25*L2-0.8*x2-0.25*x1^3-1.3*x2-(2.2*(1-exp(-0.1*t))+0.4*exp(-0.1*t))/2;
end

G1 :
function [dL1] = G1(x1,x2,L1,L2,t)
dL1=-1000*x1+0.8*L2+0.75*L2*x1^2;
end

G2 :
function [dL2] = G2(x1,x2,L1,L2,t)
dL2=-0.1*x2-L1+1.3*L2;
end

Les résultats obtenus :

2-Les tracés de x1*, x2*, l1*, l2* :

-La trajectoire de la commande u(t) :


-La trajectoire optimale du système commandé :

4-Les valeurs finales :

Vous aimerez peut-être aussi