Re: Select positive solutions (depending on parameters)
- To: mathgroup at smc.vnet.net
- Subject: [mg119520] Re: Select positive solutions (depending on parameters)
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 8 Jun 2011 07:11:33 -0400 (EDT)
- Reply-to: hanlonr at cox.net
Select will do anything that you tell it to do f[x_] = Times @@ (x - Range[-3, 3]); sols = Solve[f[x] == 0, x] {{x -> -3}, {x -> -2}, {x -> -1}, {x -> 0}, {x -> 1}, {x -> 2}, {x -> 3}} Select[sols, -2 <= (x /. #) <= 1 &] {{x -> -2}, {x -> -1}, {x -> 0}, {x -> 1}} Select[sols, Abs[x /. #] > 1 &] {{x -> -3}, {x -> -2}, {x -> 2}, {x -> 3}} Bob Hanlon ---- Andrea <cimatori at knmi.nl> wrote: ============= Hi, I'm a newbie of Mathematica, sorry if the question has been answered many times already. I can't understand how to select those solutions of a system of equations (depending on some parameters) that satisfy a set of conditions. I do something like this: sols=Solve[f[x,y,...,a,b,c...]==0,{x,y,...}] and I would then like to operate a selection on "sols", considered only in some interval of the parameters (relevant for my problem and decided by me). The function "Select" does not give the right answer, as it returns only those solution that are positive for any parameter value. Any help would be welcome, thanks.