0
$\begingroup$

I am trying to define a vector, $\vec{u}$, with components $u_x$ and $u_y$.

However, when I type u = {Subscript[u, x], Subscript[u, y]}, I get the following error:

$RecursionLimit::reclim2: Recursion depth of 1024 exceeded during evaluation of {Subscript[u, x]}.

Using the Indexed[] function produces the same error.

Just curious why this happens, and how to correct the problem in this scenario?

$\endgroup$
  • 2
    $\begingroup$ As a general note: Better not use Subscript at all; it leads to many nasty things. Why does this happen? The same happens with every call of the form u = f[u]. At the moment you make the assignment, it forces Mathematica to reinsert the definition on the right hand side which produces f[f[u]],f[f[f[u]]], f[f[f[f[u]]]] and so on. $\endgroup$ – Henrik Schumacher Jan 29 '18 at 21:57
  • $\begingroup$ You could consider one of the options presented in this answer $\endgroup$ – Carl Woll Jan 29 '18 at 22:04

Browse other questions tagged or ask your own question.