Formulating a Monte carlo simulation for corrosion initiation time
15 views (last 30 days)
Show older comments
Hi, I am currently working on formulating a Monte Carlo simulation for predicting corrosion initiation time whereby the formula being applied is
T = X^2 / [4D(erfc^-1(Cth/Co)^2]
where X, D, Cth, Co are random variables with lognormal distributions for X,Co and Cth is a uniform distribution and D a distinct value.
Below is some of the code for the variables required:
X = normrnd(40,0.1,1,1000);
Co = lognrnd(3.5,0.5,1,1000);
D = 5*(10^-5);
Cth= unifrnd(0.6,1.2,1,1000);
E= erfc(Cth/Co);
Where the issue arises is when I try to implement the equation as the random variables are vectors so the power function becomes inapplicable as it requires scalar quantities. More information and assistance is kindly welcome.
0 Comments
Answers (6)
Image Analyst
on 16 Apr 2017
I don't know about the erfc -1 versus the erfc, but how about this:
X = normrnd(40, 0.1, 1, 1000);
Co = lognrnd(3.5, 0.5, 1, 1000);
D = 5*(10^-5);
Cth = unifrnd(0.6, 1.2, 1, 1000);
E = erfc(Cth ./ Co);
T = X .^ 2 ./ [4 * D .* E .^ 2]
plot(T, 'b-');
grid on;
Simply use dot before any * / or ^ operations that use a vector.
3 Comments
Pablo Benítez
on 30 May 2018
Dear Barry,
I hope you are well. Interestingly, I am working on a similar research to yours, however, the time of corrosion initiation that I am looking for is for carbonation. Have you achieved to get the PDF for the initiation time?
I will be grateful to be in contact with you,
Regards,
Pablo
2 Comments
harsh Brar
on 8 May 2022
hi barry,
Hope you are doing well.
Lately I have been working on predicting the service life of concrete on the basis of chloride induced corrosion using monte carlo. I have been trying my best to get results from the code but its not working. I was hoping if you could help me with your code. That will be of great help.
looking forward to hear from you soon.
thank you.
Pablo Benítez
on 19 Jul 2018
Hi Barry,
I hope you are going well. Fortunately, I managed to solve the problem of obtaining the time of corrosion onset by carbonation. I have had some problems to perform the Monte Carlo simulation at the beginning, but the problem has been fixed. Anyway, thanks for your response.
Best regards,
Pablo
0 Comments
Pablo Benítez
on 20 Jul 2018
Hi Barry,
I will need to talk to the colleague who helped me with the programming. The code for MCS comprises a part of a larger code that was made for the maintenance planning of structures. Thus, the complete code is currently being reorganized to make a commercial package that will be used for decision-making. So, I do not know if there is any confidentiality to convey a part of the code. If there is no problem, I will send you.
Cheers,
Pablo
0 Comments
Abdelrahman Abdallah
on 23 May 2019
hi barry,
I am working on the same equation and I just wanted to know
did you use the erfinv in matlab and why didnt you use lognrnd(log(3.5),0.5) for surface cholride
0 Comments
See Also
Categories
Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!