Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Difference Between QuadProg and FMINCON

Subject: Difference Between QuadProg and FMINCON

From: LP Pakula

Date: 2 Sep, 2009 02:20:24

Message: 1 of 8

Hi

I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?

From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).

Cheers, Lyle

Subject: Difference Between QuadProg and FMINCON

From: Alan Weiss

Date: 2 Sep, 2009 12:24:59

Message: 2 of 8

LP Pakula wrote:
> Hi
>
> I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
>
> From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
>
> Cheers, Lyle
They solve different classes of problems. See
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: Difference Between QuadProg and FMINCON

From: LP Pakula

Date: 2 Sep, 2009 12:39:03

Message: 3 of 8

Hi Alan,

thats clear but reading my original question again, could you please explain why passing a problem that can be solved by both methods with an Active Set algorithm produces difference performance (and results in some cases). Clearly the algorithms are not identical and I'm curious on specifically what the differences are.

Thanks, Lyle
 


Alan Weiss <aweiss@mathworks.com> wrote in message <h7lo6r$qc2$1@fred.mathworks.com>...
> LP Pakula wrote:
> > Hi
> >
> > I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
> >
> > From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
> >
> > Cheers, Lyle
> They solve different classes of problems. See
> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Subject: Difference Between QuadProg and FMINCON

From: Alan Weiss

Date: 2 Sep, 2009 12:45:50

Message: 4 of 8

I cannot tell you all the differences, but one large difference is that
quadprog knows the derivatives of its objective function. fmincon does
not, unless you set the 'GradObj' option to 'on' and provide a gradient
in the objective function. This is the main reason we recommend quadprog
rather than fmincon for quadratic programming problems:
http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-19

Alan Weiss
MATLAB mathematical toolbox documentation

LP Pakula wrote:
> Hi Alan,
>
> thats clear but reading my original question again, could you please explain why passing a problem that can be solved by both methods with an Active Set algorithm produces difference performance (and results in some cases). Clearly the algorithms are not identical and I'm curious on specifically what the differences are.
>
> Thanks, Lyle
>
>
>
> Alan Weiss <aweiss@mathworks.com> wrote in message <h7lo6r$qc2$1@fred.mathworks.com>...
>> LP Pakula wrote:
>>> Hi
>>>
>>> I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
>>>
>>> From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
>>>
>>> Cheers, Lyle
>> They solve different classes of problems. See
>> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21
>>
>> Alan Weiss
>> MATLAB mathematical toolbox documentation

Subject: Difference Between QuadProg and FMINCON

From: LP Pakula

Date: 2 Sep, 2009 13:06:04

Message: 5 of 8

Hi Alan,

thats even more curious since I supplied the derivative to fmincon!

Thanks for the quick response, Lyle


Alan Weiss <aweiss@mathworks.com> wrote in message <h7lpdu$1ur$1@fred.mathworks.com>...
> I cannot tell you all the differences, but one large difference is that
> quadprog knows the derivatives of its objective function. fmincon does
> not, unless you set the 'GradObj' option to 'on' and provide a gradient
> in the objective function. This is the main reason we recommend quadprog
> rather than fmincon for quadratic programming problems:
> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-19
>
> Alan Weiss
> MATLAB mathematical toolbox documentation
>
> LP Pakula wrote:
> > Hi Alan,
> >
> > thats clear but reading my original question again, could you please explain why passing a problem that can be solved by both methods with an Active Set algorithm produces difference performance (and results in some cases). Clearly the algorithms are not identical and I'm curious on specifically what the differences are.
> >
> > Thanks, Lyle
> >
> >
> >
> > Alan Weiss <aweiss@mathworks.com> wrote in message <h7lo6r$qc2$1@fred.mathworks.com>...
> >> LP Pakula wrote:
> >>> Hi
> >>>
> >>> I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
> >>>
> >>> From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
> >>>
> >>> Cheers, Lyle
> >> They solve different classes of problems. See
> >> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21
> >>
> >> Alan Weiss
> >> MATLAB mathematical toolbox documentation

Subject: Difference Between QuadProg and FMINCON

From: Marcus M. Edvall

Date: 2 Sep, 2009 23:19:49

Message: 6 of 8

A dedicated QP solver would reasonably always be better than a general
nonlinear solver when solving a QP problem.

The name of the method is usually less interesting than the
implementation of the algorithm.

Best wishes, Marcus
http://tomopt.com/
http://tomdyn.com/

Subject: Difference Between QuadProg and FMINCON

From: Sdas Das

Date: 14 Mar, 2010 17:27:05

Message: 7 of 8

Hi Alan,
      I came across this thread. This is an interesting one. Say I have my obj function: obj = .5*x'*H*x + f'x and I have some constraints with some bounds. My question is, if I solve the above problem using QuadProg and Fmincon, do they produce the same answer?
Thanks,
SD

Alan Weiss <aweiss@mathworks.com> wrote in message <h7lo6r$qc2$1@fred.mathworks.com>...
> LP Pakula wrote:
> > Hi
> >
> > I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
> >
> > From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
> >
> > Cheers, Lyle
> They solve different classes of problems. See
> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Subject: Difference Between QuadProg and FMINCON

From: Gene

Date: 10 Jul, 2011 22:53:10

Message: 8 of 8

Both are convex problems, and you should get the same answer using either solver. I've solved many, many quadratic programs with fmincon, and it works quite well, but now I'm wondering if a dedicated solver (i.e. quadprog) is somehow more efficient than the general purpose one (i.e. fmincon).

GB


"Sdas Das" wrote in message <hnj698$8p5$1@fred.mathworks.com>...
> Hi Alan,
> I came across this thread. This is an interesting one. Say I have my obj function: obj = .5*x'*H*x + f'x and I have some constraints with some bounds. My question is, if I solve the above problem using QuadProg and Fmincon, do they produce the same answer?
> Thanks,
> SD
>
> Alan Weiss <aweiss@mathworks.com> wrote in message <h7lo6r$qc2$1@fred.mathworks.com>...
> > LP Pakula wrote:
> > > Hi
> > >
> > > I'm curious what the exact difference between QuadProg and FMINCON are when both are using an Active-Set algorithm?
> > >
> > > From my tests, i find quadprog runs faster and tends to be more accurate with care taken to make sure tolerances are the same (etc).
> > >
> > > Cheers, Lyle
> > They solve different classes of problems. See
> > http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-21
> >
> > Alan Weiss
> > MATLAB mathematical toolbox documentation

Tags for this Thread

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.

Contact us