Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Absolute value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110647] Re: Absolute value
  • From: Alexei Boulbitch <alexei.boulbitch at iee.lu>
  • Date: Wed, 30 Jun 2010 08:04:53 -0400 (EDT)

Hi, Mark,
the most important part you have already done, the rest may be done like this:


(* This is your starting expression *)
startingExpression = 
  ComplexExpand[
   Abs[A1 E^(I \[Phi]1) ((1 + Cos[Sqrt[2] c z])/2) + 
      AD E^(I \[Phi]D) I/Sqrt[2] Sin[Sqrt[2] c z] + 
      A2 E^(I \[Phi]2) ((Cos[Sqrt[2] c z] - 1)/2)]^2, 
   TargetFunctions -> {Re, Im}];

(* Here each term, i.e. ~ A1^2, A2^2  and AD^2, is separated out *)

expr1 = startingExpression /. {A2 -> 0, AD -> 0} // Factor;
expr2 = startingExpression /. {A1 -> 0, AD -> 0} // Factor;
expr3 = startingExpression /. {A2 -> 0, A1 -> 0} // Factor;

(* done *)

finalExpression = expr1 + expr2 + expr3

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

Have fun, Alexei





Thanks, this gave some insight. And yet I'm struggling to get it in another form. I have to work with an expression like:

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

Which does not separate A1, A2 and AD. I would like to have an output in a form like:

A1^2*f1[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]] + A2^2*f2[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]] + AD^2*f3[Cos[Sqrt[2] c z],Sin[Sqrt[2] c z]],

where f1, f2, and f3 are some functions of Cos[Sqrt[2] c z] and Sin[Sqrt[2] c z]. Is this possible?

Regards, Mark.

-- 
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.



  • Prev by Date: Re: Run Package vs Needs
  • Next by Date: A modified StyleSheet results in FontSize fluctuations in the pdf
  • Previous by thread: Re: Absolute value
  • Next by thread: Automatic Differentiation of mathematica code