Fmincon stuck within an iteration for a particular start point
Ältere Kommentare anzeigen
Hi,
I'm doing (nonlinear/non-convex) constrained optimization using SQP algorithm on a fairly small sized problem (average ~0.5 second to optimal solution in a 2 core i7 computer under no other load). I'm solving this problem across a large # of start points (and some parameterization) using parfor loop.
The algorithm runs fine for most part and I'm getting valid solutions.
Unfortunately for certain start point combinations (and parameterization) the algorithm is endlessly executing without doing a time-out.
I tried to understand why it is stuck and turned on certain options in fmincon/SQP using:
SQPoptions = optimoptions(@fmincon,'Algorithm','sqp','Display','iter-detailed','TolX',Tol(4),'TolFun',Tol(1),...
'GradObj','on', 'GradConstr','on','ObjectiveLimit',1e-20);
[sqpxstar, sqpfval, sqpmflag, sqpoutput] = fmincon(ObjFunGrad,[TempRw(NumOfParms+1:NumOfParms+...
(NumOfExpVar*CurrExpRunCnter))],LHSMatrixLinIneq{CurrExpRunCnter},...
RHSVectorLinIneq{CurrExpRunCnter},LHSMatrixLinEq{CurrExpRunCnter},RHSVectorLinEq{CurrExpRunCnter},...
FillUpAlgoDesBoundsLow,FillUpAlgoDesBoundsHigh,[],SQPoptions);
I'm not providing the objective function, constraints etc as they are very nasty expressions (dynamically generated using symbolic expression)
But here is the output for one of the start point combinations. It will display the Iteration 3 and nothing after that (even after waiting for 1 hour). Do note that the initial 3 iterations do not take more than a fraction of a second but after that it is endlessly processing with no seeming progress
Norm of First-order
Iter F-count f(x) Feasibility Steplength step optimality
0 1 4.113395e+19 0.000e+00 2.940e+19
User objective function returned Inf; trying a new point...
1 3 5.096751e+04 0.000e+00 7.000e-01 6.623e+01 2.058e+19
User objective function returned NaN; trying a new point...
2 5 8.540454e+03 0.000e+00 7.000e-01 2.213e+01 6.174e+18
User objective function returned NaN; trying a new point...
3 7 4.774538e+03 0.000e+00 7.000e-01 3.456e+02 3.519e+02
Stopping it by pressing control + break just spits out the message that
Operation terminated by user during computeSearchDirSQP (line 49)
In sqpLineSearch (line 281)
In fmincon (line 806)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
sqpLineSearch(funfcn,X,full(A),full(B),full(Aeq),full(Beq), ...
What is the right way to debug this?
I'm ok with prematurely exiting if there is no progress after X amount of time and will just try the next start point in the par for loop. But failed to see any such option in fmincon?
Thanks
Hari
PS: Here is the final SQP options:
>> SQPoptions
SQPoptions =
fmincon options:
Options used by current Algorithm ('sqp'):
(Other available algorithms: 'active-set', 'interior-point', 'trust-region-reflective')
Set by user:
Algorithm: 'sqp'
Display: 'iter-detailed'
GradConstr: 'on'
GradObj: 'on'
ObjectiveLimit: 1.0000e-20
TolFun: 1.0000e-06
TolX: 1.0000e-04
Default:
DerivativeCheck: 'off'
Diagnostics: 'off'
DiffMaxChange: Inf
DiffMinChange: 0
FinDiffRelStep: 'sqrt(eps)'
FinDiffType: 'forward'
FunValCheck: 'off'
MaxFunEvals: '100*numberOfVariables'
MaxIter: 400
OutputFcn: []
PlotFcns: []
ScaleProblem: 'none'
TolCon: 1.0000e-06
TypicalX: 'ones(numberOfVariables,1)'
UseParallel: 0
Show options not used by current Algorithm ('sqp')
Akzeptierte Antwort
Weitere Antworten (1)
Tao Lu
am 13 Dez. 2016
0 Stimmen
Hi, Hari:
Do you already solve the original problem? Since I also have the same problem when using fmincon with lots of initial guesses and conditions.
Thank you.
1 Kommentar
Sean de Wolski
am 13 Dez. 2016
In recent releases of MATLAB there is a "Pause" button. I would encourage you to use it to stop fmincon in its tracks in debug mode so you can see what's going on.
Kategorien
Mehr zu Surrogate Optimization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!