This is a minimal example of what I want to make work:
ClearAll["Global`*"]
coeff = Array[a, 2];
arange = {#, -1, 1} & /@ coeff;
X = Table[Indexed[x, i], {i, 1, 2}];
Manipulate[
coeff = Array[a, 2];
{coeff[[1]] X[[1]] + coeff[[2]] X[[2]],
a[1] X[[1]] + a[2] X[[2]]},
##] & @@ arange
I would like to make the first option, namely coeff[[1]] X[[1]] + coeff[[2]] X[[2]]
work like a[1] X[[1]] + a[2] X[[2]]
. However, only the latter updates the values of the parameters.
context: I generate a system of ODEs with a large number of parameters. These parameters are generated via Array
, and I'd like to put such a system into a Manipulate. Generating them via Array
is very useful and convenient because the indices are used to define the equations.