matlab 去振动,MATLAB第7章振动程序.ppt

1 第七章 动力学与振动 7.1 轨迹 7.2 单自由度系统 7.3 多自由度系统 由初始条件建立执行文件menu71.m initcond=[2 0 0 1.5;1 0 0 2*pi;2 0 0 4]; tspan=linspace(0,5,1000); options=odeset('RelTol',1e-6,'AbsTol',[1e-6 1e-6 1e-6 1e-6]); lintype=['-.' '-.' '-.']; for i=1:3 [t,x]=ode45('orbit',tspan,[initcond(i,:)],options); polar(x(:,3),x(:,1),lintype(2*(i-1)+1:2*i)); hold on end text(0.5,-1.2,'椭圆轨迹'); text(-1.2,1,'圆轨迹'); text(1.75,2,'双曲线轨迹'); 运行结果 由初始条件(位移和速度均为1时)建立执行文件menu72.m zeta=[0.1 1.0 5.0]; tspan=linspace(0,40,400); lintype=['-b' '--r' '---r']; for i=1:3 [t,x]=ode45('FreeOcillation',tspan,[1 1],[],zeta(i)); subplot(2,1,1); plot(t,x(:,1),lintype(2*(i-1)+1:2*i)); hold on subplot(2,1,2); plot(x(:,1),x(:,2),lintype(2*(i-1)+1:2*i)); hold on end subplot(2,1,1); xlabel('Time( \tau)'); ylabel('Displacement x( \tau)'); title('Displacement as a function of( \tau)'); axis([0 40 -2.0 2.0]); text(2.7,-1.3,'阻尼系数=0.1'); text(3.6,-0.1,'1.0'); text(3.6,1.0,'5.0'); subplot(2,1,2); xlabel('Displacement'); ylabel('Velocity'); title('Phase portrait'); axis([-2.0 2.0 -2.0 2.0]); text(0.7,-1.25,'阻尼系数=0.1'); text(0.8,-0.65,'1.0'); text(0.8,0.1,'5.0'); 运行结果 t = 0:0.001:0.6; x = sin(2*pi*50*t)+sin(2*pi*120*t); y = x + 2*randn(size(t)); plot(y(1:50)) title('Signal Corrupted with Zero-Mean Random Noise') xlabel('time (seconds)') 编制执行文件menu72f.m zeta=0.4;Omega=3.0;x0=50; tspan=linspace(0,30,6000); options=odeset('RelTol',1e-8,'AbsTol',1e-8); lintype=['-b']; [t,x]=ode45('ForceOcillation',tspan,[0 0],options,zeta,Omega,x0); subplot(2,1,1); plot(t,x(:,1)); axis([0 30 -8 8]); hold on subplot(2,1,2); yy=x(:,1); N=2048;Nstart=3200;Fs=200; [f,Amplitude]=AmplitudeSpectrum(yy,Fs,Nstart,N); semilogy(f(1:40),2*Amplitude(1:40)); xlabel('Frequency'); ylabel('Amplitude'); title('Response spectrum of a linear system'); hold on subplot(2,1,1); xlabel('Time( \tau)'); ylabel('Displacement x( \tau)'); title('Response of a linear system'); hold on 运行结果 频率响应 阶跃响应 脉冲响应 Bod

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值