📄 wpl_pend.m
字号:
% Simulation of the closed-loop system with the worst case
% perturbation
%
sim_pend
clp = starp(delta,starp(pend_sm,K,6,2));
%
% response to the reference input
timedata = 0;
ti = 0.01;
tf = 20;
stepdata2 = -0.1;
stepdata3 = 0.2;
ref1 = 0;
ref2 = step_tr(timedata,stepdata2,ti,tf);
ref3 = step_tr(timedata,stepdata3,ti,tf);
ref = abv(ref1,ref2,ref3);
dist = abv(0,0,0);
noise = abv(0,0,0);
y = trsp(clp,abv(ref,dist,noise),tf,ti);
figure(1)
vplot(sel(y,1,1),'c--',sel(y,2,1),'g-.',sel(y,3,1),'r-')
title('CLOSED-LOOP TRANSIENT RESPONSE')
xlabel('Time (secs)')
ylabel('y1, y2, y3 (rad)')
legend('y1','y2','y3')
figure(2)
vplot(sel(y,4,1),'r-',sel(y,5,1),'c--')
title('CLOSED-LOOP CONTROL')
xlabel('Time (secs)')
ylabel('u1, u2 (V)')
legend('u1','u2')
%
% response to the disturbance
ref = abv(0,0,0);
dist1 = 0.1;
dist2 = 0.1;
dist3 = 0.1;
dist = abv(dist1,dist2,dist3);
noise = abv(0,0,0);
y = trsp(clp,abv(ref,dist,noise),tf,ti);
figure(3)
vplot(sel(y,1,1),'c--',sel(y,2,1),'g-.',sel(y,3,1),'r-')
title('CLOSED-LOOP DISTURBANCE RESPONSE')
xlabel('Time (secs)')
ylabel('y1, y2, y3 (rad)')
legend('y1','y2','y3')
figure(4)
vplot(sel(y,4,1),'r-',sel(y,5,1),'c--')
title('CLOSED-LOOP CONTROL')
xlabel('Time (secs)')
ylabel('u1, u2 (V)')
legend('u1','u2')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -