help-octave
[Top][All Lists]
Advanced

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

RE: quadprog->qp newbie help


From: MarkSheedy
Subject: RE: quadprog->qp newbie help
Date: Wed, 28 Mar 2012 00:55:06 -0700 (PDT)

Ah, yes, I see now. Sorry for not RTFM’ing  better.

 

I have now incorporated this into my main work and all is good.

 

From: forkandwait [via Octave] [mailto:ml-node+[hidden email]]
Sent: 27 March 2012 17:31
To: Mark Sheedy
Subject: Re: quadprog->qp newbie help

 

MarkSheedy <mark.sheedy <at> edftrading.com> writes:

>
> Hello,
>
> I am converting some code that uses the MatLab quadprog function to the
> Octave qp function.

You want the following Octave code (I am *almost* sure):

[X, OBJ, INFO, LAMBDA] = qp([], H,f, [], [], lb, [], [], A, b)

The problem you had in translating is that ML uses "A" and "b" to refer to the
inequality constraint matrix and vector in their docs, while Octave uses "A_in"
and "A_ub" to refer the same thing.  Octave puts them at the end instead of the
front, contra ML.  

In the Octave documentation, "A" and "b" refer to the equality constraints, NOT
inequality.  The way you called qp() provided an overdetermined matrix for
equality constraint.  You could have solved the system from your A\b to give
[0.77; 1.37]; when you feed this into qp() you x=[0.77; 1.37] since you have set
an *equality* constraint to be such.  I think this is what happened when you
disabled the check in qp.m

http://www.gnu.org/software/octave/doc/interpreter/Quadratic-Programming.html 
The fifth example down shows how to call it with an inequality matrix.

As I understand it, Octave's qp() matches the older ML's qp(), which they
changed sometime in the last decade. Lame.

Let me know if that works or helps.

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave


If you reply to this email, your message will be added to the discussion below:

http://octave.1599824.n4.nabble.com/quadprog-qp-newbie-help-tp4508688p4509398.html

To unsubscribe from quadprog->qp newbie help, click here.
NAML



This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any commodities, financial risk management products, or other physical or financial product or service, an official confirmation of any transaction, or an official statement of EDF Trading Limited, EDF Trading Markets Limited, EDF Trading North America, LLC, or any of the EDF Group family of companies. Any views or opinions presented are solely those of the author and do not necessarily represent those of the foregoing entities. EDF Trading Markets Limited is authorised and regulated by the Financial Services Authority. VAT number: GB 735 5479 07. EDF Trading Markets Limited and EDF Trading North America, LLC are members of the EDF Group of companies. EDF Trading Markets Limited maintains its registered office at 80 Victoria Street, 3rd Floor, Cardinal Place, London, SW1E 5JL. A Company registered in England No. 4255974. EDF Trading North America, LLC is headquartered in the United States at 4700 W. Sam Houston Pkwy., Suite 250, Houston, TX 77041



View this message in context: RE: quadprog->qp newbie help
Sent from the Octave - General mailing list archive at Nabble.com.

reply via email to

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