MathGroup Archive 2000

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

Search the Archive

Re: Symbolic complex conjugation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26199] Re: Symbolic complex conjugation
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Thu, 30 Nov 2000 22:02:15 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

There have been many recent responses to the question on complex conjugation
using:

expr/. Complex[0,n_] ->  -Complex[0,n]
or
expr/. Complex[m_,n_] ->  Complex[m,-n]

--------------------
I don't recommend you do it that way. Consider the following:

In[1]:=
  n=567.25;
  m=345.5;

Now suppose you do a lot of work, after which (m) and (n) still have the
values above.  
....
....
....

In[143]:=
  (2-3 I) + x  /.Complex[m_,n_] -> Complex[m,-n]

Out[143]=
  (345.5-567.25 I) + x

Oh that's awful!  Instead use the following.

In[144]:=
  (2-3 I) + x /.Complex[m_,n_] :> Complex[m,-n]

Out[144]=
   (2 + 3 I) + x

--------------------
Regards,
Ted Ersek

Download Mathematica tips, tricks from
http://www.verbeia.com/mathematica/tips/Tricks.html



  • Prev by Date: Re: Re: vector multiplication
  • Next by Date: Newton Raphson fractals
  • Previous by thread: Re: Symbolic complex conjugation
  • Next by thread: Re: Symbolic complex conjugation