Can someone check my code for a Monte Carlo and FORM analysis?

1 回表示 (過去 30 日間)
Aikaterini
Aikaterini 2014 年 10 月 8 日
コメント済み: Bruno Pop-Stefanov 2014 年 10 月 9 日
for Hb=0:1:7, for i = 1:length(samples.hth), Dhsetup=0.5*samples.rair(i)*samples.Cd(i)*samples.U10(i)^2*samples.F(i)/(samples.rsw(i)*samples.g(i)*samples.dbay(i)); % wind set-up Δhset-up n=48; j=(1:n); hbay(j)=1; for j=1:n, if hbay(j)>=Hb Dh(j)=samples.hcoast(i)-hbay(j); else Dh(j)=samples.hcoast(i)-Hb; end Cdf(j)=1-(hbay(j)/samples.hcoast(i))^1.5; Qw(j)=Cdf(j)*samples.Cw(i)*sqrt(samples.g(i))*samples.L(i)*Dh(j)^1.5; hbay(j)=hbay(j)+Qw(j)*samples.Dt(i)/samples.Abay(i)+Dhsetup; end hbay(i)=hbay(j); z(i,:) = samples.hth(i)-hbay(i); % limit state function end end
After runninng it there is an error "Error using FORM (line 219) FORM: derivative dz/du becomes complex for variable(s): "hcoast" Reconsider stochastic variable and z-function to solve the problem."
  1 件のコメント
Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014 年 10 月 9 日
Can you please format the code so that it is readable?
What function is form? There is no function in MATLAB called form and I don't see it used anywhere in the code you pasted. Can you paste the line of code that throws the error?
I don't know what this form function is but the message seems to indicate that you should reconsider the variable hcoast because dz/du is complex. Maybe there is something wrong with your z-function or with hcoast?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by