MathGroup Archive 2010

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

Search the Archive

Re: Absolute value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110616] Re: Absolute value
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Mon, 28 Jun 2010 02:29:55 -0400 (EDT)

Actually, the correct answer should be the square-root of what you claim 
is the answer.

In such problems, remember the crucial fact that Mathematica does not 
"know" that you intended phi1 and phi2 to be real, and hence it does not 
attempt further simplification. By default, symbolic quantities in 
Mathematica are interpreted as potentially complex rather than real when 
they appear in expressions involving complex numbers.

In such situations, ComplexExpand is your friend:

   ComplexExpand[Abs[Exp[I phi1] + Exp[I*phi2]]] // InputForm
Sqrt[(Cos[phi1] + Cos[phi2])^2 + (Sin[phi1] + Sin[phi2])^2]

   ComplexExpand[Abs[Exp[I phi1]+Exp[I*phi2]]] // Simplify // InputForm
Sqrt[2 + 2*Cos[phi1]*Cos[phi2] + 2*Sin[phi1]*Sin[phi2]]

(I used InputForm here only in order to create one-dimensional output. 
In actual use you wouldn't do that, so you'd actually see the 
two-dimensional square-root notation.)

On 6/27/2010 4:55 AM, Marco Masi wrote:
> I would like to calculate the absolute value of complex quantities. For example Abs[Exp[I phi1]+Exp[I*phi2]], which sould give 2 (1+cos(phi1-phi2)). However it does not work. I tried to use real numbers as assumtion, but it always answers "Abs[Exp[I phi1]+Exp[I*phi2]]". What am I doing wrong?
>
> Regards, Mark.
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Sum of terms --> list
  • Next by Date: Re: Absolute value
  • Previous by thread: Re: Absolute value
  • Next by thread: Re: Absolute value