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
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 CenterFile Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by