0
$\begingroup$

I am developing a module which does some vector algebra, and I have added an image of the code in the link below. (I did not find a good way to add formatted code in this pane). If the image resolution is not good, I will re-try adding code the proper way. This module worked fine in the course of the development, but somewhere along the path, I started getting errors like:

Module::lvsym: Local variable specification {Subscript[e, ap],Subscript[e, am],Subscript[e, is],Subscript[e, sag],\[Theta]$,Subscript[v, entry],tan$,Subscript[ap, new],Subscript[sag, new],Subscript[is, new],Subscript[v, sag],Subscript[\[Phi], ap],x$,y$,z$} contains Subscript[e, ap], which is not a symbol or an assignment to a symbol.

I am not able to understand this error, so I really am clueless as to what part of the code to check. I am able to run the code by copying it line by line to individual cells, but not when it is in a module. Hope someone can help! Thanks, Sid.

Module code

$\endgroup$
  • $\begingroup$ Subscript[e, ap], which is not a symbol or an assignment to a symbol. - you can't localize subscripted variables. $\endgroup$ – Kuba Feb 23 '17 at 21:12
  • $\begingroup$ Thanks! sorry for the duplicate, but I did not know this..... $\endgroup$ – Sid Feb 23 '17 at 21:56
  • $\begingroup$ You are welcome and no worries. $\endgroup$ – Kuba Feb 23 '17 at 22:01
  • $\begingroup$ I just modified the code by changing all subscripts to symbols, and I am getting the desired output. Thanks, Kuba. $\endgroup$ – Sid Feb 23 '17 at 22:32

Browse other questions tagged or ask your own question.