雨流计数法matlab程度源代码(共3页)_第1页
雨流计数法matlab程度源代码(共3页)_第2页
雨流计数法matlab程度源代码(共3页)_第3页
全文预览已结束

下载本文档

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

文档简介

1、精选优质文档-倾情为你奉上% RAINFLOW cycle counting.% RAINFLOW counting function allows you to extract % cycle from random loading.% SYNTAX% rf = RAINFLOW(ext)% rf = RAINFLOW(ext, dt)% rf = RAINFLOW(ext, extt)% OUTPUT% rf - rainflow cycles: matrix 3xn or 5xn dependend on input,% rf(1,:) Cycles amplitude,% rf(2,:

2、) Cycles mean value,% rf(3,:) Number of cycles (0.5 or 1.0),% rf(4,:) Begining time (when input includes dt or extt data),% rf(5,:) Cycle period (when input includes dt or extt data),% INPUT% ext - signal points, vector nx1, ONLY TURNING POINTS!,% dt - sampling time, positive number, when the turnin

3、g points% spaced equally,% extt - signal time, vector nx1, exact time of occurrence of turning points.% See also SIG2EXT, RFHIST, RFMATRIX, RFPDF3D.% RAINFLOW% Copyright (c) 1999-2002 by Adam Nieslony,% MEX function.function rfdemo1(ext)% function rfdemo1(ext)% RFDEMO1 shows cycles extracted from si

4、gnal% using rainflow algoritm.% % INPUT: ext - option, number or vectors with turning% points or time history. Default ext=16.% % OUTPUT: no enable.% % SYNTAX:% >>rfdemo1% >>rfdemo1(10)% >>rfdemo1(2 3 2 4 2 5 1 6)% By Adam Nies硂ny% Revised, 10-Nov-2009% Visit the MATLAB Central Fil

5、e Exchange for latest version.error(nargchk(0,2,nargin)if nargin=0, % turning points from 16 random numbers ext=sig2ext(randn(4);elseif length(ext(:)=1, % turning points from n random numbers ext=sig2ext(randn(1,ext);else % turning points from vector ext ext=sig2ext(ext);enda=rainflow(ext,1);m n=siz

6、e(a);% if n>100,% button = questdlg('Rainflow found ' num2str(sum(a(3,:) ' cycles! Do you want to continue?',.% 'Continue Operation','Yes','No','No');% if strcmp(button,'No')% error('Function aborted by user.') % end% endcol='ymc

7、rgb'plot(0:length(ext)-1,ext,'k.:')hold onwyk=0:0.05:1;for c=1:n, colnr=rem(c-1,6)+1; nr1=round(a(4,c)+1); nr2=round(a(4,c)+1+a(5,c)*a(3,c); if a(3,c)=1.0, if ext(nr1)<ext(nr1+1), plot(wyk.*a(5,c)+a(4,c),cos(pi+wyk.*2*pi)*a(1,c)+a(2,c),col(colnr) text(a(4,c),a(2,c)-a(1,c),int2str(c) &

8、#39;. Cycle, up',. 'Color',col(colnr),'VerticalAlignment','top') else plot(wyk.*a(5,c)+a(4,c),cos( wyk.*2*pi)*a(1,c)+a(2,c),col(colnr) text(a(4,c),a(2,c)+a(1,c),int2str(c) '. Cycle, down',. 'Color',col(colnr),'VerticalAlignment','bottom') e

9、nd else if ext(nr1)>ext(nr2), plot(wyk.*a(5,c)*0.5+a(4,c),cos( wyk.*pi)*a(1,c)+a(2,c),col(colnr) text(a(4,c),a(2,c)+a(1,c),int2str(c) '. Half-cycle, down',. 'Color',col(colnr),'VerticalAlignment','bottom') else plot(wyk.*a(5,c)*0.5+a(4,c),cos(pi+wyk.*pi)*a(1,c)+a(2

10、,c),col(colnr) text(a(4,c),a(2,c)-a(1,c),int2str(c) '. Half-cycle, up',. 'Color',col(colnr),'VerticalAlignment','top') end endendxlabel('peaks, counted from 0')ylabel('value')title('Rainflow cycles extracted from signal')legend('peaks from signal',0)hold offdisp('Row 1: amplitude')disp('Row 2: mean')disp('Row 3: num

温馨提示

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

评论

0/150

提交评论