Search code examples
listwolfram-mathematica

Error in appending assumptions to list--Mathematica


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: error message picture

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?


Solution

  • The arguments are backwards in the AppendTo function.