The solution provided by fmincon does not satisfy my constraints?
Show older comments
Hi! I'm trying to optimize a function subcject to both inequality and inequality constraints, but the solution provided by fmincon does not satisfy all of the constraints? How can this be? I'm new to optimization and quite confused by this. I'm grateful for any input to my problem! My setup looks like this:
LB = [-10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10000 -10000 -10000 -10000 0 0 0 0 0 0 0 0 0 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ]; % Lower bound
UB = [10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 1 1 1 1 1 1 1 1 10000 ]; % Upper bound
ConstraintFunction = @simple_constraints;
x0=[-241.1;-257.99;-245.53;-262.92;-256.37;-274.60;-265.20;-285.26;0.42708;0.38135;0.56409;0.54010;0.11665;0.097351;0.701129;0.659724;0.15588;0.16664;0.064814;0.069286;0.078117;0.10459;1.1844;0.97493;1.0487;0.85453;24.28;19.96;27.42;22.77;0.0649;0.39068;0.31430;0.021430;0.02568;0.071780;0.082909;0.564;0.601;0.206;0.202;0.024;0.021;0.059;0.59;2;0.1;0.1;0.1;0.1;0.1;0.1;0.1];
optcon = optimoptions('fmincon','display','iter');
[x,fval] = fmincon(@(x) simple_fitness(x),x0,[],[],[],[],LB,UB, ...
@(x) simple_constraints(x)),optcon;
5 Comments
Mia Herlov
on 1 Nov 2015
Re-run fmincon with a complete set of output arguments
[x,fval,exitflag,output,lambda,grad,hessian] = fmincon(...)
and then report to us the "exitflag" and "output".
Mia Herlov
on 1 Nov 2015
Edited: Matt J
on 1 Nov 2015
Walter Roberson
on 1 Nov 2015
Please show
output.message
Mia Herlov
on 1 Nov 2015
Accepted Answer
More Answers (0)
Categories
Find more on Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!