Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Quadratic Cost Function x^T Q x
Date: Thu, 20 May 2010 18:05:20 +0000 (UTC)
Organization: Imperial College London
Lines: 40
Message-ID: <ht3tl0$mbi$1@fred.mathworks.com>
References: <ht3lnt$92i$1@fred.mathworks.com> <ht3oj8$gpr$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1274378720 22898 172.30.248.37 (20 May 2010 18:05:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 May 2010 18:05:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1192337
Xref: news.mathworks.com comp.soft-sys.matlab:637696

"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <ht3oj8$gpr$1@fred.mathworks.com>...
> "Jason" <jf203@ic.ac.uk> wrote in message <ht3lnt$92i$1@fred.mathworks.com>...
> > Hello,
> > 
> > I have a (quadratic) non-linear problem of the type x^T Q x.
> > 
> > Specifically the non-convex objective function is given by
> > 
> > J = SUM ||x^T Qi x||^2
> > 
> > for i <= 3.
> > 
> > My goal is to find arg min x, i.e. the values for the vector x.
> ===============
> 
> The sum is over i? If so, it is trivial to see that  there is a global minimum at x=0.

Why is there a global minimum at x=0 ??

Maybe I haven't expressed myself right. Qi is a matrix of 3x3, x = column vector of length 3. The result should be 0 if the correct values for x are chosen.

What I mean with the sum is... x^T (Q_1 + Q_2 + ... Q_i) x

Let me show you the code to avoid confusion:

(Note that I need to feed in Q from another function since it changes, Q in this case is a cell of matrices Q.)


function F = opt_routine(x,sns,Q);
for i = 1:sns
    F(i) = (x.')*Q{i}*x;
end
end

We want to find the values for x so:
variable1 = @(x)opt_routine(x,sns,Q);

[x,res] = lsqnonlin(variable1,[] ....)

Ok ?