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

1 visualización (últimos 30 días)
Aikaterini
Aikaterini el 8 de Oct. de 2014
Comentada: Bruno Pop-Stefanov el 9 de Oct. de 2014
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 comentario
Bruno Pop-Stefanov
Bruno Pop-Stefanov el 9 de Oct. de 2014
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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by