MathGroup Archive 2000

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

Search the Archive

Re: global real variables

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

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 * p^-1 ]

x + x/p

Note, however


just gives


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

Hope this helps,


Kevin J. McCann
Johns Hopkins University APL

Naum Phleger <naum at> wrote in message
news:87trds$5o3 at
>     I asked a dumb question a few weeks ago about making variables real
> 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
> 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
> 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
> 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.
> 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