- #1
Munin
- 4
- 0
So, I've managed to get the distribution in a decent way. Using this code;
Now I want to plot the Energy level occupation numbers where
E=Sum[m*hw*(m+1)*(m+2)*0.5/b*Exp[m*hw/kt]-1
But, I've been unable to do so, and then of course I want to get the Heat Capacity as a function of the temperature, but I think I might be able to manage that if I get some help on this.
I've been stuck for hours, please help me!
Code:
hw = 1;
kt = 25;
n = 10000;
dist[b_] := 1/(b*Exp[hw*m/kt] - 1);
normsum[b_] := Sum[dist[b]*(m + 2)*(m + 1)/2, {m, 0, 300}]
q = FindRoot[normsum[b] == n, {b, 0.5}]
occnumber = Table[N[dist[b /. q]*(m + 2)*(m + 1)/2], {m, 0, sumlim}];
Part[occnumber, 1];
ListPlot[occnumber, PlotRange -> {0, 500}]
Now I want to plot the Energy level occupation numbers where
E=Sum[m*hw*(m+1)*(m+2)*0.5/b*Exp[m*hw/kt]-1
But, I've been unable to do so, and then of course I want to get the Heat Capacity as a function of the temperature, but I think I might be able to manage that if I get some help on this.
I've been stuck for hours, please help me!