• To: mathgroup at smc.vnet.net
• Subject: [mg55599] Re: [mg55591] Re: Questions about Abs[_]
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Thu, 31 Mar 2005 01:23:51 -0500 (EST)
• References: <200503300822.DAA21919@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

At first, when I saw your message I had no idea what its point was.
However, after reading it I looked at my own posting to the MathGroup
in the same thread and saw that it  appeared with a important bit
missing, although the message that was stored in my Sent mail box is
fine. Moreover, the previous version of my message arrived completely
garbled  and I was asked by the moderator to resend it. It seems that
these problems may well be related to the way Unicode characters are
treated in InputForm. I have now replaced the uniconde characters (the
Greek epsilon for element) by ASCI equivalents so I hope there will be
no problem this time.

> Simplify[x,lst\[Element]Reals && lst > 0]

is syntactically incorrect because you can't use lst >0 , where lst is
a list in Mathematica. Your code only works because the part that uses
incorrect syntax is in fact not needed and is simply ignored. See my
message below.

Below is another attempt at posting my original reply to Steeve
Brechmann's message.

Andrzej

On 28 Mar 2005, at 01:09, Steeve Brechmann (schumi) wrote:

>
>  2) Why Abs[2*z0-2*d*m]^2 doesn't simplify with (2*z0-2*d*m)^2 ?
>  The two expressions are always positive...and contains the same
> variables...
>

It will "simplify" but you have to pass the information that the
variables are  real and that you want the expression to be transformed
in this way. There are two ways to do it. The first is not really a
"simplification" but "expansion" without using Abs:

ComplexExpand[Abs[2*z0 - 2*d*m]^2, TargetFunctions ->
{Im, Re}]

(2*z0 - 2*d*m)^2

while the second is indeed a "Simplification":

Simplify[Abs[2*z0 - 2*d*m]^2, Element[z0 | d | m,Reals]]

(2*d*m - 2*z0)^2

Note that 4 is not factored out, if you want that you have to do it
explicitly:

Factor[%]

4*(d*m - z0)^2

Andrzej Kozlowski

On 30 Mar 2005, at 10:22, Dan wrote:

> Hi Andrzej:
>
> Mathematica is considering the most general case. I am thinking that
> you are dealing with all positive numbers since you have stated the
>
> Let's tell Mathematica we have all positive numbers.
>
> x = Abs[(2 z0 - 2 d m)^2];     (* define the function *)
>
> lst={z0,d,m};                   (* assemble all variables in a list *)
>
> Simplify[x,lst\[Element]Reals && lst > 0]     (* apply criteria *)
>
> output =
> (2 z0 - 2 d m)^2
>
> Hope this helps,
>
> Dan
>
>

• Prev by Date: Re: Need a functional process for this.
• Next by Date: Re: Re: Unicode Support