필터 지우기
필터 지우기

scripting i/o points for opoen loop analysis

조회 수: 5 (최근 30일)
noa
noa 2016년 1월 27일
편집: Siddharth Jawahar 2020년 10월 27일
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
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
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 CenterFile Exchange에서 Linearization Basics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by