0
$\begingroup$

A concentration $A(i,j)$ varies over i,j.

I'd like to include the summation of $A(i,j)$ in my Mathematica expressions, but it evaluates the sum

 In[1]:  Sum[Aij, {i, imax}, {j, jmax}]
 Out[1]: Aij imax jmax

i.e. Mathematica is treating all A(i,j) values as equal, so that $\sum_{j=1}^N\sum_{i=1}^M A(i,j) = NMA$. This isn't the case, how do I stop it evaluating the sum?

My system also includes terms like $\sum_{j=1}^N\sum_{i=1}^M A(i,j)u(i,j)$, which I also don't know how to write in Mathematica.

 In[1]:  Sum[Aij uij, {i, imax}, {j, jmax}]
 Out[1]: Aij imax jmax
$\endgroup$
  • 5
    $\begingroup$ Aij is the symbol Aij. Try somthing like A[i,j]. Also, don't use uppercase initials in symbols - might clash with a built-in... $\endgroup$ – ciao May 4 '15 at 21:05
  • $\begingroup$ Oh great, simple! Thanks a lot! $\endgroup$ – user1792403 May 4 '15 at 21:07
  • $\begingroup$ In addition, if you want to keep a sum in unevaluated form (to perform symbolic manipulations on it), you should check out Inactive. $\endgroup$ – Stefan R May 4 '15 at 21:32
3
$\begingroup$

If you want to add formatting:

Format[A[x_, y_]] := Subscript[A, ToString[x] <> ToString[y]]

Sum[A[i, j], {i, 1, imax}, {j, 1, jmax}]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.