MathGroup Archive 2001

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

Search the Archive

Re: What is happening here? (TagSet)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28117] Re: What is happening here? (TagSet)
  • From: johntodd at fake.com (John Todd)
  • Date: Sat, 31 Mar 2001 02:58:51 -0500 (EST)
  • Organization: Altopia Corp. - Usenet Access - http://www.altopia.com
  • References: <9a1jve$9t6@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 30 Mar 2001 04:34:38 -0500, BobHanlon at aol.com wrote:

Bob,
	Wow, thanks for the great example.  Now in my mind the results
beg the following question:  Why?

If I utilize the following upvalues

x /: Im[x] = 0;
y /: Im[y] = 0;

I get these results:

{Re[x], Re[y], Re[x + y]}
{Re[x], Re[y], Re[x + y]}

{{Re[x], Re[y], Re[x + y]}, {x, y, x + y}}

{{Re[x], Re[y], Re[x + y]}, {x, y, x + y}}

{{Re[x], Re[y], x + y}, {x, Re[y], x + Re[y]}, {Re[x], y, y + Re[x]},
{x, y, 
    x + y}}

{{Re[x], Re[y], x + y}, {x, Re[y], x + Re[y]}, {Re[x], y, y + Re[x]},
{x, y, 
    x + y}}

Whereas if I use these upvalues

x /: Im[x] = 0;
y /: Im[y] = 0;
x /: Re[x] = x;
y /: Re[y] = y;

I get these results

{x, y, x + y}

{x, y, x + y}

{{x, y, x + y}, {x, y, x + y}}

{{x, y, x + y}, {x, y, x + y}}

{{x, y, x + y}, {x, y, x + y}, {x, y, x + y}, {x, y, x + y}}

{{x, y, x + y}, {x, y, x + y}, {x, y, x + y}, {x, y, x + y}}

which is what I would usually want.

I hope I'm not being too obtuse about this whole thing, but for some
reason, I feel that if I understand why Mathematica wants things done
a particular way, then I'll have learned a little bit of Mathematica's
operating principle which is the key to utilizing its power I believe.
As it is, I'm a rank amateur with Mathematica and I apologize if my
questions are inane.

To the quick of the matter:  Mathematically speaking, if one states
that the imaginary part of a number is zero, then that only leaves the
real part, which could then be any real number.  It seems redundant
that once one has defined the imaginary part of a number to be zero,
that one must further stipulate that the real part of the number is in
essence real (i.e. itself).   What is the reason for Mathematica
insisting that the additional upvalues for x and y be defined in order
to get the mathematically consistent results one would expect?

Thank you,

JT


  • Prev by Date: Re: Fitting an ellipse
  • Next by Date: Re: Re: C, MathLink or Java, J/Link
  • Previous by thread: Re: Re: What is happening here? (TagSet)
  • Next by thread: Re: Re: What is happening here? (TagSet)