




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、精選優質文檔-傾情為你奉上disp(' ')disp(' ver 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 h
2、ave 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(' Sel
3、ect 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 = fsc
4、anf(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 d
5、t = %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 ');else Q=input(
6、39; 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(
7、y) yy(i)=y(i);end %disp(' ')disp(' Calculating response. ')% SRS engine%for j=1:1000% omega=2.*pi*fn(j); omegad=omega*sqrt(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.*dome
8、gadt; b2(j)=omega*dt*exp(-domegadt); b2(j)=b2(j)*( (omega/omegad)*.*(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)=;b2(j)=2.*(Sp-C);b3(j)=E2-Sp; end forward= b1(j), b2(j), b3(j) ; back = 1, -a1(j), -a2(j) ; % re
9、sp=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('
10、9;)%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
11、(' Enter output filename ');% SRS_filename = input(' ','s');% fid = fopen(SRS_filename,'w');% for j=1:jnum% fprintf(fid,'% % % n',fn(j),x_pos(j),abs(x_neg(j);% end% fclose(fid);end% Plot SRS%disp(' ')disp(' Plotting output. ')% Find limits for
12、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) ) < srs_min srs_min = min( abs(x_neg );end %figure(1);plot(fn,x_pos,fn,abs(x_neg),'-.');%if iunit=1 ylabel('Peak Accel (G)');else ylabel('Peak Acce
13、l (m/sec2)');endxlabel('Natural Frequency (Hz)');Q=1./(2.*damp);out5 = sprintf(' Acceleration Shock Response Spectrum Q=%g ',Q);title(out5);grid;set(gca,'MinorGridLineStyle','none','GridLineStyle',':','XScale','log','YScale'
14、,'log');legend ('positive','negative',2);%ymax= 10(round(log10(srs_max)+);ymin= 10(round(log10(srs_min);%fmax=max(fn);fmin=fmax/10.;%fmax= 10(round(log10(fmax)+);%if fn(1) >= fmin=;endif fn(1) >= 1 fmin=1;endif fn(1) >= 10 fmin=10;endif fn(1) >= 100 fmin=100;endax
15、is(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
16、*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(gca,'MinorGridLineStyle'
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電子商務教研室課程改革計劃
- 公路建設水土保持保證體系及環境保護措施
- 教研組長教育創新心得體會
- 人教版三年級數學上冊翻轉課堂計劃
- 【真題】蘇科版八年級下學期3月月考數學試卷(含解析)江蘇省鎮江市寶堰中學2024-2025學年
- 教師職業素養與創新教學心得體會
- 高校教師教學效果評價范文
- 機械制造分包計劃和管理措施
- 中醫護理2025年度發展計劃
- 小學美術老師教學能力提升計劃
- 初中八年級英語閱讀理解及答案
- 2024年08月浙江廣發銀行杭州分行招考筆試歷年參考題庫附帶答案詳解
- 財務總監崗位面試題及答案(經典版)
- 變壓器知識點培訓課件
- 2024年無人駕駛環衛行業研究報告
- DB21T 3358-2020 電梯再生制動系統要求及試驗方法
- 醫療器械生產質量管理規范培訓試題及答案
- ISO45001管理體系培訓課件
- 對賬單標準格式模板
- 初中教研員面試題目
- 2024年快遞員職業技能大賽考試題庫(含答案)
評論
0/150
提交評論