Re: Parse results from Solve
- To: mathgroup at smc.vnet.net
- Subject: [mg73908] Re: Parse results from Solve
- From: "Norbert Marxer" <marxer at mec.li>
- Date: Sat, 3 Mar 2007 00:55:34 -0500 (EST)
- References: <es916i$2u2$1@smc.vnet.net>
On 2 Mrz., 12:18, nikki_74 <namratashe... at rediffmail.com> wrote:
> I have used the Solve command to get the solutions for a system of equations. However I want to use these solutions in other commands, such as Reduce and Simplify.
>
> For instance, say the output of Solve is,
> sols= {{x->0,y->0},{x->1,y->2}}
>
> and I want all solutions where x!=y , or , all solutions where y>1.
>
> Can anybody help with this? Thanks!
Hello
You can use
sols = {{x -> 0, y -> 0}, {x -> 1, y -> 2}};
Cases[sols, {x -> xv_, y -> yv_} /; xv != yv]
Cases[sols, {x -> xv_, y -> yv_} /; yv > 1]
Best Regards
Norbert Marxer