Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Complex solutions to simple equations

8 views
Skip to first unread message

dragonman

unread,
Nov 7, 2009, 6:48:53 AM11/7/09
to
I want the solutions to x^n=1 to appear in the form r(cos theta +isin
theta) and then to graph them on an Argand diagram. Any advice given
would be much appreciated.

Mark McClure

unread,
Nov 8, 2009, 6:51:06 AM11/8/09
to

Here are the solutions to such an equation in
the form you want.
sols = ExpToTrig[z /. Solve[z^99 == 1, z]]

And here they are in the plane.
ListPlot[Table[{Re[z], Im[z]}, {z, sols}],
AspectRatio -> Automatic]

Mark McClure

Murray Eisenberg

unread,
Nov 8, 2009, 6:51:40 AM11/8/09
to
My Mathematica notebook

nthRoots.nb

may help you. You can download it from the Files page at my web site:

http://www.math.umass.edu/~murray/Math_421_Eisenberg/

For its graphics, that notebook relies upon David Park's "Presentations"
Mathematica application. In case that's not available to you, on that
same Files page I have a pdf version of the evaluated notebook.

dragonman wrote:
> I want the solutions to x^n=1 to appear in the form r(cos theta +isin
> theta) and then to graph them on an Argand diagram. Any advice given
> would be much appreciated.
>

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

David Bailey

unread,
Nov 8, 2009, 7:10:43 AM11/8/09
to
Didn't your teacher tell you how to do this, or give you a reading list?

This board is not here to answer homework questions - what would be the
point?

David Bailey
http://www.dbaileyconsultancy.co.uk

ynb

unread,
Nov 9, 2009, 5:45:40 AM11/9/09
to

RootPlotStyle[poly_, z_] :=
ListPlot[{Re[z], Im[z]} /.
NSolve[poly == 0, z], AspectRatio ->
Automatic, PlotStyle ->
{PointSize[0.06], Hue[0.8521]}] /;
PolynomialQ[poly, z]

n = 7;
poly = z^n - 1;
sol = Solve[poly == 0, z] /.
(a_ -> b_) :> a -> ComplexExpand[b];
z /. sol
RootPlotStyle[poly, z]

n = 24;
poly = z^n - 1;
sol = Solve[poly == 0, z] /.
(a_ -> b_) :> a -> ComplexExpand[b];
TableForm[z /. sol]
RootPlotStyle[poly, z]

dragonman

unread,
Nov 9, 2009, 5:55:37 AM11/9/09
to

For goodness sake I am a teacher. Feel free to google me. Its
Mathematica's representation of solutions I wanted. Feel free to
apologise any time.
Many thanks to the helpful posters above.

David Park

unread,
Nov 10, 2009, 5:57:34 AM11/10/09
to
I generated a solution using Presentations. It should appear in a few days
on Peter Linday's site:

http://blackbook.mcs.st-and.ac.uk/~Peter/djmpark/html/

at the University of St Andrews School of Mathematics and Statistics:

http://www.mcs.st-and.ac.uk/

There are both Mathematica notebooks and PDF files there for solutions to
various MathGroup questions.

The solution uses the ComplexPolar representation of complex numbers that is
in Presentations. There are also routines for expanding ComplexPolar
expressions and for converting to and from Cartesian form. This is often
used in the introductory part of a complex analysis course and then dropped
for the exponential representation. The polar notation is however quite
useful in calculations, for displaying complex numbers and in Presentations
for specifying iterators in polar plots. And, of course, it is also useful
for didactic purposes.


David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/

AES

unread,
Nov 10, 2009, 6:01:30 AM11/10/09
to
In article <hd8sf9$5vo$1...@smc.vnet.net>,
dragonman <morrisn...@gmail.com> wrote:

>
> For goodness sake I am a teacher. Feel free to google me. Its
> Mathematica's representation of solutions I wanted. Feel free to
> apologise any time.
> Many thanks to the helpful posters above.

A very nice reply! -- and one I'd hope may have some impact on this
group.

Out of curiosity, did your personal background or vocabulary
(pre-Mathematica) include some conceptual understanding of any of the
terms

local vs global variables
functional vs procedural programming
mapping

as they are used in Mathematica?

dragonman

unread,
Nov 10, 2009, 6:02:13 AM11/10/09
to
On Nov 9, 9:55 pm, dragonman <morrisneedle...@gmail.com> wrote:
> On Nov 8, 11:10 pm, David Bailey <d...@removedbailey.co.uk> wrote:
>
> For goodness sake I am a teacher. Feel free to google me. Its
> Mathematica's representation of solutions I wanted. Feel free to
> apologise any time.
> Many thanks to the helpful posters above.

I am a teacher.

DrMajorBob

unread,
Nov 10, 2009, 6:09:11 AM11/10/09
to
RootPlotStyle cuts off some points at the edges of the plot, so I'll
suggest a small improvement or two.

RootPlotStyle[poly_, z_, ptsize_] :=
Module[{pts = {Re[z], Im[z]} /. NSolve[poly == 0, z], limits},
limits = (ptsize {-1, 1} + Through[{Min, Max}@#]) & /@
Transpose@pts;
ListPlot[pts, AspectRatio -> Automatic,
PlotStyle -> {PointSize[ptsize], Hue[0.8521]}, PlotRange -> limits]
] /; PolynomialQ[poly, z]

n = 7;
poly = z^n - 1;
sol = Solve[poly == 0, z] /. (a_ -> b_) :> a -> ComplexExpand[b];
z /. sol

RootPlotStyle[poly, z, .06]

and

n = 24;
poly = z^n - 1;
sol = Solve[poly == 0, z] /. (a_ -> b_) :> a -> ComplexExpand[b];

Grid@Partition[z /. sol // Simplify, 4]
RootPlotStyle[poly, z, .06]

Bobby

On Mon, 09 Nov 2009 04:45:22 -0600, ynb <wkfk...@yahoo.co.jp> wrote:

> On 11=E6=9C=887=E6=97=A5, =E5=8D=88=E5=BE=8C8:48, dragonman
> <morrisneedle.. .@gmail.com> wrote:

> RootPlotStyle[poly_, z_] :=
> ListPlot[{Re[z], Im[z]} /.
> NSolve[poly == 0, z], AspectRatio ->
> Automatic, PlotStyle ->
> {PointSize[0.06], Hue[0.8521]}] /;
> PolynomialQ[poly, z]
>
> n = 7;
> poly = z^n - 1;
> sol = Solve[poly == 0, z] /.
> (a_ -> b_) :> a -> ComplexExpand[b];
> z /. sol
> RootPlotStyle[poly, z]
>
> n = 24;
> poly = z^n - 1;
> sol = Solve[poly == 0, z] /.
> (a_ -> b_) :> a -> ComplexExpand[b];
> TableForm[z /. sol]
> RootPlotStyle[poly, z]
>


--
DrMaj...@yahoo.com

David Bailey

unread,
Nov 11, 2009, 4:31:27 AM11/11/09
to
Well I am sorry if I made a mistake here, but we do get a fair few
students trying to get homework questions answered here. The usual
response to such questions is along the lines of my original reply.

What do you think we should do with such questions, AES - simply reply
regardless?

David Park has given a solution, so I guess there is nothing more to be
said.

David Bailey
http://www.dbaileyconsultancy.co.uk

Andrzej Kozlowski

unread,
Nov 12, 2009, 6:09:56 AM11/12/09
to

On 11 Nov 2009, at 18:30, David Bailey wrote:

> Well I am sorry if I made a mistake here, but we do get a fair few
> students trying to get homework questions answered here. The usual
> response to such questions is along the lines of my original reply.
>
> What do you think we should do with such questions, AES - simply reply
> regardless?
>
> David Park has given a solution, so I guess there is nothing more to be
> said.
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>

I will like to add that it is a matter of basic courtesy for someone posting a question to insure that:

(i) anyone answering it will not have to go into avoidable trouble of re-reformulating it using proper Mathematica syntax, guess missing data etc., etc.

(ii) the reasons for asking a question, be it research, commercial work or homework assignments etc. are clearly explained.

Nowadays I usually ignore questions that do not satisfy these conditions. I wish more people adopted a similar policy - answering certain kinds of questions may actually be doing more harm than good.

In other words, I think in this case David Bailey did exactly the right thing and has no need at all to apologise.

Andrzej Kozlowski

DrMajorBob

unread,
Nov 13, 2009, 5:56:00 AM11/13/09
to
> I will like to add that it is a matter of basic courtesy for someone
> posting a question to insure that:
...

> (ii) the reasons for asking a question, be it research, commercial work
> or homework assignments etc. are clearly explained.

Seeing that in every post would be a lot of bother, and the issue doesn't
matter to me.

> In other words, I think in this case David Bailey did exactly the right
> thing and has no need at all to apologise.

Agreed. Even if David did the wrong thing, he's helping people for free,
with no compensation of any kind. To anyone who is unsatisfied, my advice
is: "Treat yourself to a full refund. No... make it a DOUBLE refund."


On both points, Steve Christensen makes the rules; nobody else.

Bobby

On Thu, 12 Nov 2009 05:08:20 -0600, Andrzej Kozlowski <ak...@mimuw.edu.pl>
wrote:


--
DrMaj...@yahoo.com

dragonman

unread,
Nov 15, 2009, 5:59:57 AM11/15/09
to
As i said above a genuine thank you to all who offered advice. I gave
a small presentation on complex numbers at a teacher's conference this
week.

I guess my snappy tone was a fatigued response to someone who at the
time, I felt was making a harsh response to me. Thanks to all.

0 new messages