|
Thank you, Stefan and Paul. I tested it again and the bound is already a minimum point. Nice advice to test it using different starting point.
I didn't know that fmincon was automatically switching to line search algorithm in my code. Thank Paul to point it out. I learn a lot from you guys, thank you very much!
All my best,
Amber
"Paul Kerr-Delworth" <paul.kerr-delworth@mathworks.co.uk> wrote in message <h788t1$iq9$1@fred.mathworks.com>...
> Hi,
>
> As Stefan says, it is perfectly possible for a local minimum of your problem to lie on some or all of your bounds. You could try running fmincon from different start points to verify that this really is the minimum.
>
> Also, you asked about how to switch to the active set method in the subject of the message. To do this you should set the 'Algorithm' option to 'active-set' using the OPTIMSET command - see the documentation for OPTIMSET for more details. Note that in the code you provided, fmincon was automatically switching to this algorithm for you.
>
> Best regards,
>
> Paul
>
> "Yao Li" <yaoamber@gmail.com> wrote in message <h77hkm$6n7$1@fred.mathworks.com>...
> > Hi all,
> >
> > I am solving a multivariable nonlinear function to try to find the minimum. I use fmincon command. For the sample size=5, it works very well. But when I increased my sample size, it prompts the following warning and the resulted optimal x (vector) has a border solution. I mean, some elements of x are just at the lower bound or upper bound. The message is as follows.
> >
> > Warning: Trust-region-reflective method does not currently solve this type of
> > problem,
> > using active-set (line search) instead.
> > > In fmincon at 422
> > Optimization terminated: magnitude of directional derivative in search
> > direction less than 2*options.TolFun and maximum constraint violation
> > is less than options.TolCon.
> > No active inequalities.
> >
> > Can anyone please tell me how to solve this question? Many thanks in advance!
> >
> > All my best,
> > Yao (Amber)
|