MathGroup Archive 2012

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

Search the Archive

Re: domain restriction in NSolve does not work


I believe that this capability was added starting with version 8.

NSolve[x^5 - 2 x + 3 == 0, x, Reals]

{{x -> -1.42361}}

Works on my Mac with either version 8 or 9. You can also use

Select[NSolve[x^5 - 2 x + 3 == 0, x],
 FreeQ[#, Complex] &]

{{x -> -1.42361}}

Select[NSolve[x^5 - 2 x + 3 == 0, x],
 Element[x /. #, Reals] &]

{{x -> -1.42361}}

Select[NSolve[x^5 - 2 x + 3 == 0, x],
 Element[#[[1, -1]], Reals] &]

{{x -> -1.42361}}


Bob Hanlon


On Fri, Nov 30, 2012 at 5:56 AM,  <niieldo at googlemail.com> wrote:
> Dear all,
>
> I have encountered the problem that restricting domains in NSolve does not work.
> I get the same results for NSolve[x^5 - 2 x + 3 == 0, x, Reals] as with NSolve[x^5 - 2 x + 3 == 0, x], namely {{x -> -1.42361}, {x -> -0.246729 - 1.32082 I}, {x -> -0.246729 +
>     1.32082 I}, {x -> 0.958532 - 0.498428 I}, {x ->
>    0.958532 + 0.498428 I}}
>
> I.e. Mathematica actually does not apply the restriction.
>
> Does anyone have a solution for this? Do I have to adjust the settings somewhere?
>
> many thanks in advance
> Niels
>
>



  • Prev by Date: Worldplot package
  • Next by Date: Re: GraphicsGrid with annotated LayeredGraphPlot
  • Previous by thread: Re: Worldplot package
  • Next by thread: Re: GraphicsGrid with annotated LayeredGraphPlot