FMINCON ERROR: "Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue."
2 次查看(过去 30 天)
显示 更早的评论
This is a simple nonlinear program. when I run it , I see the error as
Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue.
I would appreciate if someone could help me. It's being frustrating. Thanks.
objective = @(x) 1000 - 50*x(1)*x(2) - 41*x(3)*x(2) + 30*x(1) + 30*x(2) + 30*x(3);
x0 = [0 0 0];
disp(['Initial objective: ' num2str(objective(x0))])
A = [];
b = [];
Aeq = [];
beq = [];
lb = zeros(3);
ub = ones(3);
nonlincon = @nlcon;
x = fmincon(objective,x0,A,b,Aeq,beq,lb,ub,nonlincon);
disp(x)
3 个评论
Torsten
2017-12-11
objective = @(x) 1000 - 50*x(1)*x(2) - 41*x(3)*x(2) + 30*x(1) + 30*x(2) + 30*x(3);
x0 = [0 0 0];
disp(['Initial objective: ' num2str(objective(x0))])
A = [1 1 1];
b = [3];
Aeq = [];
beq = [];
lb = zeros(3);
ub = ones(3);
x = fmincon(objective,x0,A,b,Aeq,beq,lb,ub);
disp(x)
Best wishes
Torsten.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!