5

How do I extract the real part of a substitution expression from FindRoot or Solve? Or alternately, how do I insist that they return real results?

For example, FindRoot returns something of the form:

{x->A + B I}

Analytically, I know that x must be real. Because B is 17+ orders of magnitude smaller than A, I assume it's numerical slop.

If I do:

Re[FindRoot[expr, {x, guess}]]

it simply returns:

Re[{x->A + B I}]

Assumptions aren't helping:

Assuming[Element[x, Reals], FindRoot[expr, {x, guess}]] ]

still returns x with a small imaginary component. Any suggestions?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Paul T.
  • 205
  • 1
  • 9

1 Answers1

5
Chop[FindRoot[expr, {x, guess}]]
Ivan
  • 2,207
  • 15
  • 25