help-octave
[Top][All Lists]
Advanced

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

Re: Quadratic Programming


From: Jonathan Stickel
Subject: Re: Quadratic Programming
Date: Thu, 16 Jul 2009 15:53:51 -0600
User-agent: Thunderbird 2.0.0.22 (Macintosh/20090605)

John W. Eaton wrote:
On 16-Jul-2009, Jonathan Stickel wrote:

| On 7/16/09 address@hidden wrote:
| > Date: Wed, 15 Jul 2009 20:44:12 -0300
| > From: "Christian D'Aquino" <address@hidden>
| > Subject: Quadratic Programming
| > To: <address@hidden>
| > Message-ID: <address@hidden>
| > Content-Type: text/plain; charset="iso-8859-1"
| > | > Hi All, | > | > I'm a new user to Octave and I'm having a hard time on using the quadratic programming function. When I try to solve the function below: | > | > x0 = [0;0]
| > cov = [1 -1;-1 2]
| > q = [-2;-6]
| > A = [1 -1;-1 2]
| > b = [2;3]
| > lb = [0;0]
| > ub = [1;1]
| > Alb = []
| > Ain = []
| > Aub = []
| > [x,obj,info,lambda] = qp(x0,cov,q,A,b,lb,ub,Alb,Ain,Aub)
| > | > | > It gives me a "qp: inequality constraint matrix has incorrect column dimension" error. My only innequallity constraint would be the ones set by "lb" an "ub". Doesn't it accept Alb, Ain and Aub to be null? | > | > Can someone help me understand what I am missing here? | > | > Thanks in advance,
| > Christian D'Aquino
| | I ran into a similar problem awhile ago; I made these notes to myself in | one of my scripts: | | ## the parsing of the constraints in qp seems a bit arbitrary; none
|    ## are really needed, but at least some must be provided, although
|    ## they can be empty; however if Ain is provided, it cannot be empty
| | In your case, if you don't need an inequality constraint, do not append | those input arguments, like so: | | [x,obj,info,lambda] = qp(x0,cov,q,A,b,lb,ub); | | HTH. It looks like some cleanup of the qp function is needed, if anyone | wants to tackle it.

It also works if you do this:

  Alb = zeros(0,1);
  Ain = zeros(0,2);
  Aub = zeros(0,1);

That seems reasonable to me, since with these definitions, the
dimensions of

  Alb <= Ain*x <= Aub

make sense.

With Alb = Ain = Aub = [], the dimensions don't make sense.  So I
don't see that any change is needed.

jwe

It seems strange to me that A can be provided as empty, as can A_lb and
A_ub, but Ain cannot be.   In any case, the help text of qp could be
improved to explain what are proper inputs.

Jonathan



reply via email to

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