# Debye equation of specific heat + integration with iteration

I am new to mathematica. I would like to have the result of one integration (Debye equation of specific heat) as a .dat file. Also I want to perform the integration with iteration. I am able to perform the equation once but it did not go for the loop. instead it is giving me same values again and again, which seems correct also as I think my code is not correct.

I have tried like as follows:

P = (9*4*8.314*(i/160)^3)*
NIntegrate[((x^4)*Exp[x])/(Exp[x] - 1)^2, {x, 0, 160/i}]
Do[Print[Column[{i, P}]], {i, 300}]
Plot[P, {i, 0, 300}]


and I am getting like:

1 0.00189811

2 0.00189811

3 0.00189811

Try this:

data = {};
Do[
data = AppendTo[
data, {i, (9*4*8.314*(i/160)^3)*
NIntegrate[((x^4)*Exp[x])/(Exp[x] - 1)^2, {x, 0,
Evaluate@(160/i)}]}],
{i, 300}
]
ListPlot[data, DataRange -> {1, 300}, Joined -> True];
Export["data.txt", data[[All, 2]], "Text"]


• Thank you Jose Antonio Diaz Navas for the help. Would you please tell me how to extract the result as a text file. Nov 22, 2017 at 12:06
• @SRIKANTAGOSWAMI see my edit of the reply. You can save only the data corresponding to a P or if you want all the values just Export["data.txt", data, "Text"] Nov 22, 2017 at 12:18
• Thank you So much for the much needed help..Thank you @José Antonio Díaz Navas .. Nov 22, 2017 at 12:19
• Please, when you ask questions and accept, or consider the answer useful, upvote to who replies. This is the best way to acknowledge their help Nov 22, 2017 at 12:34
• Ok..I did not know..I just did..But as I have less than 15 reputations it showed the following. "Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score." Nov 23, 2017 at 4:54