Help with symsum function?

I'm trying to use symsum to sum an expression for a homework problem. Because it is a homework problem and I'm using the variable they plan to test the program with I assume that the summation must converge.
syms k n g;
r1 = symsum((1/n^5)*(192/pi^5)*(h/w)*tanh(n*pi*w/(2*h)),1,inf);
r2 = symsum((1/k^5)*(192/pi^5)*(h/w)*tanh(k*pi*w/(2*h)),3,inf);
r3 = symsum((1/g^5)*(192/pi^5)*(h/w)*tanh(g*pi*w/(2*h)),5,inf);
Rf = (12*u*Lc)/(h^3*w)*(1-(r1*r2*r3))^-1;
As far as I know this should give me the sums of those first functions and then the following expression give me the value I want, however this is the output I get:
Rf =
-3/(50000*((5507759538957653564026027263058221796454041*sum(tanh(pi*g)/g^5, g == 5..Inf)*sum(tanh(pi*k)/k^5, k == 3..Inf)*sum(tanh(pi*n)/n^5, n == 1..Inf))/178405961588244985132285746181186892047843328 - 1))
r1 =
(176600389502281*sum(tanh(pi*n)/n^5, n == 1..Inf))/562949953421312
r2 =
(176600389502281*sum(tanh(pi*k)/k^5, k == 3..Inf))/562949953421312
r3 =
(176600389502281*sum(tanh(pi*g)/g^5, g == 5..Inf))/562949953421312
If someone could help me fix whatever is wrong I would be very appreciative.
-Phil

댓글 수: 3

Walter Roberson
Walter Roberson 2012년 9월 11일
What is the variable of summation? And does symsum() happen to agree?
Phillip Hatfield
Phillip Hatfield 2012년 9월 11일
It doesn't look like it. I used symvar and it didn't return anything, not sure how I would get matlab to use the variables
You can specify the variable of summation in between the expression and the limits. For example,
symsum(1/k^2, k, 3, inf)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

태그

질문:

2012년 9월 10일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by