%% Routine for Life-Stress Relationship Plotting Example
% Coded by Reuel Smith 2015-2017
% v. MATLAB R2015b through 2017a
% ========================================================================
% Example Problem 4.7
% Consider an accelerated test where temperature is the accelerating
% variable and 20 units were tested to failure assuming complete failures
% (no censoring).  Eight units were tested at 406 K, and six units each at
% 436 K and 466 K, with times to failure tabulated below.  Assuming an
% Arrhenius-Weibull life-stress relationship, find the parameters of the
% model, using both the plotting method and MLE method and compare the
% results.  Find the expected life at the use level temperature of 353 ?K
% and compare the results.
% Temperature        Time to Failure (hrs)
% ===========   =====================================
% 406 K	        248	456	528	731	813	965	972	1528
% 436 K	        164	176	289	319	386	459		
% 466 K	        92	105	155	184	219	235		
%
% Solution:
% This routine computes the expected life at use level temperature 353 ?K
% and plots the relationship plot.  The assumed Life-Stress relationship
% for this problem is the Arrhenius model L(t) = b*exp(a/T) or ln(L(t)) =
% ln(b) + a*(1/T) Eqn(4.40) where T-temperature, a-slope, and ln(b) is the
% intercept.  The Life-stress relationship plot may take additional models
% in place of Arrhenius (see textbook).
% ========================================================================
clc
clear
% ========================================================================
% Known alpha (life) values at 406, 436, and 466 degrees K.  These are
% evaluated by the Weibull_Plotting_Multiple_Data_Example_Problem_4_7.m
% MATLAB script.
alpha_1 = [898.698471763768];
alpha_2 = [341.942889990736];
alpha_3 = [187.571102122010];

% 1/Temperature
Tempaxis = [1/406 1/436 1/466];

% Life axis (hours)
Lifeaxis = [alpha_1 alpha_2 alpha_3];

% Fit the X and Y vectors to a linear equation (gets m and b)
p4 = polyfit(Tempaxis,Lifeaxis,1);

% Extrapolate best fit relation line for Life and Stress
x1 = linspace(min(Tempaxis),1/300,1000);
y1 = polyval(p4,x1);

% Value of life at use condition 353 degrees K
Uselife = polyval(p4,1/353);

% CHANGE THE 1/TEMP VALUES TO THE STRESS CONDITION OF YOUR CHOICE
figure(1)
plot(1/406,alpha_1,'b*',1/436,alpha_2,'rs',1/466,alpha_3,'gp',x1,y1,'k--',1/353,Uselife,'k^')
xlabel('1/Temp (K^-^1)')
ylabel('Characteristic Life (hours)')
legend('Stress Level 1 - 406 deg K','Stress Level 2 - 436 deg K','Stress Level 3 - 466 deg K','Best Fit Line','Characteristic Use life at 353 deg K','Location','Northwest')
grid on
set(gcf,'color','w');

Top