fmincon with Multistart errors

2 views (last 30 days)
Michalis
Michalis on 27 Aug 2014
Edited: Matt J on 27 Aug 2014
Hi all.
I get the following list of errors for my code (see further below for actual code syntax)
Error using barrier (line 22)
Objective function is undefined at initial point. Fmincon cannot
continue.
Error in fmincon (line 900)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] =
barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in
/Applications/MATLAB_R2013a.app/toolbox/globaloptim/globaloptim/private/fmultistart.p>fmultistart
(line 34)
Error in MultiStart/run (line 256)
[x,fval,exitflag,output] = ...
Error in Ising_N3 (line 26)
[x,fval,exitflag]=run(ms,problem,20)
Caused by:
Failure in evaluation call to the local solver with user-supplied
problem structure.
Here is the problem structure for the optimization
opts=optimoptions(@fmincon,'Algorithm','interior-point');
problem=createOptimProblem('fmincon','objective', @(x)mvar([x(1),x(2),x(3),x(4),x(5),x(6),x(7)]),'x0',[1/sqrt(2),0,1/sqrt(2),0,1,0,0],'lb',[0,0,0,0,0,0,0],'ub',[1,2*pi,1,2*pi,1,2*pi,20],'options',opts)
ms=MultiStart('Display','iter','StartPointsToRun','bounds','UseParallel','always')
[x,fval,exitflag]=run(ms,problem,20)
The objective function is defined further up in my file. I have checked that for the initial conditions the objective function does compute a finite result (namely zero) In fact for any value specified within my constraints the objective function computes nicely.
The interesting thing is that i run the same optimization problem with fewer parameters (5) and it runs with no problems. But with seven parameters i get this list of errors.
Suggestions?
  1 Comment
Matt J
Matt J on 27 Aug 2014
Edited: Matt J on 27 Aug 2014
We would have to see mvar(), I think. Or, you could use dbstop to trap the offending initial x0. Why do you do
@(x)mvar([x(1),x(2),x(3),x(4),x(5),x(6),x(7)])
instead of simply
@(x)mvar(x)

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!