3

I'm not sure I understand the role of subscripts and superscripts in the Mathematica language. For me, the expression:

v={Subscript[v, x],Subscript[v, y],Subscript[v, z]}

is legitimate (where I will have used Ctrl+- to visually enter the subscripts actually). However, for Mathematica it isn't (I get "recursion depth of 1024 exceeded" error). Similarly if I define:

v={a,b,c}
Subscript[v,x]

Then I get in return:

Out= Subscript[{a, b, c}, x]

So what do subscripts exist for if I cannot differentiate between variables that have the same "letter" but different subscripts (I.e. Subscript[v,x] and Subscript[v,y])? The same goes for superscripts I imagine.

Thank you!

space_voyager
  • 841
  • 4
  • 11

1 Answers1

1

I think the problem in your first line of code is that you're trying to set v to a structure which contains v, hence the recursion issue. Mathematica is indeed able to differentiate variables of the same letter and different subscripts. Note Subscript[v, x] == Subscript[v, y] evaluates False and

Subscript[v, x] = 5;
Subscript[v, y] = 4;
Subscript[v, x]
Subscript[v, y] 

will produce the output

5
4

So they do exist for both formatting and differentiating similar variables, they just require some care to use.

IPoiler
  • 1,230
  • 9
  • 15