# How can I find minimum and maximum of a region?

I have a regionplot like the following:

m1 = 0.547;
m1p = 0.958;
m2 = 0.137;
r1 = Sqrt[m1^2 + (Sqrt[w1^2 - m2^2] + Sqrt[w2^2 - m2^2])^2] // Expand;
r2 = Sqrt[m1^2 + (Sqrt[w1^2 - m2^2] - Sqrt[w2^2 - m2^2])^2] // Expand;
RegionPlot[
m1p - w1 - w2 < Re[r1] &&
m1p - w1 - w2 > Re[r2], {w1, .1, .25}, {w2, .1, .25},
BoundaryStyle -> Blue, FrameLabel -> {"w1", "w2"}]


How can I find minimum and maximum of w1 and w2?

• Thanks for registering. Besides upvoting correct answers you can accept one answer to any of your questions which you find the best (by clicking a tickmark under the vote counter). Otherwise you should explain more exactly what you are expecting. For more information see mathematica.stackexchange.com/faq – Artes Jan 17 '13 at 9:51

If you're happy with your plot you can just recycle it :

rp = RegionPlot[m1p - w1 - w2 < Re[r1] && m1p - w1 - w2 > Re[r2], {w1, .1, .25}, {w2, .1, .25},
BoundaryStyle -> Blue, FrameLabel -> {"w1", "w2"}];

minw1 = Min@rp[[1, 1, All, 1]];
maxw1 = Max@rp[[1, 1, All, 1]];
minw2 = Min@rp[[1, 1, All, 2]];
maxw2 = Max@rp[[1, 1, All, 2]];

Show[rp,
Graphics[{Red, Line[{{minw1, 0}, {minw1, 0.5}}]}],
Graphics[{Red, Line[{{maxw1, 0}, {maxw1, 0.5}}]}],
Graphics[{Red, Line[{{0, minw2}, {0.5, minw2}}]}],
Graphics[{Red, Line[{{0, maxw2}, {0.5, maxw2}}]}]]


You can take an initial point in your plot region and feed it to functions like FindMinimum to search for a local minimum.

For example the max value of w2 (upper boundary of the region):

FindMinimum[{-w2,
m1p - Re[r1] < w1 + w2 < m1p - Re[r2]},
{{w1, 0.1424}, {w2, 0.2399}}]

{-0.244612, {w1 -> 0.142883, w2 -> 0.244612}}

• I tried NMinimize and didn't work too well. – b.gates.you.know.what Jan 16 '13 at 10:43
• @b.gatessucks I tried it too with no luck. For this kind of problems, I tend more and more to a local extremum searcher now. – Silvia Jan 16 '13 at 10:45