MATLAB: Error for ‘fmincon’ for global optimization

fminconglobalsearch

Hello everyone.
I am running 'fmincon' for global optimization but some errors are occured.
The below is the code that I put
%%
P = [];
P = P.';
x0 = ones(243,1);
TP = [];
lb = zeros(243,1);
ub = ones(243,1);
aeq =[];
beq=[];
nonlcon_fmincon = [@nonlinearcon]; % Non-linear constraint we used for MOLP is stored in @nonlinearcon function
opts_mincon =optimoptions(@fmincon,'MaxFunctionEvaluations', 100000000000,'ConstraintTolerance',1e-5);
%%
rng default
gs = GlobalSearch;
C = [123935;85425;96389;79871;138338;.....;27614];
C = C.';
fun_C = @(x)-C*x;
problem = createOptimProblem('fmincon','nonlcon',nonlcon_fmincon,'x0',x0,'objective',fun_C,'LB',lb,'UB',ub);
x = run(gs,problem);
The error messages are follows;
Error : createOptimProblem (line 107)
No field LB exists for PROBLEM structure.
Type "help createOptimProblem" for a list of valid fields for each solver.
Error: Untitled (line 18)
problem = createOptimProblem('fmincon','nonlcon',nonlcon_fmincon,'x0',x0,'objective',fun_C,'LB',lb,'UB',ub)
I don't know which one has problem.
Thanks

Best Answer

It's a case sensitivity issue. Instead of 'LB' and 'UB', pass in 'lb' and 'ub'.