3
$\begingroup$

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.

$\endgroup$
3
$\begingroup$

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…

| improve this answer | |
$\endgroup$
  • $\begingroup$ Looking at the second derivatives filters out the maxima…and so what are your conclusions? $\endgroup$ – Artes Mar 2 at 15:22
  • $\begingroup$ @Artes My answer shows a way to find all extrema in the given range, not more! $\endgroup$ – Ulrich Neumann Mar 2 at 15:27
  • $\begingroup$ You have to find local maxima, not extrema or critical points. $\endgroup$ – Artes Mar 2 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.