Formulating a Monte carlo simulation for corrosion initiation time
15 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(6 个)
Image Analyst
2017-4-16
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.
Pablo Benítez
2018-5-30
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 个评论
harsh Brar
2022-5-8
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
2018-7-19
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 个评论
Pablo Benítez
2018-7-20
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 个评论
Abdelrahman Abdallah
2019-5-23
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!