Mathematica Solving Real Roots with NSolve and Plotting a Bifurcation Diagram

AI Thread Summary
To find only the real roots using NSolve in Mathematica, the function Cases can be applied to filter the results, as demonstrated in the provided example. The command "Cases[x /. NSolve[(x - 1)(x^2 + 3)(x^4 + 5) == 0, x], _Real]" successfully extracts the real root, which is 1. For plotting a bifurcation diagram, users are encouraged to explore specific functions or resources that facilitate this visualization. A link to relevant bifurcation resources is shared for further assistance. The discussion focuses on effectively isolating real roots and generating bifurcation diagrams in Mathematica.
jemma
Messages
35
Reaction score
0
Hi, I'm using NSolve in Mathematica but I only want to find the roots that are real numbers as my answer gives a lot of imaginary numbers. How can I do this?

I want to then plot a birfucation diagram using a table of data. Is there a function to do this?

Thanks!
 
Physics news on Phys.org
In[1]:=x /. NSolve[(x - 1)(x^2 + 3)(x^4 + 5) == 0, x]
Out[1]={-1.05737 - 1.05737*I, -1.05737 + 1.05737*I, -3.81167*^-27 - 1.73205*I,
-3.81167*^-27 + 1.73205*I, 1., 1.05737 - 1.05737*I, 1.05737 + 1.05737*I}

In[2]:=Cases[x /. NSolve[(x - 1)(x^2 + 3)(x^4 + 5) == 0, x], _Real]
Out[2]={1.}

http://search.wolfram.com/?query=bifurcation&x=5&y=4
 

Similar threads

Replies
3
Views
3K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
9
Views
12K
Replies
6
Views
4K
Back
Top