[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 13:09:36 -0600 |
User-agent: |
Thunderbird 2.0.0.22 (Macintosh/20090605) |
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.
Jonathan