FMINCON ERROR: "Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue."

2 views (last 30 days)
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 Comments
Torsten
Torsten on 11 Dec 2017
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.

Sign in to comment.

Answers (0)

Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!