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


Groups > comp.soft-sys.math.mathematica > #14566 > unrolled thread

Re: Replacing spurious Abs

Started byBill Rowe <readnews@sbcglobal.net>
First post2013-05-21 08:21 +0000
Last post2013-05-21 08:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Replacing spurious Abs Bill Rowe <readnews@sbcglobal.net> - 2013-05-21 08:21 +0000

#14566 — Re: Replacing spurious Abs

FromBill Rowe <readnews@sbcglobal.net>
Date2013-05-21 08:21 +0000
SubjectRe: Replacing spurious Abs
Message-ID<knfaps$21s$1@smc.vnet.net>
On 5/21/13 at 12:02 AM, carlos.felippa%colorado.edu@gtempaccount.com
wrote:


>Sometimes I get Abs[exp] from Simplify or Integrate, when it should
>be simply exp. Is there a simple way to get rid of the Abs, when exp
>may be an arbitrarily complex expression?  Something like
>/.Abs[#]->#?  Thanks.

In[1]:= Abs[exp] /. Abs[a_] -> a

Out[1]= exp

But keep in mind this is a literal syntax replacement which may
not be mathematically valid. That is you can do something like

In[2]:= Sqrt[2] /. Sqrt[a_] -> a

Out[2]= 2

Turning Sqrt[2] into 2 which is clearly not mathematically valid.

Another approach would be

In[3]:= Assuming[exp > 0, Simplify@Abs[exp]]

Out[3]= exp

which is a mathematically valid operation given the assumption
exp>0 is true. And this last can be done as:

In[4]:= Abs[exp] // Assuming[exp > 0, Simplify@#] &

Out[4]= exp

which is often handy

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web