8
$\begingroup$
Plot[{ArgMax[Cos[t] Sinc[2*Pi kl (Sin[t] - 1/Sqrt[2])], t]*180/Pi, 
  45}, {kl, 0, 10}, PlotRange -> Full]

enter image description here

I want to know what causes this, and how to fix it in case it happens in the future.

$\endgroup$
  • 2
    $\begingroup$ You can investigate this, for example, by looking at ContourPlot[Cos[t] Sinc[2 Pi kl (Sin[t] - 1/Sqrt[2])], {kl, 4, 6}, {t, -8, 8}, PlotRange -> All]. It seems pretty nasty... $\endgroup$ – kirma Apr 8 '16 at 11:11
9
$\begingroup$

As noted by kirma, this function is highly oscillatory. However, from its form it is periodic in t with period 2 Pi and has its maximum near Pi/4 except for small kl. For instance,

Plot[Evaluate[Cos[t] Sinc[2 Pi kl (Sin[t] - 1/Sqrt[2])] /. 
    kl -> Range[0, 2, 1/2]], {t, 0, 2 Pi}, PlotRange -> All]

enter image description here

Because ArgMax sometimes finds a local maximum instead of the global maximum, we can help it by adding a constraint that takes advantage of the fact (just shown) that the maximum lies between 0 and Pi/4.

Plot[{ArgMax[{Cos[t] Sinc[2*Pi kl (Sin[t] - 1/Sqrt[2])], 
    0 < t < Pi/2}, t]*180/Pi, 45}, {kl, 0, 10}, PlotRange -> Full]

enter image description here

as desired.

$\endgroup$

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.