Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Abs in the denominator

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128566] Re: Abs in the denominator
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 4 Nov 2012 20:11:32 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <k6vj61$6b4$1@smc.vnet.net>

On 02/11/2012 04:45, Dieter Ernst wrote:
> Hello
>
> I have an expression with Abs applied to the entire denominator:
>
>        0.5/Abs[(C * R * omega)/(-1 + C * L * omega^2)]
>
> (Just as an example, the function in Abs could also be another one). How can I transform it to an expression with Abs wrapping the entire Fraction, such as:
>        Abs[0.5/((C * R * omega)/(-1 + C * L * omega^2))]
>
> ... and then to:
>        Abs[(0.5 * (-1 + C * L * omega^2) / (C * R * omega)]]
>

You can always transform an expression using a transformation, but the 
onus is then on you to ensure that the transformation is sound:

  expr= 0.5/Abs[(C * R * omega)/(-1 + C * L * omega^2)]

expr/. (num_/;num>0)/Abs[x_] -> Abs[num/x]

However, it would seem that Mathematica automatically extracts the 
factor of 0.5 from Abs. You can only avoid this by using HoldForm to 
protect the structure of the expression:

expr/. (num_/;num>0)/Abs[x_] :>  Abs[HoldForm[num]/x]

However, beware, this expression is for display only - the HoldForm 
embedded in the result prevents it being used directly in further 
calculations.

David Bailey
http://www.dbaileyconsultancy.co.uk



  • Prev by Date: Re: fyi, interesting kernel crash, empty matrix, hitting return, 8.04
  • Next by Date: A nice and customized legend within Manipulate
  • Previous by thread: Re: Abs in the denominator
  • Next by thread: Re: CDF Security