MathGroup Archive 2007

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

Search the Archive

Re: Parse results from Solve

  • To: mathgroup at
  • Subject: [mg73953] Re: Parse results from Solve
  • From: Bill Rowe <readnewsciv at>
  • Date: Sat, 3 Mar 2007 01:19:56 -0500 (EST)

On 3/2/07 at 6:31 AM, namratashekar at (nikki_74) 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=

>and I want all solutions where x!=y , or , all solutions where y>1.

>Can anybody help with this? Thanks!

Generally, you will get more helpful answers if you include a
sample problem not just the results returned by some operation.

But taking just your posted result, I can use pattern matching
with Cases to do what you want, i.e.,

sols = {{x -> 0, y -> 0}, {x -> 1, y -> 2}};

Cases[sols, {_ -> b_, _ -> b_}]

{{x -> 0, y -> 0}}

Cases[sols, {_, y -> _?(#1 > 1 & )}]

{{x -> 1, y -> 2}}
To reply via email subtract one hundred and four

  • Prev by Date: Re: Means
  • Next by Date: Re: Number of digits
  • Previous by thread: Re: Parse results from Solve
  • Next by thread: Re: Parse results from Solve