Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Collecting Positive and Negative Terms

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111801] Re: Collecting Positive and Negative Terms
  • From: Michael Knudsen <micknudsen at gmail.com>
  • Date: Fri, 13 Aug 2010 07:04:29 -0400 (EDT)
  • References: <i3tnsg$s5l$1@smc.vnet.net> <i40eu6$bvq$1@smc.vnet.net>

On Aug 12, 11:29 am, Albert Retey <a... at gmx-topmail.de> wrote:

> If your expr is a sum of products (which is what Expand usually
> creates...), the following should work:
>
> Cases[expr, Times[_?Positive, ___]]

Thanks for trying to provide a really simple solution. I tired it out
on one of my rather complicated expressions, but the output didn't
look correct. I therefore tried a trivial example,

myExpression = a + b - c;
Cases[myExpression, Times[_?Positive, ___]]

but the output is just an empty list

{}

What I was hoping for was

a + b

I'll go through some of the more complicated suggestions today and see
how things pan out.

--
Michael Knudsen


  • Prev by Date: Re: Frontend suggestions
  • Next by Date: Re: Frontend suggestions
  • Previous by thread: Re: Collecting Positive and Negative Terms
  • Next by thread: Mathematica won't stop