How to plot the 'symbolic' equation against 'symbols'

Hi,I am trying to plot the graph to see the trend but to no avail. I tried using ezplot but again no use. Can some please tell me how I can get 1/(b*h)against heatC , as in the following code? Thank you.
%pfunc=partition function
% b=1/(kT)
%h=spacing between two lowest intervals=epsilon
%energy= h*(1.03*n-.03*n^2)
syms b h k T
for n=0:15
p(n+1)=exp(-b*(h*(1.03*n-.03*n^2)));
%pretty(p(n+1))
end
avg_energy(1)=0;
for n=0:15
j(n+1)= (h*(1.03*n-.03*n^2));
k(n+1)=exp(-b*(h*(1.03*n-.03*n^2)));
E(n+1)=j(n+1)*k(n+1);
end
Avg_energy=sum(E);
%heat capacity =C
heatC = diff(Avg_energy);
plot(1/(b*h),heatC)

Réponses (0)

Question posée :

le 21 Nov 2013

Community Treasure Hunt

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

Start Hunting!

Translated by