No real difference in the final result, but possibly
a difference in efficiency. Use the bounds. There
is no good reason to force fmincon to do extra work,
to deal with a more general class of constraints than
it needs to though.
> 2. I tried both means, using optimset('Algorithm','active-set').
> I get a error message "Optimization terminated: no feasible solution found. Magnitude of search direction less than 2*options.TolX but constraints are not satisfied".
> What could be the reason? Any help is appreciated please.
What could be the reason? Get better starting values.
It is even possible that no solution exists to the set
of constraints that you have formed. That is the
meaning of this message - that no solution was found
that satisfies the constraints.
Rethink your problem. Decide if there is a flaw with
the problem formulation, or if the flaw is in your
coding of the problem. If there is no flaw, then GET
BETTER STARTING VALUES. If you can't do this, then
go back to rethinking your problem.
John
On a side note, why not use quadprog() as opposed to fmincon
Specify lower and upper bounds of -inf and inf on the free variables.
> If there is no flaw, then GET
> BETTER STARTING VALUES.
John, does then starting value matter when the function is convex?
Bruno
Now, coming back to my question and your reply, should I rewrite the code as:
x=fmincon(@obfun11,x0,H,b,GL,A,-inf,inf,0,900,inf,inf,300,1600...options)?
(.... to mean other variables)
Kindly note that the only second and fourth var have been bounded.
Is this syntax correct? Will fmincon understand that each pair of these is the bound values for each variable?
No. Put the lower and upper bound as vectors:
lo = [-inf 0 -inf 0 0 0]';
up = [inf 900 inf 1600 ...]';
x = fmincon(..., lo, up)
Bruno
Perhaps it is simply that you cannot find the relevant areas of
documentation, but once found they are satisfactory. For bounds, see
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-11.html#brhkghv-13
For fmincon syntax, see
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fmincon.html
If you had trouble locating these sections, I would appreciate knowing
how you looked for them. Did you use a keyword search? Did you look in
the Optimization Toolbox User's Guide table of contents? Is there a term
you were looking for, such as "bounds" or "limits" or "minimum" that did
not give you satisfactory results?
Thanks in advance for any information,
Alan Weiss
MATLAB mathematical toolbox documentation
As John asked you already, are you sure a feasible point exists for this problem? If you know a feasible point, why not initialize from there and see what happens? Again though, I wonder why you are not using quadprog() instead of fmincon() seeing as your problem is a QP.