3 views (last 30 days)

Hi all,

I am having a problem using summation notation. My code is as follows:

syms n x

SumFe56 = symsum(1/n^2*exp(-n^2*pi^2*10^-12*(7.50*10^-12)),n,1,Inf)

BulkFe56 = (20*.9175)+((6*.9175*(9-20))/pi^2)*SumFe56

I am thus trying to do define a sum, titled SumFe56, and then put this value into my BulkFe56 equation to generate a single number answer. When I run my code, however, for the first two lines, I receive this output:

SumFe56 =

symsum(exp(-(161205712616447904232271790533*n^2)/2177807148294006166165597487563316553318400000000000)/n^2, n, 1, Inf)

With the answer for BulkFe56 as follows:

BulkFe56 = 367/20 - (6907963692174921*symsum(exp(-(161205712616447904232271790533*n^2)/2177807148294006166165597487563316553318400000000000)/n^2, n, 1, Inf))/1125899906842624

I am assuming that my summation code was written incorrectly, but I am not sure how. I would like my SumFe56 to just be a single value, which I can then easily put into my code for BulkFe56, to generate, yet again, a single numerical value.

Does anybody have any insight into what I'm doing incorrectly?

Thank you.

David Goodmanson
on 5 Feb 2020

Edited: David Goodmanson
on 5 Feb 2020

Hi Jonathan,

symbolics is just telling you that it can't do the sum explicitly and get an analytic solution. Fortunately the terms fall off plently fast enough so you can just do the sum numerically:

n = 1:1e7;

SumFe56 = sum((1./n.^2).*exp(-n.^2*pi^2*1e-12*(7.5e-12)))

SumFe56 = 1.64493

The argument to the exp function is so small (because of the small multiplicative constants) that the exp function equals almost exactly 1 in the range of n where 1/n^2 is making significant contributions to the sum. It might be worth checking if those constants are correct. The sum is basically what you get by just setting exp = 1

sum{1..inf} 1/N^2 = pi^2/6

format long

SumFe56

S = pi^2/6

SumFe56 = 1.644933966848274

S = 1.644934066848226

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.