0
$\begingroup$

I think my question should be simple but I couldn't figure out a nice way to do it. I want to find zeros of a complex function (variable $z$) with real parameters ($\nu$, $\alpha$, $\xi$). My goal is to observe the behavior of zeros when the parameters are changing. The approach I can think of with my little Matematica knowledge and putting together some codes from the manual is to use NSolve to find the zeros for fixed parameters, plot and nest all of this inside Manipulate to be able to change my parameters. However, this returns some errors. Apparently, NSolve tries to solve the equation before parameters are fixed. Many attempts but couldn't figure out how to achieve what I want nicely.

My attempt (I fixed my parameters to take discrete value for the sake of computation time, If possible I wish to optimize the code to be able to allow continuous changing without a lot of delays and lagging) :

   Manipulate[
 zeros = z /. 
   NSolve[6 \[Alpha] (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[
            z]) + (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[z])^3 == 0 &&
      Abs[z] <= 3, z];
 ComplexListPlot[zeros, PolarAxes -> True, 
  Sequence[PolarTicks -> {Range[0, 3 (Pi/2), Pi/2], Range[3]}, 
   PolarAxesOrigin -> {Pi/8, 3}, PolarGridLines -> Automatic, 
   PlotStyle -> Directive[Blue, PointSize[0.012]]]],
 {\[Alpha], {-0.0001, 0, 0.0001}}, {\[Nu], {-2, -1, 0, 1, 
   2}}, {\[Xi], {-2, -1, 0, 1, 2}}]
$\endgroup$
2
$\begingroup$

Here is your corrected code, try to understand it. Note that the zeros are mostly real. And if they are complex, the imaginary part is very small. Maybe you want to change the parameters?

Manipulate[
 zeros = NSolve[{6 \[Alpha] (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[
              z]) + (2 z \[Alpha] + \[Xi] - \[Nu] Conjugate[z])^3 == 
        0 && Abs[z] <= 3}, z][[All, 1, 2]] // Quiet;
 Column[{ComplexListPlot[zeros, PolarAxes -> True, 
    Sequence[PolarTicks -> {Range[0, 3 (Pi/2), Pi/2], Range[3]}, 
     PolarAxesOrigin -> {Pi/8, 3}, PolarGridLines -> Automatic, 
     PlotStyle -> Directive[Blue, PointSize[0.02]]], 
    AspectRatio -> Full]
   , "Zeros:", zeros}]
 , {\[Alpha], -10^-4, 10^-4}
 , {\[Nu], -2, 1}, {\[Xi], -2, 2}, 
 TrackedSymbols -> {\[Alpha], \[Nu], \[Xi]}]

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