0
$\begingroup$

Hi guys I have the following function

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

and I want to find the maximum value of it.

I tried the following method in Mathematica.

R = k^2 HeavisideTheta[t] Exp[ -2 k^2 Sin[(t)/2]^2 ](-Sin[2t] - Sin[t](1-k^2 Sin[t]^2));
criticalPoints = Solve[D[R,t] == 0 && 0 <= t <= 2 Pi, t];
maxValue = MaxValue[R, t] /. criticalPoints;

However, it seems it does not work with Solve. I tried Findinstance and Reduce which are even more confusing.

I appreciate it if you could help me.

$\endgroup$
3
  • $\begingroup$ What is the range of values for $k$ ? Can we use a number for it? What is pixx ? $\endgroup$ Commented Sep 29, 2023 at 7:47
  • $\begingroup$ Hi Vitaliy. Sorry for the confusion. I corrected my mistake. K is an independent variable. It is the wavenumber in my calculations so it can be 10, 20, etc. $\endgroup$
    – Lohrasb
    Commented Sep 29, 2023 at 7:51
  • $\begingroup$ If you keep $k$ in numeric form you can get a solution easily. $\endgroup$ Commented Sep 29, 2023 at 7:56

2 Answers 2

1
$\begingroup$

This can be done as follows (The distribution HeavisideTheta is of no importance here. ).

f[k_?NumericQ] := Maximize[{Exp[-2 k^2 Sin[(t)/2]^2] (-Sin[2 t] - 
Sin[t] (1 - k^2 Sin[t]^2)), t >= 0 && t <= 2*Pi && k > 0}, t]
f[1]

{E^(-2 Sin[2 ArcTan[Sqrt[ Root[3 - 144 # + 612 #^2 - 816 #^3 + 946 #^4 - 816 #^5 + 612 #\ ^6 - 144 #^7 + 3 #^8& , 4, 0]]]]^2) (-Sin[4 ArcTan[Sqrt[ Root[3 - 144 # + 612 #^2 - 816 #^3 + 946 #^4 - 816 #^5 + 612 #\ ^6 - 144 #^7 + 3 #^8& , 4, 0]]]] + Sin[4 ArcTan[Sqrt[ Root[3 - 144 # + 612 #^2 - 816 #^3 + 946 #^4 - 816 #^5 + 612 #\ ^6 - 144 #^7 + 3 #^8& , 4, 0]]]]^3 - Sin[8 ArcTan[Sqrt[ Root[3 - 144 # + 612 #^2 - 816 #^3 + 946 #^4 - 816 #^5 + 612 #\ ^6 - 144 #^7 + 3 #^8& , 4, 0]]]]), {t -> 4 ArcTan[Sqrt[ Root[3 - 144 # + 612 #^2 - 816 #^3 + 946 #^4 - 816 #^5 + 612 #\ ^6 - 144 #^7 + 3 #^8& , 4, 0]]]}}

f[1.]

{1.10567, {t -> 5.68091}}

Plot[f[k] // First, {k, 0, 2}]

enter image description here

$\endgroup$
2
  • $\begingroup$ I appreciate your help. Your code snippet provides the maximum of the first recurrence of the function. Am I right? $\endgroup$
    – Lohrasb
    Commented Sep 29, 2023 at 8:24
  • $\begingroup$ @Lohrasb: Yes, I think you are right. $\endgroup$
    – user64494
    Commented Sep 29, 2023 at 8:27
0
$\begingroup$

If "k" is an input for this function then, this may be helpfull

k=1;
 f = Maximize[{Exp[-2 k^2 Sin[(t)/2]^2] 
(-Sin[2 t] - Sin[t] (1 - k^2 Sin[t]^2)), 
 t >= 0 && t <= 2*Pi}, t] // N

The output is

{1.10567, {t -> 5.68091}}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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