1
$\begingroup$

I have the following function for which I want to know the range

FunctionRange[{1/
   32 (8 - Sqrt[(-8 - 36 Abs[y] (1 + 2 Sqrt[Abs[z]]) - 
        27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2)^2 - 
      64 (1 + Abs[y] + 2 Abs[y] Sqrt[Abs[z]])] + 
     36 Abs[y] (1 + 2 Sqrt[Abs[z]]) + 
     27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2), 
  0 < Abs[y] < 1 && 0 < Abs[z] < 1}, {Abs[y], Abs[z]}, t]

But once the code starts it just keeps on running with no output. I tried to use MaxValue and MinValue too so as to get the Range but that too doesn't seem to work. Is there any other way to find the range when the above options don't work?

$\endgroup$
2
$\begingroup$

This can be done by the change Abs[y] -> a^2, Abs[z] -> b^2 in order to obtain a polynomial in a and b as follows.

Maximize[{1/
 32 (8 - Sqrt[(-8 - 36 Abs[y] (1 + 2 Sqrt[Abs[z]]) - 
       27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2)^2 - 
    64 (1 + Abs[y] + 2 Abs[y] Sqrt[Abs[z]])] + 
  36 Abs[y] (1 + 2 Sqrt[Abs[z]]) +  27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2), 
   0 < Abs[y] < 1 && 0 < Abs[z] < 1 && Sqrt[Abs[y]] > 0 && 
Sqrt[Abs[z]] > 0} /.{Sqrt[Abs[y]]-> a,Sqrt[Abs[z]] -> b,Abs[y]->a^2,Abs[z] -> b^2}, {a, b}]
(*{1/4, {a -> 0, b -> Indeterminate}}*)

and the warning (not an error)

Maximize::natt: The maximum is not attained at any point satisfying the given constraints.

The result means that b may be an arbitrary value (of course, 0<b&&b<1. Making use of Minimize instead of Maximize, one obtains

(*{1/32 (359 - 35 Sqrt[105]), {a -> 1, b -> 1}}*)

and a similar warning. It remains to notice that the polynomial, being a continuous function, takes each value between its minimum value and maximum value on a (compact) set a>=0&&a<=1&&b>=0&&b<=1. Numeric calculations with NMaximize and NMinimize with Method->"DifferentialEvolutionconfirm those results. Summarizing the above, one may conclude that the range under consideration is $(\frac{1}{32} \left(359-35 \sqrt{105}\right),\frac 1 4)$.

$\endgroup$
2
  • 1
    $\begingroup$ I followed the similar idea as you, and then used FunctionRange as normal and it worked like a charm,thanks. $\endgroup$
    – Erosannin
    Jul 26 '20 at 15:33
  • $\begingroup$ @tany pathak: Indeed, FunctionRange[{1/ 32 (8 + 36 a^2 (1 + 2 b) + 27 (a^2 + 2 a^2 b)^2 - \[Sqrt](-64 (1 + a^2 + 2 a^2 b) + (-8 - 36 a^2 (1 + 2 b) - 27 (a^2 + 2 a^2 b)^2)^2)), a > 0 && b > 0 && a < 1 && b < 1}, {a, b}, y] performs $\frac 1{32} (359 - 35 \sqrt{105} < y < 1/4$. Thank you for another realization of my idea. $\endgroup$
    – user64494
    Jul 26 '20 at 16:45
0
$\begingroup$
expr = 1/32 (8 - 
     Sqrt[(-8 - 36 Abs[y] (1 + 2 Sqrt[Abs[z]]) - 
          27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2)^2 - 
       64 (1 + Abs[y] + 2 Abs[y] Sqrt[Abs[z]])] + 
     36 Abs[y] (1 + 2 Sqrt[Abs[z]]) + 
     27 (Abs[y] + 2 Abs[y] Sqrt[Abs[z]])^2);

Looking at the plot,

Plot3D[expr, {y, -1, 1}, {z, -1, 1},
 PlotPoints -> 100,
 MaxRecursion -> 5,
 ClippingStyle -> None,
 AxesLabel -> (Style[#, 14, Bold] & /@ {y, z, t}),
 WorkingPrecision -> 20,
 PlotRange -> All]

enter image description here

max = expr /. y -> 0

(* 1/4 *)

min = Min[
  Limit[expr, #] & /@ {{y -> -1, z -> -1}, {y -> -1, z -> 1}, {y -> 1,
      z -> -1}, {y -> 1, z -> 1}}]

(* 1/32 (359 - 35 Sqrt[105]) *)

min // N

(* 0.0111476 *)
$\endgroup$
1
  • $\begingroup$ One of the gaps in your answer is that in Limit[expr, #] & /@ {{y -> -1, z -> -1}, {y -> -1, z -> 1}, {y -> 1, z -> -1}, {y -> 1, z -> 1}}] you don't take into account 0 < Abs[y] < 1 && 0 < Abs[z] < 1. There are several other places built on the sand. $\endgroup$
    – user64494
    Jul 26 '20 at 13:04

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.