Skip to main content
Adding version tag
Link
CA Trevillian
  • 3.4k
  • 2
  • 8
  • 26
Source Link

Export the real roots of an equation

I wish to find the roots of y (with only its real part) for different values of r in range 1(0.01)30. I have tried the following:

b = 2.6666;
Pr = 10;
y = Roots[x^3 + x^2 (1 + b + Pr) + x (b + b (r - 1) + Pr*b) + 2*Pr*b (r - 1) == 0, x];
q1 = y /. {r -> {0}}
q2 = y /. {r -> {0.01}}
q3 = y /. {r -> {0.02}}
q4 = y /. {r -> {0.03}}

Is there a neater way to do this? Also, I want to export these roots to an excel sheet as shown here: enter image description here