vtb2_1.m

来自「振动工具箱」· M 代码 · 共 28 行

M
28
字号
function VTB2_1(m,k,x0,v0,wdr,F0,tf)%VTB2_1 Forced response of an undamped single degree of freedom system.% VTB2_1(m,k,x0,v0,wdr,F0,tf) plots the response of an undamped single% degree of freedom system to a sinusoidal input with amplitude F0 and% frequency wdr.  The argument tf is the total time of the simulation.% The initial displacement is x0 and initial velocity is v0.  The system% is described by mass m and stiffness k.% VTB2_1(w,x0,v0,wdr,f0,tf) plots the response of an undamped single% degree of freedom system to a sinusoidal input with amplitude F0 and % frequency wdr.  The argument tf is the total time of the simulation.% The natural frequency of the system, in rad/s, is w.% This loop determines which type of input format you are using.if nargin==6  tf=F0;f0=wdr;wdr=v0;v0=x0;x0=k;w=m;k=m^2;m=1;F0=f0;endt=0:.005*tf:tf;f0=F0/m;w=sqrt(k/m);x=v0/w*sin(w*t)+(x0-f0/(w^2-wdr^2))*cos(w*t)+f0/(w^2-wdr^2)*cos(wdr*t);%(2.11)aa=version;ll=length(aa);plot(t,x)grid onxlabel('Time')ylabel('Displacement')title('Displacement versus Time')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?