-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be interesting to be able to create an array of subscripted symbolic variables automatically #694
Comments
Try this Lines 450 to 452 in da72404
Lines 470 to 477 in da72404
using Symbolics
as = Symbolics.variables(:a, 0:3) gives
And using Symbolics
@variables t
as = Symbolics.variables(:a, 0:3, -1:2; T = Symbolics.FnType)
as = map(a -> a(t), as) result:
|
Thanks! It worked. |
No the suggested form is just to interpolate into the macro. I.e. x = :somesymbol
y = only(@variables($x)) where The above post does not instantiate the metadata. It would be nice for a simpler function to exist but it does not right now. |
It would be nice to automatically create an array of subscripted variables given
n
withSymbolics
:For the case
n=6
, I would like to do what the code below does without having to type out the variables explicitly.From the
Symbolics
docs, it is possible to do something likebut 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 withSymbolics
.The text was updated successfully, but these errors were encountered: