Times Ordered Bug with trig functions??
- To: mathgroup at smc.vnet.net
- Subject: [mg29598] Times Ordered Bug with trig functions??
- From: "Alan Mason" <amason2 at austin.rr.com>
- Date: Wed, 27 Jun 2001 05:12:33 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello.
I've succeeded in writing a differential operator calculus program using **
(NonCommutativeMultiply).
However, my first choice was to set Times to Ordered by
ClearAttributes[Times, {Orderless}]. This seemed preferable since no change
of notation is involved. In so doing I discovered an apparent bug -- with
trig functions (but not others) a wrong answer results; something in the
Trig module is causing the system to forget that Times is supposed to be
Ordered. Probably an unwholesome interaction with Power, since the error
occurs when powers would be available with the normal Times.
The following code exhibits the problem (all symbols are global atoms):
In[1]:=
ClearAttributes[Times, {Orderless}]
In[2]:=
a c D a b e
Out[2]=
a c D a b e
In[3]:=
a c Cos[q] D v Cos[q] (* WRONG *)
Out[3]=
\!\(a\ c\ D\ v\ Cos[q]\^2\)
In[4]:=
a c Cos[q] D V Cos[w]
Out[4]=
a c Cos[q] D V Cos[w]
In[5]:=
a c Exp[q] D v Exp[q]
Out[5]=
\!\(a\ c\ E\^q\ D\ v\ E\^q\)
In[6]:=
a c Tan[x] D v Tan[x] (* WRONG *)
Out[6]=
\!\(a\ c\ D\ v\ Tan[x]\^2\)
I spoke to support at Wolfram Research, but they deny this is a bug. Seems
to me it at the very least breaks the pattern matcher. I'm running
Mathematica 3.0; perhaps Times Ordered will not be supported in the future.
Fortunately, there are other (more complicated) ways to get the desired
effect.
- Follow-Ups:
- Re: Times Ordered Bug with trig functions??
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Times Ordered Bug with trig functions??