Part
Part
MAXWELL BOLTZMANN:
1.
clc;clear;
kb=8.6173303*1D-5 //ev/K
E=[ 0.0 0.01]//energy levels eV
T=[0:20:1500] //temperature
function y=f(T)
y=(exp(-0.0./(kb*T))+exp(-0.01./(kb*T)))^2
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
xgrid(1,1,9)
subplot(2,2,1)
plot(T,f(T))
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[0.0 0.01 0.02 ]
scf(1)
kk=['g*','ro','b--','ko-','*o','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
2.
clc;clear;
kb=8.6173303*1D-5
E=[ 0.1 0.05]
T=[0:20:1500]
function y=f(T)
y=(exp(-0.01./(kb*T))+exp(-0.05./(kb*T)))
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[ 0.01 0.05 ]
scf(1)
kk=['g*','ro','b--','ko-','*o','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
3.
clc;clear;
kb=8.6173303*1D-5 //ev/K
E=[ 0.0 0.01 0.05]//energy levels eV
T=[0:20:1500] //temperature
function y=f(T)
y=(exp(-0./(kb*T))+exp(-0.01./(kb*T))+exp(-0.05./(kb*T)))^2
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[0 0.02 0.1 0.01 0.05 0.06 ]
scf(1)
kk=['g*','ro','b--','ko-','*o','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
BOSE EINSTEIN:
1.
clc;clear;
kb=8.6173303*1D-5 //ev/K
E=[ 0.0 0.01]//energy levels eV
T=[0:20:1500] //temperature
function y=f(T)
y=(exp(-0.0./(kb*T))+exp(-0.01./(kb*T))+exp(-0.02./(kb*T)))
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[0.0 0.01 0.02 ]
scf(1)
kk=['g*','ro','b--','ko-','*o','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
2.
clc;clear;
kb=8.6173303*1D-5 //ev/K
E=[ 0.1 0.05]//energy levels eV
T=[0:20:1500] //temperature
function y=f(T)
y=(exp(-0.01./(kb*T))+exp(-0.05./(kb*T)))
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[ 0.01 0.05 ]
scf(1)
kk=['g*','ro','b--','ko-','*o','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
3.
clc;clear;
kb=8.6173303*1D-5
E=[ 0.0 0.1 0.05]
T=[0:20:2000]
function y=f(T)
y=(exp(-0.0./(kb*T))+exp(-0.01./(kb*T))+exp(-0.05./(kb*T))+exp(-
0.06./(kb*T))+exp(-0.02./(kb*T))+exp(-0.1./(kb*T)))
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[ 0 0.01 0.02 0.05 0.06 0.1 ]
scf(1)
kk=['g*','ro','b--','ko-','+','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)
FERMI DIRAC:
clc;clear;
kb=8.6173303*1D-5 //ev/K
E=[ 0.0 0.1 0.05]//energy levels eV
T=[0:20:2000] //temperature
function y=f(T)
y=(exp(-0.01./(kb*T))+exp(-0.05./(kb*T))+exp(-0.06./(kb*T)))
endfunction
function y1=ln(T)
y1=log(f(T))
endfunction
function y2=h(T)
y2=kb*T*T*numderivative(ln,T)
endfunction
function y3=Cv(T)
y3=numderivative(h,T)
endfunction
function y4=g(T)
y4=-kb*T*ln(T)
endfunction
function y5=k(T)
y5=-numderivative(g,T)
endfunction
function y6=p(e)
y6=exp(-e./(kb*T))./f(T)
endfunction
scf(0)
subplot(2,2,1)
plot(T,f(T))
xgrid(1,1,9)
xtitle("","temperature (k)","partition function")
subplot(2,2,2)
plot(T,h)
xgrid(1,1,9)
xtitle("","temperature (k)","internal energy (eV)")
subplot(2,2,3)
plot(T,Cv)
xgrid(1,1,9)
xtitle("","temperature (k)","specific heat(ev/K)")
subplot(2,2,4)
plot(T,k)
xgrid(1,1,9)
xtitle("","temperature (k)","entropy(ev/K)")
En=[ 0.01 0.05 0.06 ]
scf(1)
kk=['g*','ro','b--','ko-','+','*-*']
for i=1:length(En)
plot(T,p(En(i)),kk(i))
end
xtitle("","temperature (k)","probability of microstate")
legend(string(En)+"eV")
xgrid(1,1,9)