4

I wish to locate all local maxima of the function $$f(x,y)=1 + Sinc[8*(x - 1)]*Sinc[10*(y - 1)]$$ on the domain $$\{(x,y):0\leq x\leq 2,0\leq y\leq 2\}.$$ The code only shows one of them:

FindMaximum[{1 + Sinc[8*(x - 1)]*Sinc[10*(y - 1)], 
  0 <= x <= 2.2 && 0 <= y <= 2.2}, {x, y}]

The following is my dream (but only for one variable function) in which the locations are also marked.

Thanks so much.

Binjiu
  • 435
  • 2
  • 6

1 Answers1

3

Try NSolve to find all of the extrema:

gln = D[1 + Sinc[8*(x - 1)]*Sinc[10*(y - 1)], {{x, y}}];
gln = Map[# == 0 &, gln {(x - 1)^2, (y - 1)^2} // Simplify] (* equation without singularity x=y=1*)

NSolve is able to solve these equations in the given range 0<x,y<2

extrema =NSolve[{gln, 0 <= x <= 2 && 0 <= y <= 2} // Flatten, {x, y}] //Normal;
extrema = Select[extrema, Length[#] == 2 &] (* only solution points {x,y}*)

Show[{Plot3D[1 + Sinc[8*(x - 1)]*Sinc[10*(y - 1)], {x, 0, 2.2}, {y, 0, 2.2},PlotStyle-> Opacity[.25], PlotRange -> All,MeshFunctions -> (#3 &), Mesh -> 50]
, Graphics3D[{Red,Point[{x, y, 1 + Sinc[8*(x - 1)]*Sinc[10*(y - 1)]} /. extrema]}]}]

enter image description here

Looking at the second derivatives filters out the maxima…

Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55