Topic: plotting complex numbers

Hi. I would like to know if there is a way of using Graph to plot complex numbers. I know i can plot z = x + iy using "insert point series", and specifying my x and y numbers, but i have to manually type in each individual number. Is there a way of specifying a range, and therefore being able to plot (say) 1 + iy, where i could specify the range of y, say from -5 to 5.

Also, is there a way of plotting things like z^2, since z^2 = (x^2 - y^2) + i(2xy), without having to manually  specify the value of x^2 - y^2 in the x column and 2xy in the y column of "insert point series" ?  Again i would like to be able to run "x^2 - y^2" and "2xy" automatically for a ranges of values of x and y, so that i could plot the coordinate (x^2 - y^2, 2xy), or any other coordinate based on complex number arithmetic. Can this be done ?

thanks

chris

Re: plotting complex numbers

If you want to plot the complex function f(t)=1+i*t with the real part on the x-axis and the imaginary part on the y-axis, you can plot it as the parametric function x(t)=re(1+i*t), y(t)=im(1+i*t). Calculate with complex numbers in the Edit axes dialog must be enabled.

For the second request, I think you can use custom functions. You can for example create the custom functions:

z_re(x, y)=x^2+y^2
z_im(x, y)=2x*y

Now you can create a point series like this:

z_re(5,2), z_im(5,2)
z_re(1,3), z_im(1,3)
z_re(3,2), z_im(3,2)

I know this is not what you hoped for, but I am afraid this is the best that can be done currently.

Re: plotting complex numbers

Thanks. I'll try it out.

Re: plotting complex numbers

hi. Would it be possible to include a new feature in the next Graph, specifically to plot a set of complex numbers based on stated expression for teh real and imaginary parts. I include a diagram of what a dialogue box could look like.

The aim would be to type in a complex number z = 1 + 2i, then type in the Re and Im parts of the function you want to map to (say z^2) in the "Re" and "Im" section shown.
Or you could specify a number z = x + 2i, and then specify the range over which you would want all numbers with Im(z) = 2, say specify x = -5 to 5. Then also specify the x step as say 1 (would plot -5 + 2i, -4 + 2i, ..., 4 + 2i, 5 + 2i), or whatever other step. Ditto for y range and y step.
If the mapping z^2 could be plotted on in a new window in Graph that would be nice, otherwise plot the mapping in the same window as z.

chris

Post's attachments

Attachment icon complex numbers dialogue box.jpg 31.11 kb, 328 downloads since 2012-02-09 

Re: plotting complex numbers

Graph 4.4, which is very close to being released, has support for plugins, which requires Python 3.2 to be installed. I think it is possible to use this to implement what you want as a plugin. You can try to do it yourself, else I will look into it when Graph 4.4 has been released and I find the time.

Re: plotting complex numbers

hi. I don't know if my reply came thorugh. I am not a programmer so i'd be grateful if you could look into it when you can. At the moment i am using Excel to do all the calculations for z^2 and other functions, then copying the two relevant columns of numbers into "insert point series"

thanks

Re: plotting complex numbers

I will look into it, but don't expect anything in the nearest future.