Uploaded by Chew DY

Matlab project

advertisement
Mini-project on Probability and Statistics using Matlab
Deadline: 28 Nov 2023 (folder close at 11:59pm, submit earlier to avoid last minute technical issues).
Please submit online through Canvas. Deadline is strict. We are very busy during this period and don’t
have time to track late submissions and impose penalties, so late submission will not be graded.
Only one file per student should be submitted. Please include samples of your Matlab codes in the
Appendix (samples only, no need to include for every case!).
This project is individual work, and plagiarism is strictly prohibited. Some general discussion is ok,
such as how to use Matlab, but do not show your report or codes to your friends.
Page limit: 5 pages including figures and tables, but excluding Appendix for the codes (please don’t
spend excessive time on this project, and we don’t want thick reports!). Cover page and table of contents
discouraged, but if you want to include, it will count towards the 5 page limit.
You are encouraged to discuss your results, rather than simulate lots of cases. Quality over quantity.
Weightage of project: 20%
Task 1 Normal distribution
Suppose that a random variable X follows a normal distribution with mean µX and standard deviation
X, which you can choose. Generate N samples of X. From the samples, construct a histogram
(normalized to a PDF), calculate the sample mean, standard deviation and skewness, and calculate the
empirical CDF FX(x) = P(X<x) for selected values of x. Compare these with the theoretical results. Try
using different parameters, e.g. different µX, X, N, number of bins for histogram, etc (not necessarily
all of these), and discuss the results (do not simply repeat the parameters presented in the slides!)
Task 2 Lognormal distribution
Next, suppose that X follows a lognormal distribution with given mean and standard deviation. Repeat
the above. In addition, you can compare the histogram with the theoretical lognormal pdf as well as the
normal pdf, and discuss the difference. Try with different coefficient of variation (c.o.v.). What happens
when c.o.v. is quite small (e.g. 0.05) and relatively large?
Bonus task (not compulsory)
Feel free to explore other distributions, e.g. uniform distribution, exponential distribution, Rayleigh
distribution, t-distribution, chi-squared distribution. However, you will need to find out the Matlab
functions yourself! (but should be quite easy. Hint: google). Generate samples from your desired
distribution. From these samples, construct the normalized histogram, and compare with the theoretical
pdf similar to Tasks 1 and 2.
Task 3 Simple Reliability problem
Suppose we have a pile of capacity R and applied load S, and assume that R and S are independent.
The means and standard deviations are:
R
S
Mean
(MN)
22
8
Standard deviation
(MN)
5
2
Probability of failure pF is defined as
pF = P(R – S < 0) -------Eq. (1)
or equivalently
pF = P(R/S < 1) -------Eq. (2)
Using Monte Carlo Simulation, estimate pF for 3 cases. For each case, the distribution type for R and
S are specified in the following table.
R
Normal distribution
Lognormal distribution
Normal distribution
Case 1
Case 2
Case 3
S
Normal distribution
Lognormal distribution
Lognormal distribution
How does the choice of distribution type affects pF ?
Optional: For Case 1 and Case 2, it is possible to calculate pF theoretically. Hint: for Case 1, use Eq. (1).
For Case 2, use Eq. (2). Compare with the simulation results. This task is optional but will be very
helpful for your exam preparation!
Task 4 More “complex” reliability problem
A cantilever beam is subjected to a point load as shown below. The displacement at the tip is

PA2
(3L  A)
6 EI
The cross-section is a circular hollow cylinder with diameter D and thickness T. The second moment
of area, I is
I

 D4  ( D  2T )4 
64 
A
D

T
L
The random variables are P, A, L, E, D, T. Assume that they are all statistically independent, and
normally distributed, with a coefficient of variation of 0.06. The mean values are provided in the
following table. Assume that failure occurs if the displacement  > 0.03m. Using Monte Carlo
Simulation, determine the probability of failure.
D (m)
T (m)
P (N)
A (m)
L (m)
E (N/m2)
1800
4
8
0.2
0.01
2 1011
Bons tasks (really not necessary, for students with a lot of time and are bored)
Change distribution types and coefficient of variation for some variables.
Try and make some variables correlated (only for advanced Matlab users, need to find out yourself how
to generate correlated variables!
Download