Re: How to choose real positive solutions only?
- To: mathgroup at smc.vnet.net
- Subject: [mg74470] Re: How to choose real positive solutions only?
- From: Terry <tharter at attglobal.net>
- Date: Thu, 22 Mar 2007 01:15:56 -0500 (EST)
Manfred,
Let's say that your complex answers are in a variable called 'ans'
that is a list of the form a-> x + iy
Then do something like
realAns := ans a/. Select[ans,(FreeQ[#,Complex])&]
HTH
.....Terry
Dix, Manfredo A wrote:
>Hello,
>this question probably came up before, but anyway:
>
>suppose I have a system of 3 equations and 3 unknowns,
>which I want to solve numerically with NSolve.
>They are polynomial of degree "n" so that I get n solutions.
>
>Is there a way to tell Mathematica to just return the
>real positive solutions, and dismiss the imaginary and negative
>ones?
>
>thank you so much for any help,
>cordially,
>
>Manfred
>mdix at tulane.edu
>
>
>
>