MathGroup Archive 1998

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

Search the Archive

Re: D[Xc, X] = Nonsense ?



Kowald wrote:
> 
> Hello,
> 
> I'm using Mathematica 3 on a NT4 machine and I tried to use the new nice
> subscripts for naming my variables.
> I have a variable Xc (that's X subscript c) and a variable X which are
> non-identical. If I now try
> D[Xc ,X]     I get  Subscript(1,0) [X,c]  instead of zero.  If I type
> D[Xc ,Y]  everything is okay.
> So somehow Mathematica gets confused about the subscript. Does this mean
> I cannot have variables whose only difference is a subscript ?   Or
> what else is going on ?
> 
> Many thanks

Axel,
You need to use Utilities`Notation` - details in following notebook.



-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642


(***********************************************************************

                    Mathematica-Compatible Notebook

This notebook can be used on any computer system with Mathematica 3.0,
MathReader 3.0, or any compatible application. The data for the
notebook  starts with the line of stars above.

To get the notebook into a Mathematica-compatible application, do one of
the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be sent
directly in email or through ftp in text mode.  Newlines can be CR, LF
or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing the 
word CacheID, otherwise Mathematica-compatible applications may try to 
use invalid cache data.

For more information on notebooks and Mathematica-compatible 
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info@wolfram.com
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from  Wolfram
Research.
***********************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[      3240,        122]*)
(*NotebookOutlinePosition[      4082,        149]*) (* 
CellTagsIndexPosition[      4038,        145]*) (*WindowFrame->Normal*)


Notebook[{

Cell[CellGroupData[{
Cell[BoxData[
    \(D[x\_c, x]\)], "Input"],

Cell[BoxData[
    RowBox[{
      SuperscriptBox["Subscript", 
        TagBox[\((1, 0)\),
          Derivative],
        MultilineFunction->None], "[", \(x, c\), "]"}]], "Output"] },
Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
    \(FullForm[x\_c]\)], "Input"],

Cell[BoxData[
    TagBox[
      StyleBox[\(Subscript[x, c]\),
        ShowSpecialCharacters->False,
        ShowStringCharacters->True],
      FullForm]], "Output"]
}, Open  ]],

Cell["Is treated exacly the same as g[x,c]:", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
    \(D[g[x, c], x]\)], "Input"],

Cell[BoxData[
    RowBox[{
      SuperscriptBox["g", 
        TagBox[\((1, 0)\),
          Derivative],
        MultilineFunction->None], "[", \(x, c\), "]"}]], "Output"] },
Open  ]],

Cell["We need to make Subscript[x,c] into a symbol:", "Text"],

Cell["<< \"Utilities`Notation`\"", "Input"],

Cell[BoxData[
    RowBox[{"Symbolize", "[", 
      TagBox[\(x\_c\),
        NotationBoxTag,
        Editable->True], "]"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
    \(D[x\_c]\)], "Input"],

Cell[BoxData[
    \(x\_c\)], "Output"]
}, Open  ]],

Cell["\<\
You can find out about Notation in
\tMathematica 3.0 \
Files/AddOns/ExtraPackages/Utilities/Documentation/English/\
NotationDocumentation.nb
and
Files/AddOns/ExtraPackages/Utilities/Documentation/English/Other \
Information/NotationExamples.nb

and get the latest versions from
          http://wolfram.com/~jasonh/\ \>", "Text"]
},
FrontEndVersion->"Macintosh 3.0",
ScreenRectangle->{{0, 1152}, {0, 850}}, WindowSize->{520, 740},
WindowMargins->{{Automatic, 283}, {20, Automatic}},
MacintoshSystemPageSetup->"\<\
00`0001804P000000bX2@?oaooL3>@99:P85N0?N0@00004/0B`000003Bl9H001
0000I0000@400@0000000BL?0040000000000000000000000000000000000?o2
omX=K@V600P100000000000000000000\>"
]


(***********************************************************************
Cached data follows.  If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at the
top of  the file.  The cache data will then be recreated when you save
this file  from within Mathematica.
***********************************************************************)

(*CellTagsOutline
CellTagsIndex->{}
*)

(*CellTagsIndex
CellTagsIndex->{}
*)

(*NotebookFileOutline
Notebook[{

Cell[CellGroupData[{
Cell[1731, 51, 43, 1, 27, "Input"],
Cell[1777, 54, 178, 5, 28, "Output"] }, Open  ]],

Cell[CellGroupData[{
Cell[1992, 64, 47, 1, 27, "Input"],
Cell[2042, 67, 164, 5, 38, "Output"] }, Open  ]],
Cell[2221, 75, 53, 0, 30, "Text"],

Cell[CellGroupData[{
Cell[2299, 79, 46, 1, 27, "Input"],
Cell[2348, 82, 170, 5, 28, "Output"] }, Open  ]],
Cell[2533, 90, 61, 0, 30, "Text"],
Cell[2597, 92, 43, 0, 27, "Input"],
Cell[2643, 94, 133, 4, 27, "Input"],

Cell[CellGroupData[{
Cell[2801, 102, 40, 1, 27, "Input"], Cell[2844, 105, 38, 1, 26,
"Output"] }, Open  ]],
Cell[2897, 109, 339, 11, 158, "Text"] }
]
*)



(***********************************************************************
End of Mathematica Notebook file.
***********************************************************************)



  • Prev by Date: Re: lists
  • Next by Date: Laplace transform of nasty function?
  • Prev by thread: D[Xc, X] = Nonsense ?
  • Next by thread: Re: D[Xc, X] = Nonsense ?