I am writing a code in Mathematica that needs several assumptions, but there is a nice pattern to them, so I wanted to use a for-loop rather than explicitly writing them all out.
assumptions = {};
For[j = 1, j <= 3, j += 1,
For[k = 1, k <= 3, k += 1,
AppendTo[Element[Subscript[Δ, j, k], Reals],
assumptions];
AppendTo[Subscript[Δ, j, k] >= 0, assumptions]]];
...
Assuming[assumptions, ... ]
However, it appears that I can't append these statements to a list; I get the following errors:
Is it just because of the subscripts that these errors come up? What could I do to append these assumptions?
EDIT: The errors are not due to the subscripts at all. Why does it throw an error about Element
being called with 3 arguments?
The arguments are backwards in the AppendTo
function.