已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
.disp( )disp( srs.m ver 2.0 July 3, 2006)disp( by Tom Irvine Email: )disp( )disp( This program calculates the shock response spectrum)disp( of an acceleration time history, which is pre-loaded into Matlab.)disp( The time history must have two columns: time(sec) & acceleration)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( Enter acceleration unit: 1= G 2= m/sec2 );%disp( )disp( Select file input method );disp( 1=external ASCII file );disp( 2=file preloaded into Matlab );file_choice = input();%if(file_choice=1) filename, pathname = uigetfile(*.*); filename = fullfile(pathname, filename);% fid = fopen(filename,r); THM = fscanf(fid,%g %g,2 inf); THM=THM;else THM = input( Enter the matrix name: );end%t=double(THM(:,1);y=double(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 = %g samples/sec dt = %g sec n,sr,dt);disp(out1)%fn(1)=input( Enter the starting frequency (Hz) );if fn(1)sr/30. fn(1)=sr/30.;end%idamp=input( Enter damping format: 1= damping ratio 2= Q );%disp( )if(idamp=1) damp=input( Enter damping ratio (typically 0.05) );else Q=input( Enter the amplification factor (typically Q=10) ); damp=1./(2.*Q);end%disp( )disp( Select algorithm: )disp( 1=Kelly-Richman 2=Smallwood );ialgorithm=input( );%tmax=(tmx-tmi) + 1./fn(1);limit = round( tmax/dt );n=limit;yy=zeros(1,limit);for i=1:length(y) yy(i)=y(i);end %disp( )disp( Calculating response. )% SRS engine%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.*domegadt); b1(j)=2.*domegadt; b2(j)=omega*dt*exp(-domegadt); b2(j)=b2(j)*( (omega/omegad)*(1.-2.*(damp2)*sind -2.*damp*cosd ); b3(j)=0;% else E=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; end forward= b1(j), b2(j), b3(j) ; back = 1, -a1(j), -a2(j) ; % resp=filter(forward,back,yy);% x_pos(j)= max(resp); x_neg(j)= min(resp);% jnum=j; if fn(j) sr/8. break end fn(j+1)=fn(1)*(2. (j*(1./12.); end% Output options%disp( )disp( Select output option );choice=input( 1=plot only 2=plot & output text file );disp( )%if choice = 2 % writefname, writepname = uiputfile(*,Save SRS data as); writepfname = fullfile(writepname, writefname); writedata = fn x_pos (abs(x_neg) ; fid = fopen(writepfname,w); fprintf(fid, %g %g %gn,writedata); fclose(fid);% disp( Enter output filename );% SRS_filename = input( ,s);% fid = fopen(SRS_filename,w);% for j=1:jnum% fprintf(fid,%7.2f %10.3f %10.3f n,fn(j),x_pos(j),abs(x_neg(j);% end% fclose(fid);end% Plot SRS%disp( )disp( Plotting output. )% Find limits for plot%srs_max = max(x_pos);if max( abs(x_neg) ) srs_max srs_max = max( abs(x_neg );endsrs_min = min(x_pos);if min( abs(x_neg) ) = 0.1 fmin=0.1;endif fn(1) = 1 fmin=1;endif fn(1) = 10 fmin=10;endif fn(1) = 100 fmin=100;endaxis(fmin,fmax,ymin,ymax);%disp( )disp( Plot pseudo velocity? );vchoice=input( 1=yes 2=no );if(vchoice=1)figure(2);% Convert to pseudo velocity%for j=1:jnum if iunit=1 x_pos(j)=386.*x_pos(j)/(2.*pi*fn(j); x_neg(j)=386.*x_neg(j)/(2.*pi*fn(j); else x_pos(j)=x_pos(j)/(2.*pi*fn(j); x_neg(j)=x_neg(j)/(2.*pi*fn(j); endend %srs_max = max(x_pos);if max( abs(x_neg) ) srs_max srs_max = max( abs(x_neg );endsrs_min = min(x_pos);if min( abs(x_neg) ) srs_min srs_min = min( abs(x_neg );end %plot(fn,x_pos,fn,abs(x_neg),-.);%if iunit=1 ylabel(Velocity (in/sec);else ylabel(Velocity (m/sec); endxlabel(Natural Frequency (Hz);Q=1./(2.*damp);out5 = sprintf( Pseudo Velocity Shock Response Spectrum Q=%g ,Q);title(out5);grid;set(gc
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 园林景观合同工程质量(3篇)
- 业法律法规与综合能力押题密卷(附答案及解析)
- 2025年无人机监测服务平台项目可行性研究报告及总结分析
- 2025年新型人力资源管理系统可行性研究报告及总结分析
- 高压线路带电检修工考试题含答案
- 2025年生态旅游项目设计与可行性研究报告及总结分析
- 2025年 四川省平昌县职业中学招聘考试笔试试题附答案
- 2025年农业行业智慧农业技术在农业生产中的应用效果评估与数据分析案例研究报告及未来发展趋势
- 2025年春季方剂学经典名方解析及运用试卷
- 2025年灵活畜禽养殖场地租赁合同
- 【MOOC】国际贸易实务-上海对外经贸大学 中国大学慕课MOOC答案
- 2023年疾控中心检验科新上岗人员上岗考试试题
- 中小学学习《民法典》主题班会图文ppt
- QC080000有害物质管理体系培训教材课件
- 浙江省城市环境卫生劳动定额
- 人教版音乐八年纪下册《京剧《铡美案》选段》课件
- 体检质量评价表
- 一年级家访记录表(常用)
- -内镜洗消质量的持续改进课件
- 解除(终止)劳动合同证明书-社保局版本
- 内部审计主要工作(《内部审计》)课件
评论
0/150
提交评论