GlobalSearch Not Analyzing all Trial Points for a Specific Objective Function

I am currently having an issue when running GlobalSearch using the Global Optimization toolbox. I have found that if I use specific objective functions such as functions that find the spectral radius of a matrix i.e.
max(abs(eig(A)))
then GlobalSearch will not analyze all of the trial points and instead it will only run one local solver. My optimization problem is defined as:
options = optimoptions(@fmincon, 'Algorithm', 'interior-point', ...
'Display', 'final', 'OptimalityTolerance', 1e-10, ...
'SpecifyObjectiveGradient', false, 'CheckGradients', false, ...
'stepTolerance', 1e-14', 'MaxFunctionEvaluations', 100000, ...
'MaxIterations', 1000, 'ScaleProblem', 'obj-and-constr',...
'ScaleProblem', 'obj-and-constr', 'ConstraintTolerance', 0);
% Define optimization problem
problem = createOptimProblem('fmincon', 'objective', ...
@(dn) objFuncs(dn,iteration,op), 'x0', op.d0{1},'ub', op.ub{1}, 'lb',...
op.lb{1}, 'nonlcon', @(dn) nonlcons(dn,op), 'options', options);
% Define GlobalSearch structure
gs = GlobalSearch('Display', 'iter', 'FunctionTolerance', 0, 'NumTrialPoints', 2000);
% Run optimization
[dsol, errv, exitflag, output, solutions] = run(gs, problem)
An example of an objective function that works is:
function [fval] = objective_weight2(H,D1,x,op_accorder)
e1 = D1*x.^(op_accorder+1) - (op_accorder+1).*x.^(op_accorder);
e2 = D1*x.^(op_accorder+2) - (op_accorder+2).*x.^(op_accorder+1);
fval = (e1+e2)'*abs(H)*(e1+e2);
end
which will give me outputs like:
fmincon stopped because the size of the current step is less than
the selected value of the step size tolerance and constraints are
satisfied to within the selected value of the constraint tolerance.
<stopping criteria details>
Num Pts Best Current Threshold Local Local
Analyzed F-count f(x) Penalty Penalty f(x) exitflag Procedure
1510 8963 3.007e-14 -115.6 -2.921 1.296e-13 2 Stage 2 Local
1600 9053 3.007e-14 3.113 -338.2 Stage 2 Search
1700 9153 3.007e-14 0.01529 -133.4 Stage 2 Search
1800 9253 3.007e-14 0.02712 -54.07 Stage 2 Search
1900 9353 3.007e-14 2.076 -17.04 Stage 2 Search
2000 9453 3.007e-14 -5.749 -648.8 Stage 2 Search
which is expected. However, if I use the same objective function but add a line that finds the spectral radius:
function [fval] = objective_weight2(H,D1,x,op_accorder)
e1 = D1*x.^(op_accorder+1) - (op_accorder+1).*x.^(op_accorder);
e2 = D1*x.^(op_accorder+2) - (op_accorder+2).*x.^(op_accorder+1);
sr = max(abs(eig(D1)));
fval = (e1+e2)'*abs(H)*(e1+e2);
end
even though I don't use the spectral radius in calculating fval then I get the following output:
Num Pts Best Current Threshold Local Local
Analyzed F-count f(x) Penalty Penalty f(x) exitflag Procedure
0 109 3.007e-14 3.007e-14 2 Initial Point
GlobalSearch stopped because it analyzed all the trial points.
The local solver ran once and it converged with a positive local solver exit flag.
And it stop at Num Pts Analyzed = 0 and not go up to 2000.

Answers (0)

Products

Release

R2016b

Asked:

on 13 Jun 2018

Community Treasure Hunt

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

Start Hunting!