[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fmincon and quadprog in octave

From: Rajiv Bhutani
Subject: Re: fmincon and quadprog in octave
Date: Mon, 14 Sep 2015 03:35:11 -0400

Hello Olaf,

Thank you for suggesting mailing list!

So, I went ahead and copied Octave quadprog function from

and pasted it in relevant (I hope I put it in the right directory) directory on my laptop:


I notice some discrepancies between MATLAB's quadprog and octave's qp function and octave's quadprog function.

For Example: Consider below
>> H = [6 10; 5 -6]; 
f = [-2; 3]; 
A = []; 
b = []; 

In MATLAB: >> quadprog(H,f,A,b)
Warning: Your Hessian is not symmetric. Resetting H=(H+H')/2. 
> In quadprog at 333 
Warning: Trust-region-reflective algorithm does not solve this type of problem, using
active-set algorithm. For more help, see Choosing the Algorithm in the documentation. 
> In quadprog at 371 
Warning: Your current settings will run a different algorithm (interior-point-convex) in
a future release. 
> In quadprog at 375 
Exiting: the solution is unbounded and at infinity;
 the constraints are not restrictive enough.

ans =

   1.0e+16 *


In Octave:>> quadprog(H,f)
ans =


In Octave: >> qp([],H,f)
ans =


Hope either you or someone from the mailing list can comment on what is wrong, and if quadprog function needs to be modified further, since its not giving identical results to MATLAB at least in above example.

Best Regards,
Rajiv Bhutani

On Mon, Sep 14, 2015 at 3:01 AM, Olaf Till <address@hidden> wrote:
On Mon, Sep 14, 2015 at 12:55:34AM -0400, Rajiv Bhutani wrote:
> Hello,
> I have started work on octave couple days ago and I am trying to locate
> fmincon and quadprog in octave.
> I see quadprog is available here and has been recently developed jointly by
> you and Asma.
> but it is not available in optim package that got installed on my laptop
> with octave.
> Is development work on quadprog still going on? Is that the reason why it
> is not available on sourceforge yet?
> Also, can you please tell me a good replacement for fmincon function of
> MATLAB? Is anyone developing fmincon function for octave currently?
> Thank You.
> Best Regards.
> Rajiv Bhutani

Hello Rajiv,

please use the help mailing list (is now in CC).

'quadprog' seems finished and is available in optim, but not yet in a
released version of optim. 'qp' of core Octave is an
alternative. 'fmincon' did not seem to be ready and I heard nothing
new about it from Asma. Maybe I should take a look at it to see if it
can be commited to optim. You can use 'nonlin_min' of optim instead,
which is what 'fmincon' also does, or 'sqp' of core Octave.


public key id EAFE0591, e.g. on x-hkp://

reply via email to

[Prev in Thread] Current Thread [Next in Thread]