# Slightly clearer, hopefully:

I would like to plot Solve[Normal[Series[E^(n x), {x, 0, n}]] == 0 for incrementally increasing n, and show all plots overlayed. Here is my effort with up to n=63 using this code:

...Very time consuming though, & I would really like to find a way of plotting it (& similar plots) up to any n without the labour-intensive copying & pasting.

• Also, it's good to explain in words what you are doing instead of just posting a piece of code to decode first (!) and then improve. Commented Nov 10, 2013 at 23:02
• Please see link to my other question for further details: math.stackexchange.com/questions/554964/… Commented Nov 10, 2013 at 23:35
• Thanks for the link. It would be useful to incorporate the relevant parts into this question so that users have the full picture here instead of having to follow links :)
– rm -rf
Commented Nov 10, 2013 at 23:40
• There's an error in your statement. You seem to be plotting x/n, not simply x. Alternatively one can solve for the zeros of the partial sums for E^(n x). Commented Nov 11, 2013 at 1:17
• @ Michael E2, Thankyou very much :) - Yes, sorry for the error - forgot to mention rescaling:) Commented Nov 11, 2013 at 1:34

Here's a way that's fast but inaccurate. Some of the roots it finds for large n are wrong.

roots = Table[
x /. NSolve[Normal[Series[E^(n x), {x, 0, n}]] == 0, x], {n, 200}]; // AbsoluteTiming
(* {2.441688, Null} *)

For accuracy set WorkingPrecision (a small amount will do), but it takes much more time:

roots = ParallelTable[
x /. NSolve[Normal[Series[E^(n x), {x, 0, n}]] == 0, x,
WorkingPrecision -> 10], {n, 200}]; // AbsoluteTiming
(* {137.021271, Null} *)

To visualize, we convert the roots to points. Packing the array is optional -- it will be packed when the graphics are displayed, if it is not pre-packed.

pts = Developer`ToPackedArray @ N[Flatten[roots] /. z_Real | z_Complex :> {Re[z], Im[z]}];

Here is the output on the more accurate calculation of the roots.

Manipulate[
Graphics[
GraphicsComplex[pts,
{PointSize[Tiny],
Dynamic @ Point[Range @ Length @ Flatten[roots[[;; n]]]]}],
Frame -> True, PlotRange -> 1],
{n, 1, Length @ roots, 1}
]

The original Manipulate -- somewhat more straightforward but slower, as it converts the roots to points at every update:

Manipulate[
Graphics[{PointSize[Small],
Point[Flatten[roots[[;; n]]] /. z_Real | z_Complex :> {Re[z], Im[z]}]},
Frame -> True, PlotRange -> 1],
{n, 1, Length @ roots, 1}
]
• @ Michael E2 - Great - I am getting slight problems with numerical error towards the end, but I can live with that! - Zeros should really be entering curve at all :) Commented Nov 11, 2013 at 1:50
• Just out of interest, how would I increase the precision of the calculations? Have tried {Re[z], Im[z]},50], but doesn't seem to affect it. Commented Nov 11, 2013 at 1:56
• Realise I will lose performance - just curious for static example. Commented Nov 11, 2013 at 1:58
• NSolve has a WorkingPrecision option. WorkingPrecision -> 10 took 454 sec., but eliminated the points on x, y axes that encroach on the interior. It's a good candidate for ParallelTable. Commented Nov 11, 2013 at 2:04
• Great - thank you for your help on this :) Commented Nov 11, 2013 at 2:04