冲击响应谱计算的matlab程序_第1页
冲击响应谱计算的matlab程序_第2页
冲击响应谱计算的matlab程序_第3页
冲击响应谱计算的matlab程序_第4页
冲击响应谱计算的matlab程序_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

disp ()disp (SRS.Mn ver 2.0 July 3,2006 )disp (bytomirvineemail : Tom Irvine AOL.com)disp ()disp (thisprogramcalculatethesshockresponsespectrum )disp (ofanaccelerationtimehistory,which is pre-loaded into Matlab.)disp (thetimehistorymushavetotwocolumns :时间(sec )加速)disp ()%clear t;clear y;clear yy;clear n;clear fn;clear a1;clear a2clear b1;clear b2;clear jnum;clear THM;clear resp;clear x_pos;clear x_neg;%iunit=input (enteraccelerationunit :1=G2=m/sec 2)%disp ()选择文件输入方法(disp )disp (1=外部ascii文件)disp(2=file preloaded into Matlab )file_choice=input ();%if(file_choice=1)文件名,参数=ui getfile (*.* );filename=fullfile(pathname,filename )%FID=fopen (文件名,r )THM=fscanf(fid,%g %g,2 inf )THM=THM;elsethm=input (enterthematrixname : )结束%t=双精度(thm (:1 );y=双精度(thm (:2 );%tmx=max(t )tmi=min(t )n=length(y )%out1=sprintf(n %d samples n,n );disp(out1)%dt=(tmx-tmi)/(n-1 )sr=1./dt;%out1=sprintf (sr=% gsamples/se CDT=% gsecn,Sr,dt )disp(out1)%fn (1)=input (enterthestartingfrequency (Hz ) )if fn(1)sr/30。fn(1)=sr/30 .结束%IDM amp=输入(企业级格式:1=映射速率2=q )%disp ()if(idamp=1)damp=输入(enterdampingratio (typically0. 05 ) )elseq=input (entertheamplifictionfactor (typical QQ=10 ) )damp=1./(2.*Q )结束%disp ()选择对象: (disp )disp(1=凯莉- richman2=小型wood )ialgorithm=input ();%tmax=(tmx-tmi) 1./fn(1)limit=round(tmax/dt )n=limit;yy=zeros(1,limit )for I=1:长度(y )yy(i)=y(i )结束%disp ()计算响应(disp ) .% SRS引擎%for j=1:1000%omega=2.*pi*fn(j )omegad=omega*sqrt(1.-(damp2);cosd=cos(omegad*dt )sind=sin(omegad*dt )domegadt=damp*omega*dt;%if(ialgorithm=1)a1(j)=2.*exp(-domegadt)*cosd;a2 (j )=-exp (-2.*文档)b1(j)=2.*domegadt;b2(j)=omega*dt*exp(-domegadt )B2 (j )=B2 (j ) * (omega/omegad ) * (1.-2.* (damp 2) ) * sind-2.* damp * cosd;b3(j)=0;%elseE=exp(-damp*omega*dt )K=omegad*dt;C=E*cos(K )S=E*sin(K )Sp=S/K;%a1(j)=2*C;a2(j)=-E2;b1(j)=1.-Sp;b2(j)=2.*(Sp-C )b3(j)=E2-Sp;结束forward= b1(j ),b2(j ),b3(j) ;back= 1,-a1(j )、-a2(j) ;%resp=filter (向前,后退,yy )%x_pos(j)=max(resp )x_neg(j)=min(resp )%jnum=j;if fn(j) sr/8 .break结束fn(j 1)=fn(1)*(2. (j*(1./12.);结束% Output options%disp ()disp (选择输出选项)choice=input (1=plot only2=plotoutputtextfile )disp ()%if choice=2%writefname,writepname=uiputfile(*,Save SRS data as )writepfname=fullfile (写入名称,写入名称)write data= fnx _ pos (ABS (x _ neg ) ) :fid=fopen(writepfname,w )fprintf(fid,%g %g %gn,写数据);fclose(fid )% disp (输入输出文件名)% SRS_filename=input (,)% fid=fopen(SRS_filename,w )% for j=1:jnum% fprintf(fid,%7.2f .3f .3f n,fn(j ),x_pos(j ),abs(x_neg(j ) )% end% fclose(fid )结束% Plot SRS%disp ()打印输出(disp ) .% Find limits for plot%srs_max=max(x_pos )if max(abs(x_neg) ) srs_maxsrs_max=max(abs(x_neg ) )结束srs_min=min(x_pos )if min(abs(x_neg) ) srs_minsrs_min=min(abs(x_neg ) )结束%figure(1)plot(fn,x_pos,fn,abs(x_neg ),- ) :%if iunit=1ylabel(Peak Accel (G ) );elseylabel (峰值访问(m/sec 2) )结束xlabel(Natural Frequency (Hz ) )Q=1./(2.*damp )out5=sprintf (acceleratshockresponsespectrumq=% g,q )title(out5)grid;set(gca,MinorGridLineStyle,none,GridLineStyle,XScale,log,YScale,log )legend (positive、negative、2 )%ymax=10 (round (log 10 (SRS _ max ) 0.8 ) )ymin=10 (round (log 10 (SRS _ min )-0.6 ) )%fmax=max(fn )fmin=fmax/10 .%fmax=10(round(log10(fmax) 0.5 ) )%if fn(1)=0.1fmin=0.1;结束if fn(1)=1fmin=1;结束if fn(1)=10fmin=10;结束if fn(1)=100fmin=100;结束axis(fmin,fmax,ymin,ymax )%disp ()disp(Plot pseudo velocity )? ;vchoice=input (1=是2=否)if(vchoice=1)figure(2)% Convert to pseudo velocity%for j=1:jnumif iunit=1x _ pos (j )=386.* x _ pos (j )/(2. * pi * fn (j ) )x _ neg (j )=386.* x _ neg (j )/(2. * pi * fn (j ) )elsex_pos(j)=x_pos(j)/(2.*pi*fn(j ) )x_neg(j)=x_neg(j)/(2.*pi*fn(j ) )结束结束%srs_max=max(x_pos )if max(abs(x_neg) ) srs_maxsrs_max=max(abs(x_neg ) )结束srs_min=min(x_pos )if min(abs(x_neg) ) srs_minsrs_min=min(abs(x_neg ) )结束%plot(fn,x_pos,fn,abs(x_neg ),- ) :%if iunit=1ylabel(Velocity (in/sec ) )elseylabel(Velocity (m/sec ) )结束xlabel(Natural Frequency (Hz ) )Q=1./(2.*damp )out5=sprintf (pseudovelocityshockresponsespectrumq=% g,q )title(out5)grid;set(gca

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论