Re: global real variables

• To: mathgroup at smc.vnet.net
• Subject: [mg22046] Re: global real variables
• From: "Kevin J. McCann" <kevin.mccann at jhuapl.edu>
• Date: Fri, 11 Feb 2000 02:38:26 -0500 (EST)
• Organization: Johns Hopkins University Applied Physics Lab, Laurel, MD, USA
• References: <87trds\$5o3@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```There are other ways, but here is one that I use. It employs the
Algebra`ReIm` Package and uses Upsets to tell Mathematica that x and p are reals:

<< Algebra`ReIm`

Re[x] ^= x;
Im[x] ^= 0;

Re[p] ^= p;
Im[p] ^= 0;

Now you can do this:

Conjugate[x]

x

Conjugate[ x + x * p^-1 ]

x + x/p

Note, however

Conjugate[y]

just gives

Conjugate[y]

because Mathematica doesn't know enough about y to do any more.

Hope this helps,

Kevin
--

Kevin J. McCann
Johns Hopkins University APL

Naum Phleger <naum at cava.physics.ucsb.edu> wrote in message
news:87trds\$5o3 at smc.vnet.net...
>     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
>

```

• Prev by Date: Re: Orientation of characters in FrameLabel
• Next by Date: Re: global real variables
• Previous by thread: Re: global real variables
• Next by thread: Re: global real variables