MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Eliminate Complex Roots

  • To: mathgroup at
  • Subject: [mg64348] Eliminate Complex Roots
  • From: bghiggins at
  • Date: Mon, 13 Feb 2006 03:15:07 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Hi All,

Suppose I have the following equation and I want to plot the real roots
using Plot as a function of the parameter b

a^3 + 10*a^2 - 15*a + b == 0

For the problem I am interested I have a set of algebraic equations of
at least order 3, but this is simpler enough to explain what the issue

Now if I want just the Real root I can do the following:

Sol2[b_] := DeleteCases[Solve[a^3 + 10.*a^2 - 15*a + b ==
     0, a], {___, x_ -> Complex[y_, z_], ___}]

and evaluating


{{a -> -11.46104034060055}}

Gives the desired result. So far so good. Now suppose I want to plot
the solutions asa function of b. My immediate thought was to try

Plot[Evaluate[a /. Sol2[b]], {b, -10, 30}, PlotStyle -> {Red, Blue,

This does give the desired result, but gives error messages when it
tries to plot a complex quantity. That is the DeleteCases does not seem
to work within Plot, even though I wrapped everything with evaluate.

Any suggestions?

Thanks much


  • Prev by Date: Re: Awesome PDF writer
  • Next by Date: Exporting Density Plots -- one pixel per point?
  • Previous by thread: Re: Re: Mathematica:recursion with 2 arguments?
  • Next by thread: Re: Eliminate Complex Roots