ITER Calculates a Markov matrix given a rainflow matrix CALL: [fmM_k frfc_k]=iter(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 See also iter_mc, spec2cmat, mctp2rfm, mc2rfm
Rainflow matrix given a Markov matrix of a Markov chain of turning points | |
Convert number to string. (Fast version) |
Script to computer exercises 3 |
001 function [F, rfc]=iter(f0,f,k,epsilon) 002 % ITER Calculates a Markov matrix given a rainflow matrix 003 % 004 % CALL: [fmM_k frfc_k]=iter(frfc,fmM_0,k,eps) 005 % 006 % fmM_k = the solution to the equation frfc = fmM + F(fmM), 007 % frfc_k = the rainflow matrix; frfc_k = fmM_k + F(fmM_k). 008 % 009 % 010 % frfc = the rainflow matrix to be inverted, 011 % fmM_0 = the first approximation to the Markov matrix, if not 012 % specified fmM_0=frfc, 013 % k = number of iterations, if not specified, k=1. 014 % eps = a convergence treshold, default value; eps=0.00001 015 % 016 % See also iter_mc, spec2cmat, mctp2rfm, mc2rfm 017 018 % References: 019 % Rychlik, I. (1996) 020 % 'Simulation of load sequences from Rainflow matrices: Markov method' 021 % Int. J. Fatigue, Vol 18, pp 429-438 022 % 023 024 % tested on matlab 5.2 025 % History: 026 % by ir 1995 027 028 029 030 if nargin < 2 031 f=f0; 032 end 033 if nargin <3 034 k=1; 035 end 036 if nargin <4 037 epsilon=0.00001; 038 end 039 check0=1; 040 041 f0=fliplr(f0); 042 f=fliplr(f); 043 for i=1:k 044 if check0 045 f1=f; 046 rfc=mctp2rfc(f); 047 f=f1+(f0-rfc); 048 f=max(0,f); 049 check=[k-i+1, sum(sum(abs(f1-f))), sum(sum(f0))/sum(sum(f))]; 050 disp(['iteration step, accuracy ', num2str(check(1:2))]) 051 check0=sum(sum(abs(f1-f)))>epsilon; 052 end 053 end 054 055 F=fliplr(f); 056 rfc=fliplr(mctp2rfc(f)); 057 058 059
Comments or corrections to the WAFO group