MATLAB: How to perform symsum expansion with two known condition, in this case let say n and m and the n=m

expansion of equationsymssymsumtwo argument

syms x y n m
evalin(symengine,'assume(n,Type::Integer)');
evalin(symengine,'assume(x,Type::Integer)');
evalin(symengine,'assume(y,Type::Integer)');
evalin(symengine,'assume(m,Type::Integer)');
fs = symsum(((400/(2*n-1)*pi*sinh((2*n-1)*pi/2))*((sin((2*n-1)*pi/2)*x))*((sinh((2*n-1)*pi/2)*y)))-((200/(n*pi*sinh(2*n*pi)))*(cos(n*pi))*(sinh(n*pi*(2-x)))*(sin(n*pi*y)))+((500*(cos(n*pi))/(pi*(1-4*n^2)*sinh(2*n*pi)))*(sinh(n*pi*x))*(sin(n*pi*y)))-((16/(m*n*(pi^2)*((m^2*pi^2)+(4*n^2*pi))))*(cos(m*pi))*(cos(n*pi))*(sin(m*pi*x/2))*(sin(n*pi*y))),n,1,5)
but only one argument is allowed to key in for the function, and i already put n, and how about m ? if given m=n=1-5 ?
Really appreciate someone to help me tq

Best Answer

You do not need the evalin(). You can use http://www.mathworks.com/help/symbolic/syms.html#inputarg_set
syms x y n m integer
You can call symsum() twice.
symsum( symsum(SomeExpression, n, 1, 5), m, 1, 5)
My tests show that under the assumption of integer for n, x, y, that m vanishes from the expression being summed, leaving
400*(-1)^(1+n) * pi * sinh(n * pi - (1/2)*pi)^2 * x * y / (2*n-1)
so the sum over m from 1 to 5 would just be 5 times the sum for n.