如何解决为正态分布定义了哪个非线性求解器?
你能帮我吗?在下面的代码中,Ipopt求解器用于求解非线性模型。但似乎此求解器不适合正态分布。您能帮助我哪个非线性求解器对求解模型有用?非常感谢。
using JuMP,Gurobi,Ipopt
#parameters--------------------------------------------------------
sig=0.86;
#---------------------------------------------------------------------------
ALT= Model(optimizer_with_attributes(Juniper.Optimizer,"nl_solver"=>optimizer_with_attributes(Ipopt.Optimizer,"print_level" => 0),"mip_solver"=>optimizer_with_attributes(Gurobi.Optimizer,"logLevel" => 0),"registered_functions" =>[Juniper.register( :f,1,f; autodiff = true)])
)
# variables-----------------------------------------------------------------
f(x) = cdf(Normal(0,1),x);
JuMP.register(ALT,:f,f; autodiff = true);
@variable(ALT,h >= 0);
@variable(ALT,L >= 0);
@variable(ALT,n,Int);
#-------------------------------------------------------------------
@NLexpression(ALT,k7,1-f(L-sig*sqrt(n))+f(-L-sig*sqrt(n)));
#constraints--------------------------------------------------------
@NLconstraint(ALT,f(-L) <= 1/400);
#-------------------------------------------------------------------
@NLobjective(ALT,Min,1/k7)
optimize!(ALT)
有此错误
ERROR: UndefVarError: Normal not defined
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。