MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Complex solutions to simple equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104785] Re: [mg104769] Re: Complex solutions to simple equations
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Tue, 10 Nov 2009 05:57:42 -0500 (EST)
  • References: <hd3mr5$9pv$1@smc.vnet.net> <200911091045.FAA05651@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

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 <wkfkh056 at yahoo.co.jp> wrote:

> On 11=E6=9C=887=E6=97=A5, =E5=8D=88=E5=BE=8C8:48, dragonman  
> <morrisneedle.. . at gmail.com> 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.
>
> 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]
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Mathematica skill level snippet(s)
  • Next by Date: Re: Re: Mathematica skill level snippet(s)
  • Previous by thread: Re: Complex solutions to simple equations
  • Next by thread: Re: Complex solutions to simple equations