MathGroup Archive 2010

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

Search the Archive

Re: Absolute value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110620] Re: Absolute value
  • From: Peter Pein <petsie at dordos.net>
  • Date: Tue, 29 Jun 2010 06:58:00 -0400 (EDT)
  • References: <i09fj1$53t$1@smc.vnet.net>

Am Mon, 28 Jun 2010 06:30:57 +0000 (UTC)
schrieb Marco Masi <marco.masi at ymail.com>:

> Yes, thank you, that brough me a step forward (and yes, I forgot to
> square the Abs value in the previous example... sorry for that).
> 
> However, there is still a step which I can't accomplish. Please try
> the following: FullSimplify[ ComplexExpand[ Abs[1/2 (A1 E^(I \[Phi]1)
> - A2 E^(I \[Phi]2) + A1 E^(I \[Phi]1) Cos[Sqrt[2] c z] + A2 E^(I
> \[Phi]2) Cos[Sqrt[2] c z])]]^2]
> 
> I would like to have Mathematica avoiding one of the resulting Cos[2
> Sqrt[2] c z] expression, and maintain both as Cos[Sqrt[2] c z], and
> then simplify. How should I proceed?
> 
> Regards, Mark.
> 

Hi Mark,

try squaring the absolute value before using ComplexExpand:
 FullSimplify[ComplexExpand[
   Abs[(1/2)*(A1*E^(I*\[Phi]1) - A2*E^(I*\[Phi]2) +
A1*E^(I*\[Phi]1)*Cos[Sqrt[2]*c*z] +
A2*E^(I*\[Phi]2)*Cos[Sqrt[2]*c*z])]^2]]

--> (1/4)*Abs[A2*E^(I*\[Phi]2)*(-1 + Cos[Sqrt[2]*c*z]) +
A1*E^(I*\[Phi]1)*(1 + Cos[Sqrt[2]*c*z])]^2

but I would prefer:

Collect[
  ComplexExpand[
    Abs[(1/2)*(A1*E^(I*\[Phi]1) -
      A2*E^(I*\[Phi]2) + A1*E^(I*\[Phi]1)*Cos[Sqrt[2]*c*z] +
      A2*E^(I*\[Phi]2)*Cos[Sqrt[2]*c*z])]^2,
   TargetFunctions -> {Re,Im}],
A1 | A2, TrigFactor]

which returns
A1^2*Cos[(c*z)/Sqrt[2]]^4 + A2^2*Sin[(c*z)/Sqrt[2]]^4 -
(1/2)*A1*A2*Cos[\[Phi]1 - \[Phi]2]*Sin[Sqrt[2]*c*z]^2

Peter



  • Prev by Date: hearing a plot
  • Next by Date: Elliptical gear calculations
  • Previous by thread: Re: Absolute value
  • Next by thread: Re: Absolute value