Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8592

Re: extract only positive solutions

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: extract only positive solutions
Date 2012-02-18 11:29 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jho22i$5sg$1@smc.vnet.net> (permalink)

Show all headers | View raw


On 2/17/12 at 6:23 AM, gbdomingo@gmail.com (Gabby Domingo) wrote:

>hi all! how do you extract only positive solutions to a solver, like
>NSolve?

>sol={{-.532,.932},{.34,23}}

>and extract {.34,.23}?

Here is an example of one way

In[3]:= p = (x + 3) (x - 4) (x - 5) // Expand;

In[4]:= Cases[Solve[p == 0, x], {_?(x > 0 /. # &)}]

Out[4]= {{x->4},{x->5}}

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: extract only positive solutions Bill Rowe <readnews@sbcglobal.net> - 2012-02-18 11:29 +0000

csiph-web