Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Optimization using Heaviside function
Date: Sun, 13 Jun 2010 20:25:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <hv3er0$nk2$1@fred.mathworks.com>
References: <hv34vv$91u$1@fred.mathworks.com> <hv37q2$psk$1@fred.mathworks.com> <hv38rn$sfv$1@fred.mathworks.com> <hv3clj$eua$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1276460704 24194 172.30.248.38 (13 Jun 2010 20:25:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 13 Jun 2010 20:25:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:644604

  (Ignoring the as yet unspecified Q0,) you have discontinuities along the x1 axis only at 0 and 5, and along the x2 axis at 0 and 19.  Define

 x1 = [0-1,(0+5)/2,5+1];
 x2 = [0-1,(0+19)/2,19+1];

Now evaluate Q-P-L at each of the nine combinations of values in x1 and x2.  That is, at

 [X1,X2] = meshgrid(x1,x2);

and select the maximum of these nine Q-P-L values.

  As long as your function consists only of constant rectangular regions as in the case you have described, this kind of procedure should be all that is necessary to find the maximum.  It is only when the total number of combined discontinuities are too large for practical computation that more heroic methods become necessary.

Roger Stafford