EES 502 RELIABILITY ENGINEERING
MATLAB LAB EXERCISE 2: Reliability Analysis and Failure Rate Modeling
1. Objective
To understand and apply reliability engineering concepts by modeling and analyzing
failure data using MATLAB. Students will:
- Compute and plot reliability functions (R(t)), failure probability (F(t)), and hazard rate
(λ(t))
- Compare different lifetime distributions (Exponential, Weibull, Lognormal)
- Estimate the Mean Time to Failure (MTTF) and interpret reliability performance.
2. Background Theory
Reliability, R(t), is the probability that a component or system performs its intended
function for a specified time t under stated conditions.
Reliability Function: R(t) = 1 - F(t)
Failure Distribution Function: F(t) = P(T ≤ t)
Probability Density Function (PDF): f(t) = dF(t)/dt
Hazard (Failure Rate) Function: λ(t) = f(t)/R(t)
Common Models:
1. Exponential Distribution: R(t) = e^(−λt)
2. Weibull Distribution: R(t) = e^(−(t/η)^β)
3. Lognormal Distribution: based on parameters μ and σ.
3. Equipment and Software
- MATLAB R2022a or later
- Statistics and Machine Learning Toolbox (optional)
4. Procedure
Step 1: Define Parameters
```matlab
% Reliability Engineering Lab
clear; clc; close all;
t = 0:0.1:100; % Time in hours
% Parameters
lambda = 0.02; % Exponential failure rate
eta = 50; % Weibull scale parameter
beta = 1.5; % Weibull shape parameter
mu = 3.5; sigma = 0.5; % Lognormal parameters
```
Step 2: Compute Reliability, PDF, and Hazard Functions
```matlab
% Exponential Distribution
R_exp = exp(-lambda * t);
f_exp = lambda * exp(-lambda * t);
h_exp = f_exp ./ R_exp;
% Weibull Distribution
R_weibull = exp(-(t/eta).^beta);
f_weibull = (beta/eta) * (t/eta).^(beta-1) .* exp(-(t/eta).^beta);
h_weibull = f_weibull ./ R_weibull;
% Lognormal Distribution
f_logn = lognpdf(t + eps, mu, sigma);
R_logn = 1 - logncdf(t, mu, sigma);
h_logn = f_logn ./ R_logn;
```
Step 3: Plot Reliability Functions
```matlab
figure;
plot(t, R_exp, 'r', 'LineWidth', 1.8); hold on;
plot(t, R_weibull, 'b--', 'LineWidth', 1.8);
plot(t, R_logn, 'g-.', 'LineWidth', 1.8);
xlabel('Time (hours)');
ylabel('Reliability R(t)');
title('Reliability Function Comparison');
legend('Exponential', 'Weibull', 'Lognormal');
grid on;
```
Step 4: Plot Hazard Functions
```matlab
figure;
plot(t, h_exp, 'r', 'LineWidth', 1.8); hold on;
plot(t, h_weibull, 'b--', 'LineWidth', 1.8);
plot(t, h_logn, 'g-.', 'LineWidth', 1.8);
xlabel('Time (hours)');
ylabel('Hazard Rate λ(t)');
title('Hazard Rate Function Comparison');
legend('Exponential', 'Weibull', 'Lognormal');
grid on;
```
Step 5: Compute Mean Time to Failure (MTTF)
```matlab
MTTF_exp = 1 / lambda;
MTTF_weibull = eta * gamma(1 + 1/beta);
MTTF_logn = exp(mu + (sigma^2)/2);
fprintf('Mean Time to Failure (MTTF):\n');
fprintf('Exponential: %.2f hours\n', MTTF_exp);
fprintf('Weibull: %.2f hours\n', MTTF_weibull);
fprintf('Lognormal: %.2f hours\n', MTTF_logn);
```
5. Observations and Discussion
- Compare how reliability decreases with time for different distributions.
- Exponential model assumes constant failure rate.
- Weibull model captures increasing or decreasing hazard rates depending on β.
- Lognormal is suited for wear-out failures with long tails.
- Discuss which model best represents early failures vs wear-out failures.
6. Conclusion
This experiment demonstrates how MATLAB can be used to analyze reliability
performance and model failure behavior using different statistical distributions. Students
gain practical experience in modeling reliability functions, interpreting failure rate trends,
and estimating system reliability metrics like MTTF.
7. Further Exercises
1. Import real failure time data and fit a Weibull distribution using wblfit.
2. Use fitdist() to compare goodness of fit for exponential, Weibull, and lognormal
models.
3. Extend the analysis to systems with series and parallel reliability structures.