Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 12 Dec 2008 14:15:55 -0600
Newsgroups: comp.soft-sys.matlab
Subject: Which to use (quadprog or fmincon)?
From: "Eric J. Holtman" <ejh@ericholtman.com>
Message-ID: <Xns9B72911B0AAD8ejhericholtmamcom@216.168.3.30>
User-Agent: Xnews/5.04.25
Date: Fri, 12 Dec 2008 14:15:55 -0600
Lines: 63
X-Trace: sv3-mHgVn4aiLLlPefPb/yY0pwaL5j+gYR0ogDKBBQedkJFp0MHcw0KLBroyK/UPhM2K3jL//O7NJCG505V!eI+qsuz9hl1lYYpCiV3ePJhU5ADMzRtmlsm7gkcYFPEcWLRDKH70PcZ2aaFzO5LTdgyZaLQstf4F!6yNqqGYBgA==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
Xref: news.mathworks.com comp.soft-sys.matlab:506639



OK, here's a re-formulation of a question I asked earlier
today:

What's the best way to solve this problem:

Minimize:  c1 x1 + q1*x1*x1 + c2 x2 + q2*x2*x2 . . .

(I have about 3,000 x variables)

Subject to:
many constraints like 

x1 <= 40;
x1 + x2 = 7;

all x >=0;

Now, I know a few things about this problem:

1) It's quadratic.
2) The Hessian is sparse, and well structured (only entries
on the diagonal
3) all variables are >= 0.


I'd like to use quadprog, but it seems like that's not
feasible, as if I use the problem as stated, it will use
the medium scale, which uses a dense Hessian, which will
kill performance.

If I want to use the large-scale, I can re-write my
constraints:

x1 <= 40;  becomes  x1 + slack1 = 40, etc, etc.  But
the docs for the large scale say that I if I use the
Aeq and beq entries, I can't pass bounds.  So how do
I limit my xs and slacks to be >=0?

Also, the large-scale docs imply that I cannot have more
constraints than variables, which means that if every
x has an absolute upper bound (i.e. x1 <= 40), that
blows all my rows, and I don't have enough left to do 
the linear combinations.

It seems like I must be mis-understanding something about
quadprog, because it seems like my problem is perfect
for a structured approach (I can compute Hx quickly, etc, 
etc).

If I want to stick with MATLAB (and not NAG, or TOMLAB),
am I reduced to using fmincon, which seems like overkill,
even though it does have the advantage that I can pass
in arbitrary numbers of constraints, and gradients and
such, since I know all that information?




Thanks for any clues,


Eric