0
$\begingroup$

I have the following periodic function, as a function of K and t. I need to know what is the maximum of each recurrence as accurate as possible for k={10,20,40,60,80}

The equation is as follows,

$pixx = \exp(-2 k_x^2 \sin^2(\frac{t}{2})) k_x^2 \bigg[ -\sin(2t) - \sin(t) (1 - k_x^2 \sin^2(t)) \bigg]$

I plotted the function

i2k[i_] = 1/2 (i - 1)
Plot[pixx/.k->-i2k[19]/.t->t - 200 0.01//Evaluate, {t, 0, 2000 0.01}, PlotRange->All,PlotStyle->Red]

The plot of the function is

enter image description here

I tried to calculate the derivation of the function with respect to t and solve the equation, but it quickly became complicated.

I appreciate it if you could help me.

$\endgroup$
1
  • 1
    $\begingroup$ What did you try so far? Please provide Mathematica code! $\endgroup$ Commented Oct 12, 2023 at 7:47

2 Answers 2

3
$\begingroup$
$Version

(* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *)

Clear["Global`*"]

pixx[k_, t_] := 
 Exp[-2 k^2 Sin[t/2]^2] k^2 (-Sin[2 t] - Sin[t] (1 - k^2 Sin[t]^2))

The exact values for the maxima are

sol = Table[{k, 
    MaxValue[{pixx[k, t], 0 <= t <= 20}, t]}, {k, {10, 20, 40, 60, 80}}] // 
  RootReduce

enter image description here

The approximate numeric values are

sol /. x_Root :> N[x, 20]

(* {{10, 13.765054603281488227}, {20, 27.584271814377377514}, 
  {40, 55.195702134081809185}, {60, 82.80110232432505882}, 
  {80, 110.40499319161750507}} *)
$\endgroup$
2
$\begingroup$

1. Plot

Using FindPeaks with ListLinePlot

pixx = Exp[-2 k^2 * Sin[t/2]^2] * k^2 * (-Sin[2 t] - Sin[t] * (1 - k^2 Sin[t]^2));

i2k[i_] = 1/2 (i - 1);

pl = pixx /. k -> -i2k[19] /. t -> t - 200 * 0.01;

tab = Table[pl, {t, 0, 20, 0.01}];

pp = Rest @ FindPeaks[tab]

{{193, 12.3711}, {227, 3.31237}, {821, 12.379}, {855, 3.30927}, {1449, 12.3464}, {1484, 3.30291}}

ListLinePlot[tab,
 Epilog -> {Red, PointSize[Large], Point /@ pp},
 GridLines -> Automatic,
 ImageSize -> Large,
 PlotRange -> All,
 Ticks -> {{{500, 5}, {1000, 10}, {1500, 15}, {2000, 20}}, Automatic}]

enter image description here

2. Accurate values

To get more accurate values for t increase the table resolution:

tab = Table[pl, {t, 0, 20, 0.00001}];
pp = Rest @ FindPeaks[tab]

Transpose[{pp[[All, 1]]/100000., pp[[All, 2]]}] // MatrixForm

enter image description here

Compare the first row to

Maximize[{pl, t >= 0}, t]

{12.3809, {t -> 1.91779}}

$\endgroup$

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