Home > wafo > trgauss > iter_mc.m

# iter_mc

## PURPOSE

Calculates a kernel of a MC given a rainflow matrix

## SYNOPSIS

[F, rfc]=iter_mc(f0,f,k,epsilon)

## DESCRIPTION

```  ITER_MC  Calculates a kernel of a MC given a rainflow matrix

Solves  f_rfc = f_xy + F_mc(f_xy) for f_xy.

Call: [fmM_k frfc_k]=iter_mc(frfc,fmM_0,k,eps)

fmM_k  = the solution to the equation frfc = fmM + F(fmM),
frfc_k = the rainflow matrix; frfc_k = fmM_k + F(fmM_k).

frfc   = the rainflow matrix to be inverted,
fmM_0  = the first approximation to the Markov matrix, if not
specified  fmM_0=frfc,
k      = number of iterations, if not specified, k=1.
eps    = a convergence treshold, default value; eps=0.00001

## CROSS-REFERENCE INFORMATION

This function calls:
 mc2rfc Calculates a rainflow matrix given a Markov chain with kernel f_xy;
This function is called by:

## SOURCE CODE

```001 function [F, rfc]=iter_mc(f0,f,k,epsilon)
002 % ITER_MC  Calculates a kernel of a MC given a rainflow matrix
003 %
004 %    Solves  f_rfc = f_xy + F_mc(f_xy) for f_xy.
005 %
006 %  Call: [fmM_k frfc_k]=iter_mc(frfc,fmM_0,k,eps)
007 %
008 %   fmM_k  = the solution to the equation frfc = fmM + F(fmM),
009 %   frfc_k = the rainflow matrix; frfc_k = fmM_k + F(fmM_k).
010 %
011 %
012 %   frfc   = the rainflow matrix to be inverted,
013 %   fmM_0  = the first approximation to the Markov matrix, if not
014 %            specified  fmM_0=frfc,
015 %   k      = number of iterations, if not specified, k=1.
016 %   eps    = a convergence treshold, default value; eps=0.00001
017 %
019
020 % References:
021 % Rychlik, I. (1996)
022 % 'Simulation of load sequences from Rainflow matrices: Markov method'
023 % Int. J. Fatigue, Vol 18, pp 429-438
024 %
025
026 % tested on matlab 5.2
027 % History:
028 % by ir 1995
029
030
031 if nargin < 2
032    f=f0;
033 end
034 if nargin <3
035    k=1;
036 end
037 if nargin <4
038    epsilon=0.00001;
039 end
040 check0=1;
041 f0=fliplr(f0);
042 f=fliplr(f);
043
044 for i=1:k
045   if check0
046    f1=f;
047    rfc=mc2rfc(f);
048    f=f1+(f0-rfc);
049    f=max(0,f);
050    check0=sum(sum(abs(f1-f)))>epsilon;
051    check=[k-i+1, sum(sum(abs(f1-f)))]
052  end
053 end
054
055 F=fliplr(f);
056 rfc=fliplr(mc2rfc(f));
057
058```

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