Plot the following functions with energy at different temperatures. a) Maxwell-Boltzmann distribution b) Fermi-Dirac distribution c) Bose-Einstein distribution , . - Scilab Solution
a) Maxwell-Boltzmann distribution
b) Fermi-Dirac distribution
c) Bose-Einstein distribution
a) Maxwell-Boltzmann distribution
// Define the constants and energy range
mu = 0.0;
tempE1 = 0.1;
tempE2 = 0.5;
eps = [0.01:0.01:2]';
// Calculate the distribution functions
feps1 = exp(-(eps-mu)/tempE1);
feps2 = exp(-(eps-mu)/tempE2);
// Plot the distribution functions
clf();
plot2d(eps, feps1, style = 2);
plot2d(eps, feps2, style = 3);
xgrid();
xlabel("$\epsilon$", "fontsize", 5, "color", black);
ylabel("$f(\epsilon)$", "fontsize", 5);
title("Maxwell-Boltzmann distribution at different temperatures");
// Display a legend for the two curves
legend(["T = " + string(tempE1), "T = " + string(tempE2)], location = "northwest");
b) Fermi-Dirac distribution
// Define the constants and energy range
mu = 2.0;
tempE1 = 0.1;
tempE2 = 0.5;
eps = [0.01:0.01:6]';
// Calculate the distribution functions
feps1 = 1.0./(exp((eps-mu)/tempE1) + 1.0);
feps2 = 1.0./(exp((eps-mu)/tempE2) + 1.0);
// Plot the distribution functions
clf();
plot2d(eps, feps1, style = -7);
plot2d(eps, feps2, style = -9);
xgrid();
xlabel("$\epsilon$", "fontsize", 5, "color", black);
ylabel("$f(\epsilon)$", "fontsize", 5);
title("Fermi-Dirac distribution at different temperatures");
// Display a legend for the two curves
legend(["T = " + string(tempE1), "T = " + string(tempE2)], location = "northeast");
c) Bose-Einstein distribution
mu = 2.0;
tempE1 = 0.1;
tempE2 = 0.5;
eps = [0.01:0.01:4.2]';
feps1 = 1.0./(exp((eps-mu)/tempE1)+1.0);
feps2 = 1.0./(exp((eps-mu)/tempE2)+1.0);
plot2d(eps,[feps1],2,rect=[0,0,4,2])
plot2d(eps,[feps2],3,rect=[0,0,4,2])
xlabel("$\epsilon$", "fontsize", 5, "color", "black");
ylabel("$f(\epsilon)$", "fontsize", 5);
title("Bose-Einstein distribution at different temperatures");
legend(["T = " + string(tempE1); "T = " + string(tempE2)], location = "northeast");
Comments
Post a Comment