フィルターのクリア

Lsim not plotting anything

12 ビュー (過去 30 日間)
Nader Babar
Nader Babar 2023 年 5 月 7 日
回答済み: Venkat Siddarth 2023 年 6 月 1 日
I'm working on simulating a linear dynamical system with both and LQR and an h-infinity controller. With LQR I've gotten it to work and simulated the output, but with my h-infinity setup, when I run the system, there is no plotted output. The matrix dimensions are correct, and the A and C matrices are non-empty (Bcl and Dcl are zeros, but it should still be able to simulate the system).
%% Simulations with H Infinity Controller
sys = ss(Acl,Bcl,Ccl,Dcl);
sys.OutputName = 'θ';
t1 = 0:0.05:15;
x1 = [0 0.5 -0.5 0 0 0 0 0.5 -0.5 0 0 0];
figure(1);
w1 = zeros(length(t1),1);
w(t1>1)=1;
lsim(sys,w1,t1,x1);
title('Small Initial Conditions with Controller');
grid on;
  1 件のコメント
Nader Babar
Nader Babar 2023 年 5 月 7 日
Comparing this to when I simulate the system with a different controller:
sys2 = ss(A-B*K1,[],C,0);
sys2.OutputName = 'θ';
t3 = 0:0.05:15;
x3 = [0 0.05 -0.05 0 0 0];
figure(1);
u3 = zeros(length(t3),1);
lsim(sys2,u3,t3,x3);
title('Small Initial Conditions with Controller');
grid on;

サインインしてコメントする。

採用された回答

Venkat Siddarth
Venkat Siddarth 2023 年 6 月 1 日
In the script you have mentioned.I noticed that the variable w1 was passed to the lsim function, which was a zero matrix and therefore not modified. However, I suspect that there may be an error in the code where w was mistaken for w1 in the following line, which should be changing the variable's value.
Please refer to the following code snippet for an illustration:
w1 = zeros(length(t1),1); %%------------>Zero Matrix
w(t1>1)=1;
lsim(sys,w1,t1,x1); %% -----------------> % w1 not modified
I hope this resolves the issue
Regards
Venkat Siddarth V.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by