Home > wafo > wdemos > democc.m

democc

PURPOSE ^

A program for visualization of cycle counts in random

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 DEMOCC A program for visualization of cycle counts in random 
    loads.  
  
    In Demonstration Window 1, the realisation is shown. 
    It is possible to mark the turning points (TP) and, for local maxima 
    chosen by the user, find rainflow cycles and min-max 
    cycles. In Demonstration Window 2, the cycle counts are 
    illustrated; peak-trough cycles to the left, rainflow cycles to 
    the right. 
    
    NB! A realisation of a random process called 'proc' must exist in 
    workspace.  
  
  Example: 
    x = load('sea.dat'); 
    proc=x(1:200,:); 
    democc

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 %DEMOCC A program for visualization of cycle counts in random 
002 %   loads.  
003 % 
004 %   In Demonstration Window 1, the realisation is shown. 
005 %   It is possible to mark the turning points (TP) and, for local maxima 
006 %   chosen by the user, find rainflow cycles and min-max 
007 %   cycles. In Demonstration Window 2, the cycle counts are 
008 %   illustrated; peak-trough cycles to the left, rainflow cycles to 
009 %   the right. 
010 %   
011 %   NB! A realisation of a random process called 'proc' must exist in 
012 %   workspace.  
013 % 
014 % Example: 
015 %   x = load('sea.dat'); 
016 %   proc=x(1:200,:); 
017 %   democc 
018  
019 % Tested on: matlab 5.3 
020 % History: 
021 % Original version by Mats Frendahl 
022 % Revised by PJ 10-Jan-2000 
023 %   updated for WAFO 
024 % Revised by JR 10-July-2000 
025 %   line 24-27. Matrix dimensions 
026 % Revised by PJ 13-Jun-2003 
027 %   Change figure positions 
028 % Updated by PJ 07-Jul-2005 
029 %   Added example 
030  
031 democc_demow2=figure('Name','The rainflow & peak-trough cycle count','NumberTitle','off','Position',[0 300 500 350]); 
032 democc_demow1=figure('Name','Demonstration Window 1','NumberTitle','off','Position',[0 0 1000 300]); 
033 clf;  
034 democc_time=1:length(proc);  
035 if min(size(proc))==2, % Size of simulated proc may be  
036   proc=proc(:,2);      % nx1, 1xn or nx2.  
037 end  
038 democc_y=[democc_time(:) proc(:)];          
039 democc_L=democc_y(:,2); democc_n=length(democc_L); clc, clf, subplot(1,1,1) 
040  
041 democc_ccrfc=[]; democc_ccmM=[]; democc_tp=dat2tp(democc_y);  
042  
043 set(gca,'box','on'), xlabel('time'), ylabel('load') 
044 democc_k=democc_markmax(democc_y,democc_tp,1,0); 
045 democc_F = uicontrol('style','push','units','normal','pos',[.92 .93 .03 .06], ... 
046         'string','+1','call','democc_k=democc_k+2; democc_k=democc_markmax(democc_y,democc_tp,democc_k,-2);'); 
047 democc_FF= uicontrol('style','push','units','normal','pos',[.96 .93 .03 .06], ... 
048         'string','+5','call','democc_k=democc_k+10; democc_k=democc_markmax(democc_y,democc_tp,democc_k,-10);'); 
049 democc_REW = uicontrol('style','push','units','normal','pos',[.92 .86 .03 .06], ... 
050         'string','-1','call','democc_k=democc_k-2; democc_k=democc_markmax(democc_y,democc_tp,democc_k,2);'); 
051 democc_REW = uicontrol('style','push','units','normal','pos',[.96 .86 .03 .06], ... 
052         'string','-5','call','democc_k=democc_k-10; democc_k=democc_markmax(democc_y,democc_tp,democc_k,10);'); 
053 democc_RFC = uicontrol('style','push','units','normal','pos',[.92 .79 .07 .06], ... 
054         'string','RFC','call','democc_ccrfc=democc_rfcdef(democc_y,democc_tp,democc_k,democc_ccrfc); democc_plotmat(democc_demow2,democc_ccrfc,democc_ccmM)'); 
055 democc_MM = uicontrol('style','push','units','normal','pos',[.92 .72 .07 .06], ... 
056         'string','mM','call','democc_ccmM=democc_mmdef(democc_y,democc_tp,democc_k,democc_ccmM); democc_plotmat(democc_demow2,democc_ccrfc,democc_ccmM)'); 
057 democc_TP = uicontrol('style','push','units','normal','pos',[.92 .65 .07 .06], ... 
058         'string','TP','call','democc_tpdef(democc_y)'); 
059 democc_TP = uicontrol('style','push','units','normal','pos',[.92 .58 .07 .06], ... 
060         'string','Redraw','call','democc_k=democc_markmax(democc_y,democc_tp,democc_k,0);'); 
061 democc_TP = uicontrol('style','push','units','normal','pos',[.92 .51 .07 .06], ... 
062         'string','END','call','delete(democc_demow1), delete(democc_demow2), clear democc_*'); 
063  
064  
065

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003