Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: global real variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22059] Re: global real variables
  • From: adam_smith at my-deja.com
  • Date: Fri, 11 Feb 2000 02:38:44 -0500 (EST)
  • References: <87trds$5o3@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Naum,

What you need to do in the case of Conjugate[] is to use the command
ComplexExpand[ Conjugate[ x + x * p^-1 ]] as explained in the help this
assumes that all the variables are real.  (You can specify a list that
says that some variables are complex.)  ComplexExpand[] is very useful
when dealing with complex numbers of the form a + b I.  The following
examples are very illustrative.  Note the use of TargetFunctions->
{Re,Im}.  This "forces" the output in the form of a real + imaginary
part.

In[1]:=
z = a + b I

Out[1]=
a + I*b

In[2]:=
z*Conjugate[z]

Out[2]=
(a + I*b)*Conjugate[a + I*b]

In[3]:=
ComplexExpand[z*Conjugate[z]]

Out[3]=
a^2 + b^2

In[7]:=
z/Conjugate[z]

Out[7]=
(a + I*b)/Conjugate[a + I*b]

In[8]:=
ComplexExpand[z/Conjugate[z]]

Out[8]=
a^2/Abs[a + I*b]^2 + (2*I*a*b)/Abs[a + I*b]^2 - b^2/Abs[a + I*b]^2

In[6]:=
ComplexExpand[z/Conjugate[z], TargetFunctions -> {Re, Im}]

Out[6]=
a^2/(a^2 + b^2) + (2*I*a*b)/(a^2 + b^2) - b^2/(a^2 + b^2)

Adam Smith

In article <87trds$5o3 at smc.vnet.net>,
  Naum Phleger <naum at cava.physics.ucsb.edu> wrote:
>     I asked a dumb question a few weeks ago about making variables
real and
> found that Mathematica 4 took care of this better.  I have been using
it
> since.  I still have a couple of problems with it though.  First, I
can have
> variables be treated as real by using the assumption Element[x,Reals]
in a
> simplify command, but I want x to be real in all commands so I don't
have to
> keep using Simplify each time I want x to be recognized as real.
Second,
> even this doesn't seem to work quite right.  Here is what I mean.
>
>     Say I have tow var.s, x and p.  Both are real so I can do this.
>
> Simplify[ Conjugate[ x ] , Element[ x , Reals ] ]  ----> x
>
> amd I get the same thing for p, but it stops working if I have
functions of
> x and p, for instance I get
>
> Simplify[ Conjugate[ x + x * p^-1 ] , Element[ {x,p} , Reals ] ]  ----
>
>
>  Conjugate[ x + x * p^-1 ]
>
> It works if I use FullSimplify   AND   put p^-1 into the list of
variables
> that I want to have real.  How can I get around this without listing
every
> negative power of every variable and wasting time with FullSimplify.
Thanks
> for any help.  Thanks.
>
>                 -NAUM
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


  • Prev by Date: Re: Dealing with irregular shaped arrays
  • Next by Date: Simplifying expressions for use in C programs
  • Previous by thread: Re: global real variables
  • Next by thread: Re: global real variables