Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
2  
What do you mean by " replacing , I} with },"? –  Kuba Oct 17 '13 at 7:06
1  
({Re@z, Im@z} /. sol) // ListPlot ? –  Kuba Oct 17 '13 at 7:28
1  
Am I missing something: what's the purpose of using Table here? Why not just Solve[N@BernoulliB[10, z] == 0, z]? –  murray Oct 17 '13 at 14:33
add comment

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer
    
@ Kuba Many thanks! This has saved me a great deal of time! –  martin Oct 17 '13 at 7:53
    
And congratulations on 10k. Really fast! –  cormullion Oct 17 '13 at 7:56
    
@cormullion Thank you, I enjoy being here :) Fast?, take a look at ybeltukov's rate :P –  Kuba Oct 17 '13 at 8:00
add comment

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

share|improve this answer
    
@ Murray Many thanks for your comment - will look into it. –  martin Oct 17 '13 at 17:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.