MathGroup Archive 2003

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

Search the Archive

Re: Readability confuses mathematica?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44525] Re: Readability confuses mathematica?
  • From: "Curt Fischer" <crf3 at po.cwru.edu>
  • Date: Thu, 13 Nov 2003 02:27:28 -0500 (EST)
  • References: <botcm2$ci7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"patrick_m_lahey" <patrick.m.lahey at aero.org> wrote in message
news:botcm2$ci7$1 at smc.vnet.net...
> I am new to mathematica so perhaps there is a simple answer to this
>
> Consider:
>
> In[1]:= D[x-x0,x]
>
> except that x0 is really x ctrl-- 0 (x subscript 0).  Normally that
> would be a completely independent variable from x but not according to
> mathematica!
>
> Out[1]=1-Subscript(1,0)[x,0]
>
> (the (1,0) is a superscript of Subscript).
>
> One of the things that attracted me to mathematica was the ability to
> work with expressions that closely mirrored the true expressions of
> interest (a readability issue really...).
>
> Is there anything that can be done here?

<< Utilities`Notation`

Symbolize[x ctrl -- y_]

If you put the underscore _ after the y, x-subscript-anything will now be
treated as a distinct symbol from x with no subscript.  Whereas without the
underscore, only x-subscript-y will be treated as a distinct symbol.

Read the help file and make sure you enter the Symbolize command from a
palette or by copy and pasting from the help file.  There is an embedded tag
that needs to be preserved which is lost by just typing in
"Symbolize[stuff]".

Here's a short sample notebook showing how to do this.  Sorry for all the
crazy Mathematica characters, but is comes with the territory when you're
doing subscripts.

In[1]:=
\!\(D[x - x\_0, x]\)
Out[1]=
\!\(\*
RowBox[{"1", "-",
RowBox[{
SuperscriptBox["Subscript",
TagBox[\((1, 0)\),
Derivative],
MultilineFunction->None], "[", \(x, 0\), "]"}]}]\)
In[2]:=
<< Utilities`Notation`
In[3]:=
\!\(\*
RowBox[{
RowBox[{"Symbolize", "[",
TagBox[\(x\_y_\),
NotationBoxTag,
TagStyle->"NotationTemplateStyle"], "]"}], ";"}]\)
In[4]:=
\!\(FullForm[x\_y]\)
Out[4]//FullForm=
x\[UnderBracket]Subscript\[UnderBracket]y
In[5]:=
\!\(D[x - x\_0, x]\)
Out[5]=
1

-- 

Curt Fischer





  • Prev by Date: RE: Simple Sum problem
  • Next by Date: RE: Re: Unevaluated
  • Previous by thread: Re: Readability confuses mathematica?
  • Next by thread: Re: Readability confuses mathematica?