Home > wafo > damage > cc2dam.m

# cc2dam

## PURPOSE

Calculates the total Palmgren-Miner damage of a cycle count.

## SYNOPSIS

D=cc2dam(cc,beta,K)

## DESCRIPTION

```  CC2DAM   Calculates the total Palmgren-Miner damage of a cycle count.

CALL: D = cc2dam(cc,beta,K);

D    = Damage.                                            [1xm]

cc   = Cycle count with minima in column 1 and            [nx2]
maxima in column 2.
beta = Beta-values, material parameter.                    [1xm]
K    = K-value, material parameter. (Optional, Default: 1) [1x1]

The damage is calculated according to
D(i) = sum ( K * S^beta(i) ),  with  S = (max-min)/2

Example:
bv = 3:8;
D = cc2dam(RFC,bv); plot(bv,D,'x-')

## CROSS-REFERENCE INFORMATION

This function calls:
 error Display message and abort function.
This function is called by:
 Chapter4 % CHAPTER4 contains the commands used in Chapter 4 of the tutorial itmkurs_lab1 Script to computer exercises 1 itmkurs_lab2 Script to computer exercises 2 itmkurs_lab3 Script to computer exercises 3 itmkurs_lab4 Script to computer exercises 4

## SOURCE CODE

```001 function D=cc2dam(cc,beta,K)
002 % CC2DAM   Calculates the total Palmgren-Miner damage of a cycle count.
003 %
004 % CALL: D = cc2dam(cc,beta,K);
005 %
006 %   D    = Damage.                                            [1xm]
007 %
008 %   cc   = Cycle count with minima in column 1 and            [nx2]
009 %          maxima in column 2.
010 %   beta = Beta-values, material parameter.                    [1xm]
011 %   K    = K-value, material parameter. (Optional, Default: 1) [1x1]
012 %
013 % The damage is calculated according to
014 %   D(i) = sum ( K * S^beta(i) ),  with  S = (max-min)/2
015 %
016 % Example:
017 %   x = load('sea.dat'); TP=dat2tp(x); RFC=tp2rfc(TP);
018 %   bv = 3:8;
019 %   D = cc2dam(RFC,bv); plot(bv,D,'x-')
020 %
022
023 % Tested on Matlab 6.0
024 %
025 % History:
026 % Revised by PJ  01-Nov-1999
027 % - updated for WAFO
028 % Created by PJ (Pär Johannesson) 1997
029 %   from 'Toolbox: Rainflow Cycles for Switching Processes V.1.0'
030
031
032 % Check input and otput
033
034 ni = nargin;
035 no = nargout;
036 error(nargchk(2,3,ni));
037
038 if ni < 3
039   K=[];
040 end
041
042 % Set default values
043
044 if isempty(K)
045   K = 1;
046 end
047
048 % Calculate damage
049
050 amp = abs(cc(:,2)-cc(:,1))/2;
051
052 n=length(beta); D=zeros(1,n);
053 for i=1:n
054   D(i)=K*sum(amp.^beta(i));
055 end
056
057```

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