3
$\begingroup$

I'm interested in plotting solutions of systems of polynomials in the complex plane, in the following way.

Let $f_1,\ldots f_s$ be complex polynomials in variables $x_1,\ldots x_n$. I know how to find the solutions using a code like this

eqs = {x^2 + y^3 + 1 == 0, x + y^2 - 1 == 0}
pts = Solve[eqs, {x, y}]

But I'm having some trouble to plot the values of $x,y$ n the complex plane. I tried some naive thing like

ListPlot[pts]

but nothing works. I'm lost, any help is welcome, thanks.

$\endgroup$
  • $\begingroup$ Get them using {x, y} /. % $\endgroup$ – Mahdi Apr 8 '15 at 3:19
  • $\begingroup$ I forgot a little detail in my answer, sorry. It's corrected. $\endgroup$ – Integral Apr 8 '15 at 3:21
  • $\begingroup$ A math problem: If you have ${x,y}$ as a point and $x$ and $y$ are complex, how does one show them on complex plane? $\endgroup$ – Mahdi Apr 8 '15 at 3:30
  • $\begingroup$ $x$ is one point and $y$ is another, their are not considered as coordinates. $\endgroup$ – Integral Apr 8 '15 at 3:33
  • 1
    $\begingroup$ A related thread. $\endgroup$ – J. M. will be back soon Nov 21 '15 at 19:34
3
$\begingroup$

You have

eqs = {x^2 + y^3 + 1 == 0, x + y^2 - 1 == 0};
pts = Solve[eqs, {x, y}];

To get the data points and the plot:

data = {x, y} /. pts // Flatten;
ListPlot[{Re[#], Im[#]} & /@ data]
$\endgroup$
  • 1
    $\begingroup$ I think it's perfect! $\endgroup$ – Integral Apr 8 '15 at 3:45
  • $\begingroup$ Do you mind just explain a little (or recommend some reading) what #,&,/ and @ stands for? $\endgroup$ – Integral Apr 8 '15 at 3:47
  • $\begingroup$ Thanks! /@ is shorthand for Map. It basically maps {Re[#], Im[#]} over all elements in data one by one. This page is really good to start! $\endgroup$ – Mahdi Apr 8 '15 at 3:53
4
$\begingroup$

Starting from version 10.1 you can use ReIm:

eqs = {x^2 + y^3 + 1 == 0, x + y^2 - 1 == 0};
pts = {x, y} /. Solve[eqs, {x, y}];

ListPlot[ReIm[pts]]

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Or even ListPlot@ReIm@Values@Solve[eqs, {x, y}]. $\endgroup$ – Michael E2 Nov 21 '15 at 14:35
  • $\begingroup$ @MichaelE2, hi, please let me know what do you think about this question : mathematica.stackexchange.com/questions/206901/… . Do you think it’s some how related? $\endgroup$ – S.S. Sep 26 at 15:10
  • $\begingroup$ I have Mathematica 9. $\endgroup$ – S.S. Sep 26 at 15:12

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.