I am trying to solve a system of differential equations with NDEigensystem, but there need to be arbitrarily many of them. I want to use indexed variables like a[i], which works fine with NDSolve, but throws strange errors in NDEigensystem. Does anyone know how to get this working, or have an alternative solution? Examples below (note that I am not actually using multiple indexed variables in these minimal examples):
NDSolve, indexed symbol a[1] parsed fine, gives correct solution:
NDSolve[{-D[a[1][r], {r, 2}] + r^2*a[1][r] == 0, -b''[r] + r^2*b[r] == 0, a[1][0] == 1, a[1]'[0] == 0, b[0] == 1,b'[0] == 0}, {a[1], b}, {r, -5, 5}]
NDEigensystem, nonindexed symbol a parsed fine, gives correct solution:
NDEigensystem[{-D[a[r], {r, 2}] + r^2*a[r], -b''[r] + r^2*b[r]}, {a, b}, {r, -5, 5}, 5]
NDEigensystem, indexed symbol throws error:
NDEigensystem[{-D[a[1][r], {r, 2}] + r^2*a[1][r], -b''[r] + r^2*b[r]}, {a[1], b}, {r, -5, 5}, 5]
NDEigensystem::baddep: The dependent variables specification ({a[1]}) does not match the differential operator dependent variables.
NDEigensystem, different indexing scheme throws error:
NDEigensystem[{-D[a[1, r], {r, 2}] + r^2*a[1, r], -b''[r] + r^2*b[r]}, {a[1], b}, {r, -5, 5}, 5]
NDEigensystem::nics: Initial conditions ({(a^(0,2))[1,r]}) will be ignored.
NDEigensystem::baddep: The dependent variables specification ({a[1]}) does not match the differential operator dependent variables.