📄 chap2_ex3_1.m
字号:
% Chapter 2, Example 3.1
close all
clc
clear all
m=40/32.2;
k=45;
c=4;
wn=sqrt(k/m);
zeta=c/(2*sqrt(k*m));
wd=sqrt(1-zeta*zeta)*wn;
%T=5/(zeta*wn);
T=3;
K=1/k;
F=12;
phi=atan(wd/(zeta*wn));
ti=linspace(0,T,400);
yi=K*F*(1-(wn/wd)*exp(-zeta*wn*ti).*sin(wd*ti+phi));
subplot(2,1,1)
plot(ti,yi)
ylabel('\itx\rm(\itt\rm), (ft)','FontSize',11)
title('Position Step Response','FontSize',11)
subplot(2,1,2)
x=wd*ti+phi;
% ydoti=K*(wn/wd)*exp(-zeta*wn*ti).*(zeta*wn*sin(x)-wd*cos(x));
ydoti=(K*wn^2/wd)*exp(-zeta*wn*ti).*(sin(wd*ti));
plot(ti,ydoti)
axis([0 T -0.05 0.1])
xlabel ('\itt \rm(sec)','FontSize',11)
ylabel('\itdx/dt \rm(ft/sec)','FontSize',11)
title('Velocity Response','FontSize',11)
hold on
L=0.04;
plot([0 T],[L L],':k',[0,T],[-L -L],':k')
text(1.25,0.0475,'0.04 ft/sec','FontSize',11)
text(1.25,-0.0315,'-0.04 ft/sec','FontSize',11)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -