MathGroup Archive 2003

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

Search the Archive

Separating real and imaginary parts of symbolic expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42012] Separating real and imaginary parts of symbolic expressions
  • From: carlos at colorado.edu (Carlos Felippa)
  • Date: Mon, 16 Jun 2003 03:57:56 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Since the OP I thought of one more way that works.  
So it is down to two:

ComplexExpandReIm[z_]:=Module[{iunit,zz}, 
   zz=ComplexExpand[z]/.I->iunit; 
   Return[{zz/.iunit->0,Coefficient[zz,iunit]}]];
   
ComplexExpandReIm[z_]:=ComplexExpand[{Re[z],Im[z]}];

They give equal timing and the second way is simpler, so I guess 
I have answered my own question :-)


  • Prev by Date: ListNecklaces of n beads of |c| different colors (n!=c)?
  • Next by Date: 4.0.1 crashes under W2k
  • Previous by thread: Re: ListNecklaces of n beads of |c| different colors (n!=c)?
  • Next by thread: 4.0.1 crashes under W2k