Browse Source

Ajout boucle For pour LQR

parent
commit
bb91f9195c
1 changed files with 30 additions and 6 deletions
  1. 30
    6
      BE.m

+ 30
- 6
BE.m View File

@@ -51,17 +51,41 @@ Zu_BF = tf(sysZuBF)
51 51
 figure
52 52
 bode(Zs_BF, Zu_BF);
53 53
 
54
-%commande obtenue par u=-Gx, C=-G
55
-C=-G;
56
-commande=ss(Abf, E, C, 0)
57
-
58 54
 %Réponse indicielle
59 55
 figure
60 56
 step(0.08*sysZsBF)
61
-title("Réponse indicielle pous Zsbf")
57
+title("Réponse indicielle pous ZsBF")
62 58
 figure
63 59
 step(0.08*sysZuBF)
64
-title("Réponse indicielle pour Zubf")
60
+title("Réponse indicielle pour ZuBF")
65 61
 
62
+% Variation de Q
63
+figure
64
+for i = [1:100]
65
+  [G, K, lambda]=lqr(A,B,i*Q,R);
66
+  Abf=A-B*G;
67
+  
68
+  sysZsBF = ss(Abf, E, C_st, 0);
69
+  Zs_BF = tf(sysZsBF)
70
+
71
+  
72
+  step(0.08*sysZsBF)
73
+  
74
+  hold on
75
+end 
66 76
 
77
+figure
78
+for i= [1:100]
79
+  [G, K, lambda]=lqr(A,B,i*Q,R);
80
+  Abf=A-B*G;
81
+  sysZuBF = ss(Abf, E, C_ut, 0);
82
+  Zu_BF = tf(sysZuBF)
83
+  
84
+  step(0.08*sysZuBF)
85
+  
86
+  hold on
87
+end
67 88
 
89
+%commande obtenue par u=-Gx, C=-G
90
+C=-G;
91
+commande=ss(Abf, E, C, 0)

Loading…
Cancel
Save