📄 clvtrsp.m
字号:
function out = clvtrsp(arg1,arg2,arg3,arg4)% trspall = clvtrsp(vf16,vctrl,vinp) % calculates closed-loop LPV step responses for the F-16 VISTA% trspall = clvtrsp(vf16,vctrl,t) % calculates time responses to unit-size VARYING command inputs% clvtrsp(trspall)% plots already-calculated time responses% clvtrsp(trspall)% plots already-calculated step responses% % trspall VARYING closed-loop trsps, by grid point ([u udot alf q])% vf16 VARYING LPV physical plant only % vctrl VARYING LPV controllers from vlpvsyn.m (open-loop if vctrl = 0)% vinp VARYING command signal (default = step)% t CONSTANT time vector for step responseif nargout > 0 [mtyp,dum1,dum2,dum3] = minfo(arg3); if mtyp == 'vary' tiv = getiv(arg3); vinp = arg3; elseif mtyp == 'cons' tiv = arg3; vinp = vpck(ones(length(tiv),1),tiv); end int = min(diff(tiv)); tfinal = max(tiv); vf16 = arg1; [mtyp,ny,nu,dum] = minfo(xtracti(vf16,1,1)); viv = getiv(vf16); npts = max(viv); vctrl = arg2; if vctrl == 0 vctrl = vpck([ones(npts,1) zeros(npts,1)],viv); end act = mmult(nd2sys(1,[1/20.2 1]),nd2sys(71.4^2,[1 2*.736*71.4 71.4^2]),... nd2sys(1,[1/144.8 1])); act = nd2sys(1,[1/19.5 1]);% [a,b,c,d] = unpck(act);% act = pck(a,b,[c;c*a],[d;c*b]); Act = []; for k = 1:nu Act = daug(Act,act); end trspall = []; ii = 0; for jj = 1:npts if ~all(viv-jj) ii = ii + 1; F16 = xtracti(vf16,ii,1); K = xtracti(vctrl,ii,1); umat = [eye(nu);eye(nu)];% umat = [eye(2*nu); eye(nu) zeros(nu)]; simsys = starp(mmult(umat,Act,K),mmult([eye(ny);eye(ny)],F16),nu,ny); trspsys = trsp(simsys,vinp,tfinal,int); else trspsys = vpck(zeros((nu+ny)*length(tiv),1),tiv);% trspsys = vpck(zeros((2*nu+ny)*length(tiv),1),tiv); end trspall = sbs(trspall,trspsys); end out = trspall;else trspall = arg1; [mtyp,ndat,npts,dum2] = minfo(trspall); kinp = input('Enter data series number (ENTER if done): '); while ~isempty(kinp) if kinp > 0 & kinp <= ndat vplot(sel(trspall,kinp,':')) title(['Data series #' int2str(kinp)]); end kinp = input('Enter data series number (ENTER if done): '); endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -