2

Update

Solve[N[Table[BernoulliB[n, z], {n, 10, 10}] == 0]]
{{z -> -0.5841145496910024` - 0.435309007896589` I}, <<4>>}

I am then finding and replacing z -> with blank to get :

{{-0.5841145496910024` - 0.435309007896589` I}, <<4>>}

I am then finding and replacing ` I} with } to get :

{{-0.5841145496910024`-0.435309007896589}, <<4>>}

I am then finding and replacing ' with , to get :

{{-0.5841145496910024, -0.435309007896589}, <<4>>}

My question is, is there a way of doing this without all of the find & replace business?


Old

I am generating a list from :

Solve[N[Table[BernoulliB[n, z], {n, 100, 100}] == 0]]

And then manually finding and replacing elements in the generated list such as z -> with Blank, then finding and replacing , I} with }, and so on. I am then producing a list plot form the resultant array. Is there a way of automating this process and producing a list plot directly?

Kuba
  • 136,707
  • 13
  • 279
  • 740
martin
  • 8,678
  • 4
  • 23
  • 70

2 Answers2

4

First part of your question is answered in What are the most common pitfalls awaiting new users?.

How to plot complex points is described for example here.

What you need is what was my guess:

sol = Solve[N[Table[BernoulliB[n, z], {n, 10, 10}] == 0]];

{Re@z, Im@z} /. sol // ListPlot

enter image description here

Kuba
  • 136,707
  • 13
  • 279
  • 740
1

If you use David Park's Presentations add-on (http://home.comcast.net/~djmpark/DrawGraphicsPage.html), then there's no need for the artificial pulling apart of the complex roots into their real and imaginary parts; you can just treat complex numbers as complex numbers:

<< Presentations`

pts = z /. Solve[N@BernoulliB[10, z] == 0, z]
Draw2D[{PointSize[Medium], ComplexPoint /@ pts}, Axes -> True]

enter image description here

murray
  • 11,888
  • 2
  • 26
  • 50