scripting i/o points for opoen loop analysis
1 次查看(过去 30 天)
显示 更早的评论
Hi, I want to do many linear analysis points in my system, so it is not practical using the Linear Analysis Tool. I am trying to script it but get an error when I try to plot a Nichols graph for some reason ("Error using tf (line 279) The values of the "num" and "den" properties must be row vectors or cell arrays of row vectors, where each vector is nonempty and containing numeric data. Type "help tf.num" or "help tf.den" for more information.") . Help Please!
%%set io points:
op = operpoint(bdroot); %opertain point
io = getlinio(bdroot); %get all I\O defined in the model
set(io, 'Active', 'off');
%%block name, relevant outport num, type
io(1) = linio('pitch/Pitch Control/pitch_est', 1, 'openoutput');
io(2) = linio('pitch/Pitch Control/pitch_c', 1, 'input');
io(3) = linio('pitch/Pitch Control/q', 1, 'openoutput');
io(4) = linio('pitch/Pitch Control/qc', 1, 'openinput');
io(5) = linio('pitch/Servo/de', 1, 'openoutput');
io(6) = linio('pitch/Servo/de_com', 1, 'openinput');
OL = [];
CL = [];
k = 1;
for j = 1 : length(io)/2
set(io,'Active','off'); %deactivate all I/O
set(io(k),'Active','on'); %opens the relevent I/O
set(io(k+1),'Active','on'); %opens the relevent I/O
[OL{j}, CL{j}] = create_OL_CL(bdroot, io, op, j, OL, CL);
k = k + 2;
end
r = j;
w_min = 0.01;
w_max = 40; %set the freq range
for i = 1:r
figure;
nichols(OL{i},{w_min w_max}); hold on; ngrid;
end
%%function [OL, CL] = create_OL_CL(bdroot, io, op, j ,OL, CL)
sys = linearize(bdroot,io,op);
OL{j}=sys;
CL{j}=feedback(OL{j},1);
end
2 个评论
Stefan Raab
2016-1-27
Hi noa,
have you checked the OL{i} which you pass to the nichols function? Could it be empty?
Siddharth Jawahar
2020-10-10
编辑:Siddharth Jawahar
2020-10-27
Hi Noa,
Hope you have figured this issue out. I would like to point out a feature called slLinearizer interface in Simulink Control Design that can help out in such workflows of batch linearization with multiple IO points.
HTH,
Sid
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linearization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!