Home > wafo > damage > sphdam.m

# sphdam

## PURPOSE

Calculates spherical damage for a 3-D load.

## SYNOPSIS

out=sphdam(L,n,beta)

## DESCRIPTION

``` SPHDAM Calculates spherical damage for a 3-D load.

Calculates the damage on the unit sphere where the damage
is defined by

b_i
D_i(T) =  sum   (x-y)   ,  x>y,
t_j<=T      j

where  (x,y)_j  is the cycle count counted at time  t_j.

CALL: D = sphdam(L,n,b);

where

D = the damage,
L = three column load process,
n = the grid size on the unit sphere,
b = b_i```

## CROSS-REFERENCE INFORMATION

This function calls:
 sphdam Calculates spherical damage for a 3-D load.
This function is called by:
 sphdam Calculates spherical damage for a 3-D load.

## SOURCE CODE

```001 function out=sphdamsphdam(L,n,beta)
002 %SPHDAM Calculates spherical damage for a 3-D load.
003 %
004 %  Calculates the damage on the unit sphere where the damage
005 %  is defined by
006 %
007 %                              b_i
008 %         D_i(T) =  sum   (x-y)   ,  x>y,
009 %                  t_j<=T      j
010 %
011 %  where  (x,y)_j  is the cycle count counted at time  t_j.
012 %
013 %  CALL: D = sphdam(L,n,b);
014 %
015 %  where
016 %
017 %        D = the damage,
018 %        L = three column load process,
019 %        n = the grid size on the unit sphere,
020 %        b = b_i
021
022 data=[ n n beta];
023
024 [dimn,dimm]=size(L);
025 if dimn<dimm, L=L'; end
026 [dimn,dimm]=size(L);
027 if dimm~=3
028   disp('   Load not tri-axial. Program will terminate.')
029   break
030 end
031
032 disp('   Writing data.')
033 save sphdam.in data -ascii
034 save d3load.dat L -ascii
035
036 disp('   Starting Fortran executable.')
037 !sphdam.exe
038
039 if nargout==1