📄 chap2_fig3_1.m
字号:
% Chap2_Fig3_1.m
close all
clc
clear all
K=1;
wn=10;
% Overdamped Case
subplot(2,2,1)
hold on
rho=[1.5 2 3];
for n=1:3
s1=(-rho(n)-sqrt(rho(n)*rho(n)-1))*wn;
s2=(-rho(n)+sqrt((rho(n)*rho(n))-1))*wn;
tau1=-1/s1;
tau2=-1/s2;
ti=linspace(0,20/wn,250);
wnti=wn*ti;
A=tau2*exp(-ti/tau2);
B=tau1*exp(-ti/tau1);
yi=1+((A-B)/(tau1-tau2));
plot(wnti,yi)
axis([0 20 0 1.1])
end % n
ylabel('Step Response','FontSize',11)
title('Overdamped, \zeta=1.5,2,3','FontSize',11)
text(8,0.45,'Increasing \zeta','FontSize',11)
% Underdamped Case
subplot(2,2,2)
hold on
for n=1:2:9
rho=n/10;
wd=sqrt(1-rho*rho)*wn;
theta=atan(wd/(rho*wn));
yi=1-(wn/wd)*exp(-rho*wn*ti).*sin(wd*ti+theta);
plot(wnti,yi)
end % n
ylabel('Step Response','FontSize',11)
title(' Underdamped, \zeta=0.1,0.3,..,0.9','FontSize',11)
text(5,0.25,'Decreasing \zeta','FontSize',11)
% Critically Damped Case
subplot(2,2,3)
yi=1-exp(-wn*ti).*(wn*ti+1);
plot(wnti,yi)
axis([0 20 0 1.1])
xlabel('\omega_{\itn}t','FontSize',11)
ylabel('Step Response','FontSize',11)
title('Critically Damped, \zeta=1','FontSize',11)
%Zero Damping Case
subplot(2,2,4)
yi=1-cos(wn*ti);
plot(wnti,yi)
axis([0 20 -0.1 2.1])
xlabel('\omega_{\itn}t','FontSize',11)
ylabel('Step Response','FontSize',11)
title('Zero Damping, \zeta=0','FontSize',11)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -