MathGroup Archive 2007

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

Search the Archive

Re: How to choose real positive solutions?


mandix schrieb:
> Hi,
> suppose I want to solve a system of 3 equations and 3 unknowns
> (polynomial of degree whatever, say n). Is there a way to tell NSolve
> to return only real and positive solutions (and ignore the rest)?
>
> thanks you so much,
>
> Manfred
>
Manfred,

first define a pattern which matches complex Numbers e.g:

MuComplex= _?(!FreeQ[Chop[N[#],10^-13],_Complex]&)

then do:
DeleteCases[NSolve["whatever"],MuComplex]

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: a definite integral
  • Next by Date: Two successive FindMinimum -> Bug?
  • Previous by thread: Re: How to choose real positive solutions?
  • Next by thread: Re: How to choose real positive solutions?