From bb91f9195c6a62bd6a659f29fc4a5697a68a5928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9ranger?= Date: Tue, 25 May 2021 09:39:05 +0200 Subject: [PATCH] Ajout boucle For pour LQR --- BE.m | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/BE.m b/BE.m index 93538e2..ebd20dd 100644 --- a/BE.m +++ b/BE.m @@ -51,17 +51,41 @@ 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") +title("Réponse indicielle pous ZsBF") figure step(0.08*sysZuBF) -title("Réponse indicielle pour Zubf") +title("Réponse indicielle pour ZuBF") +% Variation de Q +figure +for i = [1:100] + [G, K, lambda]=lqr(A,B,i*Q,R); + Abf=A-B*G; + + sysZsBF = ss(Abf, E, C_st, 0); + Zs_BF = tf(sysZsBF) + + step(0.08*sysZsBF) + + hold on +end +figure +for i= [1:100] + [G, K, lambda]=lqr(A,B,i*Q,R); + Abf=A-B*G; + sysZuBF = ss(Abf, E, C_ut, 0); + Zu_BF = tf(sysZuBF) + + step(0.08*sysZuBF) + + hold on +end + +%commande obtenue par u=-Gx, C=-G +C=-G; +commande=ss(Abf, E, C, 0)