Why does this code not work?

3 ビュー (過去 30 日間)
Ashwini Subhash
Ashwini Subhash 2022 年 11 月 21 日
コメント済み: VBBV 2022 年 11 月 21 日
%USE MONTE CARLO METHOD TO CALCULATE PROBABILITY OF FAILURE OF WIND TURBINE
%The given limit state function for the given is
%g = P= 2.652*10^-8*D^2.4299*V3.0116- 0.5;
%Given :
D =90 ;
V = 6.672408424 ;
mean_D = 90 ;
mean_V = 6.6724 ;
sigma_D = 10.29023 ;
sigma_V = 0.67708 ;
%Now use normrnd function
n = 10e6;
D = normrnd(mean_D, sigma_D, [n,1]);
V = normrnd(mean_V, sigma_V, [n,1]);
%Create for loop
K = nnz(2.652*10^-8*D^2.4299*V^3.0116-0.5 < 100);
P_fail = K/n

回答 (1 件)

VBBV
VBBV 2022 年 11 月 21 日
D =90 ;
V = 6.672408424 ;
mean_D = 90 ;
mean_V = 6.6724 ;
sigma_D = 10.29023 ;
sigma_V = 0.67708 ;
%Now use normrnd function
n = 10e6;
D = normrnd(mean_D, sigma_D, [n,1])
D = 10000000×1
93.6215 100.2214 77.4233 103.6873 86.7063 93.5225 78.1190 82.3651 97.7291 80.3734
V = normrnd(mean_V, sigma_V, [n,1])
V = 10000000×1
7.0408 6.4080 6.3675 6.5585 5.4430 6.4935 5.3796 7.1606 7.6568 6.1422
%Create for loop
K = nnz(2.652*10^-8*D.^2.4299.*V.^3.0116-0.5 < 100);
P_fail = K/n
P_fail = 1
  3 件のコメント
Ashwini Subhash
Ashwini Subhash 2022 年 11 月 21 日
Thank You!
VBBV
VBBV 2022 年 11 月 21 日
if it worked pls accept the answer.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMonte-Carlo についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by