Model I/O dimensions must agree in feedback(Using struct file to find Robustness in a control system)
7 次查看(过去 30 天)
显示 更早的评论
Hello,
New to the Robust Control System toolbox. Watching some videos to guide me. I am following his code and get the error below that is commented out. Why is this and what can i do to correct this? The matrix Gunc*k is a 4x1 uncertain state space model and eye(4) is the 4x4 identity matrix. His program seems to work so im not sure what i am doing wrong. Thank you.
video link: https://youtu.be/Oq4qbp-vKt0
>> k = ureal('k',1,'percent',30);
>> m1 = ureal('m1',1,'percent',10);
>> m2 = ureal('m2',1,'percent',20);
>> A = [0, 1, 0, 0; -k/m1, 0, k/m1 0; 0, 0, 0, 1; k/m2, 0, -k/m2, 0];
>> B = [0; 1/m1; 0; 0];
>> C = eye(4);
>> D = [0;0;0;0];
>> Gunc = ss(A, B, C, D)
>> gcl = feedback(Gunc*k,eye(4))
% Error using InputOutputModel/feedback (line 137)
% The first and second arguments of the "feedback" command must
% have compatible I/O sizes.
0 个评论
采纳的回答
Uday Pradhan
2020-9-3
Hello Johnathon,
The error is due to the incorrect usage of variable "k". According to the video you referred, the correct line should be
gcl = feedback(Gunc*K,eye(4)); % where K is the optimal gain matrix not the uncertain parameter k
You can access the full live script shown in the video tutorial here. Please refer to the "Design an LQR controller" section of this script to find the definition of "K".
Hope this resolves the issue.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robust Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!