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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by