From 49af696bd511403c7fdb820913b1b317aa39aa6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9ranger?= Date: Tue, 25 May 2021 09:20:24 +0200 Subject: [PATCH] Question 5 --- BE.m | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/BE.m b/BE.m index 8d7562e..93538e2 100644 --- a/BE.m +++ b/BE.m @@ -1,6 +1,9 @@ +%% +% BE de commande optimale clc -%% BE de commande optimale +%% +%Question 3 Ms = 1120/4; %kg mu = 45; %kg Ks = 20000; %N/m @@ -27,4 +30,38 @@ sysZu = ss(A,E,C_ut,0) %Modification en tf tf_Zu = tf(sysZu) +%tracé de bode de nos deux sous systèmes bode(tf_Zs,tf_Zu) + +%% +% Question 5 +% Mise en place de la commande optimale + +Q=[Ks^2 0 0 0; 0 Cs^2 0 0; 0 0 Kt^2 0; 0 0 0 0]; +R=1; + +[G, K, lambda]=lqr(A,B,Q,R); +Abf=A-B*G; + +sysZsBF = ss(Abf, E, C_st, 0); +Zs_BF = tf(sysZsBF) +sysZuBF = ss(Abf, E, C_ut, 0); +Zu_BF = tf(sysZuBF) + +figure +bode(Zs_BF, Zu_BF); + +%commande obtenue par u=-Gx, C=-G +C=-G; +commande=ss(Abf, E, C, 0) + +%Réponse indicielle +figure +step(0.08*sysZsBF) +title("Réponse indicielle pous Zsbf") +figure +step(0.08*sysZuBF) +title("Réponse indicielle pour Zubf") + + +