Is there a way to automatically create an array of subscripted variables given n
in Symbolics
?
For the case n=6
, I would like to do what the code below does without having to type out the variables explicitly.
using Polynomials, Symbolics
@variables a₂ a₃ a₄ a₅ a₆
a = [0, 0, a₂, a₃, a₄, a₅, a₆]
p = Polynomial(a)
From the Symbolics
docs, it is possible to do something like
@variables a[1:3]
but then I cannot start the array from index 0 or from another arbitrary value, which is what I want so that the index of the array matches the exponent of the monomial. I have managed to do this with Sympy
, but would like to have the same kind of array with Symbolics
.