Thread Subject: how to switch to active-set (line search) using fmincon

Subject: how to switch to active-set (line search) using fmincon

From: Yao Li

Date: 28 Aug, 2009 03:07:02

Message: 1 of 5

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)

Subject: how to switch to active-set (line search) using fmincon

From: Yao Li

Date: 28 Aug, 2009 03:27:01

Message: 2 of 5

FYI.
I don't have any linear constraints, and only have the upper bound and lower bound. The code is as below.

lb=[0;0.3;0.01];
ub=[1;0.9;0.99];
x0=[0.2;0.6;0.75];

tic
x=fmincon(@(x) outputcal2rfundif(x,shareGDPcal,vdata,difim4),x0,[],[],[],[],lb,ub)
toc

Subject: how to switch to active-set (line search) using fmincon

From: Stefan

Date: 28 Aug, 2009 06:57:01

Message: 3 of 5


> I mean, some elements of x are just at the lower bound or upper bound. The message is as follows.

Well, if you are using constrained optimization this is certainly possible. Are you sure it's not the optimum.
What is the question exactly?

Regards,
Stefan


> 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)

Subject: how to switch to active-set (line search) using fmincon

From: Paul Kerr-Delworth

Date: 28 Aug, 2009 09:44:01

Message: 4 of 5

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)

Subject: how to switch to active-set (line search) using fmincon

From: Yao Li

Date: 28 Aug, 2009 13:33:03

Message: 5 of 5

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)

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
nonlinear optim... Yao Li 27 Aug, 2009 23:09:09
fmincon Yao Li 27 Aug, 2009 23:09:09
line search Yao Li 27 Aug, 2009 23:09:09
trustregionrefl... Yao Li 27 Aug, 2009 23:09:09
multivariable n... Yao Li 27 Aug, 2009 23:09:09
rssFeed for this Thread

Contact us at files@mathworks.com