4
$\begingroup$

How do I plot the following two sets in the complex plane: $C=\{z\in\mathbb{C}|z^4\in[0,16]\}$ and the set of solutions of equation $Re(\frac{2z+1}{z+1})>0$

Thanks in advance.

$\endgroup$
7
  • $\begingroup$ You should to submit bug reports to WTS: both ComplexRegionPlot[ Re[(2 z + 1)/(z + 1)] > 0, {z, -20 - 20*I, 20 + 20*I}] and ComplexContourPlot[ Im[z^4] == 0 && Re[z^4] >= 0 && Re[z^4] <= 10, {z, -5 - 5*I, 5 + 5*I}, PlotPoints -> 50] produce wrong results in 13.3.1 on Windows 10. $\endgroup$
    – user64494
    Nov 24, 2023 at 18:53
  • 2
    $\begingroup$ @user64494, there is no bug here and nothing to report. Either plot a smaller region, ComplexRegionPlot[Re[(2 z + 1)/(z + 1)] > 0, {z, 2}] or increase the number of points, ComplexRegionPlot[Re[(2 z + 1)/(z + 1)] > 0, {z, 20}, PlotPoints -> 100]. And your second example doesn't even make any sense (read the documentation on how to use ComplexContourPlot). $\endgroup$
    – Domen
    Nov 24, 2023 at 20:15
  • $\begingroup$ Could you convert to 2D for the first set? red = Reduce[0 <= z^4 <= 16, z, Complexes]; twoD = red /. {Re[z] -> x, Im[z] -> y}; reg = ImplicitRegion[twoD, {x, y}]; [RegionPlot[reg]] $\endgroup$
    – ydd
    Nov 24, 2023 at 20:36
  • $\begingroup$ @Domen: My second example does make sense: $C=\{z\in\mathbb{C}|z^4\in[0,16]\}$ is a co-lmage of the segment. This is a one-dimensional set in the complex plane so ComplexContourPlot should to draw it. $\endgroup$
    – user64494
    Nov 24, 2023 at 21:07
  • $\begingroup$ Domen: $C=[-2,2]\cup[-2i,2i]$ $\endgroup$
    – user64494
    Nov 24, 2023 at 21:16

2 Answers 2

3
$\begingroup$
ComplexRegionPlot[Re[(2 z + 1)/(z + 1)] > 0 && Abs[z^4] < 16, {z, 3}]

enter image description here

Read @Domen's comment that there might be some problems if you use larger region of plot which should be compensated by larger number of plot points by setting, say, PlotPoints -> 200.

To depict the regions separately replace && with , in the above code to get:

enter image description here

If the first set was not $|z^4|\in[0,16]$ but rather $z^4\in[0,16]$ then you can depict it as intersection of blue region with orange lines:

ComplexRegionPlot[0 <= Re[z^4] <= 16, {z, 3}, PlotPoints -> 200];
ContourPlot[{0, Im[z^4 /. z -> a + I b] == 0}, {a, -3, 3}, {b, -3, 3},
   PlotPoints -> 200];
Show[%%, %]

enter image description here

Yet another method which only depicts the actual intersection:

Reduce[0 <= Re[z^4] <= 16 && Im[z^4] == 0 /. z -> a + I b // 
   ComplexExpand, Reals];
Region[ImplicitRegion[%, {a, b}], Frame -> True, PlotRange -> 3]

enter image description here

$\endgroup$
2
  • $\begingroup$ Did you read "plot the following two sets in the complex plane" in the question? Pay your attention to "two sets". $\endgroup$
    – user64494
    Nov 24, 2023 at 21:03
  • $\begingroup$ Hope you understand that Abs[z^4] < 16 is not $C=\{z\in\mathbb{C}|z^4\in[0,16]\}$. Don't hurry and give wrong answers. $\endgroup$
    – user64494
    Nov 24, 2023 at 21:12
2
$\begingroup$
  • 0 <= z^4 <= 16 means that Im[z^4] == 0 and 0 <= Re[z^4] <= 16. Here we using ContourPlot+ RegionFunction to do this.
c = Block[{z = x + I*y}, 
  ContourPlot[Im[z^4] == 0, {x, -10, 10}, {y, -10, 10}, 
   PlotPoints -> 50, MaxRecursion -> 4, 
   RegionFunction -> Function[{x, y}, Evaluate[0 <= Re[z^4] <= 16]]]]
  • The same as using ComplexContourPlot+ RegionFunction
c=ComplexContourPlot[Im[z^4] == 0, {z, 10}, 
 RegionFunction -> Function[{z}, 0 <= Re[z^4] <= 16], 
 PlotPoints -> 60, MaxRecursion -> 4]

enter image description here

  • ReginPlot can also draw the region Re[(2 z + 1)/(z + 1)] > 0.
d = Block[{z = x + I*y}, 
  RegionPlot[
   Re[(2 z + 1)/(z + 1)] > 0 // Evaluate, {x, -10, 10}, {y, -10, 10}, 
   PlotPoints -> 50, MaxRecursion -> 4]]

enter image description here

Show[c,d]

enter image description here

$\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.