Home > wafo > damage > damint.m

# damint

## PURPOSE

Calculates damage intensity from counting distribution.

## SYNOPSIS

damM=damint(parm,beta,M)

## DESCRIPTION

```  DAMINT Calculates damage intensity from counting distribution.

CALL: D = damint(param,beta,M);

D     = an one column matrix with damages,
param = the parameter matrix,
beta  = an one column matrix with beta-values,
M     = the  nxn  matrix to be integrated.

Model:
b_i
f(u,v) = (u-v)   ,  u > v.

Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund.```

## CROSS-REFERENCE INFORMATION

This function calls:
 meshgrid X and Y arrays for 3-D plots. tril Extract lower triangular part. triu Extract upper triangular part.
This function is called by:

## SOURCE CODE

```001 function damM=damint(parm,beta,M)
002 % DAMINT Calculates damage intensity from counting distribution.
003 %
004 %  CALL: D = damint(param,beta,M);
005 %
006 %
007 %        D     = an one column matrix with damages,
008 %        param = the parameter matrix,
009 %        beta  = an one column matrix with beta-values,
010 %        M     = the  nxn  matrix to be integrated.
011 %
012 % Model:
013 %                  b_i
014 %     f(u,v) = (u-v)   ,  u > v.
015 %
016 %
017 %
018 %  Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund.
019
020 u2=parm(2); u1=parm(1); c=(parm(3)-1)/2; delta=(u2-u1)/c/2;
021 [v,u]=meshgrid(u1:delta:u2,u1:delta:u2);
022
023 N=max(size(beta)); damM=zeros(1,length(beta));
024 z=u-v;
025
026 invbar=fliplr(triu(fliplr(z),1))+fliplr(tril(fliplr(ones(size(z))),-1));
027 n=max(size(invbar)); z=invbar;
028
029 for a=1:N,
030   tempsumma=0; f=invbar.^beta(a);
031   tempsumma=tempsumma+f(1,1)*M(1,1);
032   for i=2:n-2, tempsumma=tempsumma+M(1,i)*(f(1,i)-f(1,i-1)); end
033   tempsumma=tempsumma-M(1,n-1)*f(1,n-2);
034   for j=2:n-2, tempsumma=tempsumma+M(j,1)*(f(j,1)-f(j-1,1)); end
035   tempsumma=tempsumma-M(n-1,1)*f(n-2,1);
036   for i=2:n-1, tempsumma=tempsumma+M(i,n-i+1)*f(i-1,n-i); end
037   for i=2:n-2, tempsumma=tempsumma-M(i,n-i)*f(i,n-i); end
038   z=invbar;
039   z=beta(a)*(beta(a)-1)*z.^(beta(a)-2);
040   z=fliplr(triu(fliplr(z),1));
041   N=fliplr(triu(fliplr(M(2:n-2,2:n-2))));
042   damM(a)=tempsumma+sum(sum(N.*z(2:n-2,2:n-2)))*delta^2;
043 end
044
045```

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