From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to solve this non-convex quadratically constrained quadratic programming
Date: Thu, 19 Apr 2012 12:25:07 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <jmp073$1ac$>
References: <3072521.689.1334707719706.JavaMail.geo-discussion-forums@ynmm9> <jmljp0$jbi$> <16329087.1512.1334757550839.JavaMail.geo-discussion-forums@ynmm10> <jmofmi$q63$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1334838307 1356 (19 Apr 2012 12:25:07 GMT)
NNTP-Posting-Date: Thu, 19 Apr 2012 12:25:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:765164

David is correct in many points.

1) The intersection of the two spheres is a sphere of dimension - 1. So the problem can reduce to two independent maximization with constraint 1, constraint 2, constraint 1 & 2.

2) The method is based on Lagrange multiplier

3) To change minimization to maximization, change the line #51 of spherelsq.m (FEX mentioned above) to 

lambda = max(lambda);

That is it!