FTF Calculates the fatigue failure time distribution. F(t) = P[ T^f <= t ]. CALL: [t,F] = ftf(e,d,s2,s2D,number); where t = an one column matrix with times t, F = the distribution function F(t), e = epsilon, a constant, d = the damage intensity, s2 = the residual variance, s2D = the variance of the total damage, number = plot parameter (optionalinput argument); if equal to 1 the distribution function will be plotted. Example: RFC = tp2rfc(tp); [t,F] = ftf(5.5e-10,cc2dam(RFC,5)/T,0.06,0.5); See also cc2dam, dat2tp, tp2cc
Control axis scaling and appearance. | |
Difference and approximate derivative. | |
Error function. | |
Linear plot. | |
Graph title. | |
X-axis label. |
% CHAPTER4 contains the commands used in Chapter 4 of the tutorial | |
Script to computer exercises 1 |
001 function [time,F]=ftf(e,d,sigma2,sigma_D,number) 002 %FTF Calculates the fatigue failure time distribution. 003 % 004 % F(t) = P[ T^f <= t ]. 005 % 006 % CALL: [t,F] = ftf(e,d,s2,s2D,number); 007 % 008 % where 009 % 010 % t = an one column matrix with times t, 011 % F = the distribution function F(t), 012 % e = epsilon, a constant, 013 % d = the damage intensity, 014 % s2 = the residual variance, 015 % s2D = the variance of the total damage, 016 % number = plot parameter (optionalinput argument); 017 % if equal to 1 the distribution function will be plotted. 018 % 019 % Example: 020 % RFC = tp2rfc(tp); 021 % [t,F] = ftf(5.5e-10,cc2dam(RFC,5)/T,0.06,0.5); 022 % 023 % See also cc2dam, dat2tp, tp2cc 024 025 % Tested on: matlab 5.3 026 % History: 027 % Revised by PJ 10-Jan-2000 028 % updated for WAFO 029 % Original version from FAT by Mats Frendahl 030 % Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund. 031 032 timefailurecenter=1/d/e; number_of_t=99; 033 delta=timefailurecenter/number_of_t; 034 time=.5*timefailurecenter:delta:1.5*timefailurecenter; 035 F=.5+.5*erf(log(d*time.*e)/sqrt(sigma2)); 036 037 number_of_x=99; x=-4:8/number_of_x:4; phi_x=phi(x,0,1); 038 I=0; 039 for i=1:length(time) 040 t=log(d*e*time(i)+e*sigma_D*sqrt(time(i))*x)./sqrt(sigma2); 041 y=(.5+.5*erf(t/sqrt(2))).*phi_x; 042 I(i)=trapez(x,y); 043 end 044 045 if nargin==5 046 if number==1 047 plot(time,I) 048 axis([min(time) max(time) -0.1 1.1]) 049 title('P[ T^f <= t ]'),xlabel('t') 050 axis; 051 end 052 end 053 054 function p=phi(x,m,v,nr) 055 % Evalutes the phi-/Phi-function, density/distribution function 056 % for a Gaussian variable with mean m and variance v. 057 % 058 % CALL: f = phi(x,m,v,nr) 059 % 060 % where 061 % 062 % f = the density/distribution function, 063 % x = a vector of x-values, 064 % m = the mean, 065 % v = the variance, 066 % nr = plot parameter (optional input argument) 067 % 068 % 0 => f = density function, 069 % 1 => f = distribution function. 070 071 % Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund. 072 073 if nargin==3, nr=0; end 074 075 p=1/sqrt(2*pi*v)*exp(-0.5*(x-m).^2/v); 076 077 if (nargin==4) & (nr==1) 078 p=(1+erf((x-m)./sqrt(2*v)))./2; 079 end 080 081 function integral=trapez(x,y) 082 % Calculates an integral according to the trapezodial rule given two 083 % vectors, x and y, with x_k- and y_k-values. 084 % 085 % CALL: I = trapez(x,y) 086 % 087 % where 088 % 089 % x = a vector with x_k-values, 090 % y = a vector with y_k-values. 091 092 % Copyright 1993, Mats Frendahl, Dept. of Math. Stat., University of Lund. 093 094 integral=.5*(y(2:length(y))+y(1:length(y)-1))*diff(x)'; 095
Comments or corrections to the WAFO group