On Tue, 19 Oct 2021 at 20:55, David Bailey <d...@dbailey.co.uk> wrote: > > Dear group, > > First I would like to say how good it was to discover that the online > SymPy documentation now supports copy/paste operations without > constantly switching to SymPyLive. I think this will make the > documentation considerably more user friendly.
I'm not sure what has changed there... > My question is what construct should I use to get variables with > subscripts, and maybe superscripts. I thought at first that indexed > objects were the way to go, but they seem rather obscure. E.g. think of > indexing through the Bessel functions - J0, J1,J2 etc. > > Ideally I'd like to loop over the index/indices and also see the > subscripts positioned below the main symbol when using Latex output I'm not completely sure what you want here but is this it: In [19]: symbols('x:10') Out[19]: (x₀, x₁, x₂, x₃, x₄, x₅, x₆, x₇, x₈, x₉) IndexedBase is for the situation where you want the index to be symbolic e.g.: In [27]: xi = IndexedBase('x') In [28]: n, m = symbols('n, m') In [29]: Sum(xi[n], (n, 1, m)) Out[29]: m ___ ╲ ╲ ╱ x[n] ╱ ‾‾‾ n = 1 -- Oscar -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxRox0Mmwwhv2QB2yYQbrTqSO%2Bx27%3DxLqkGiYhWXEeiz_w%40mail.gmail.com.