File:Fermi Gas.gif

Summary

Description
English: Fermions can't occupy the same energy state, so (at zero temperature) they just pile up until the last one has an energy known as the "Fermi energy". At nonzero temperature the lower energy fermions can't do anything because there is no free state to excite them too, but the ones close to the Fermi energy can be excited, and thus (e.g.) contribute to conductivity.
Date
Source https://mathstodon.xyz/@j_bertolotti/112365117189864463
Author Berto
Permission
(Reusing this file)
https://mathstodon.xyz/@j_bertolotti/111363365323269417

Mathematica 14.0 code

pfd[\[CapitalEpsilon]_, \[Mu]_, T_] := 1/(Exp[(\[CapitalEpsilon] - \[Mu])/(T)] + 1);
nparticles = 100;

plot[T_] := Module[{occupation, excited, j, n},
  occupation = Boole[RandomReal[] <= #] & /@ Table[pfd[en, nparticles, T], {en, 1, nparticles}];
  dim = Dimensions[occupation][[1]];
  excited = {};
  If[Dimensions[Position[occupation, 0]][[1]] > 0,
   For[i = 1, i <= Dimensions[Position[occupation, 0]][[1]], i++,
    j = 0;
    Until[n == 1 && (Not@MemberQ[excited, j]),
     j++;
     If[j > 3*T, Break[];];
     n = Boole[RandomReal[] <= Exp[-(nparticles + j - Position[occupation, 0][[i, 1]])/T] ];
     ];
    AppendTo[excited, j];
    ];
   occupation = 
    Join[occupation, Table[If[MemberQ[excited, j], 1, 0], {j, 1, Max[excited]}]];
   ];
  Plot[pfd[e, nparticles, T], {e, 0, 1.7*nparticles}, PlotStyle -> Directive[Thickness[0.01], Purple], Axes -> False, PlotRange -> {{-10, 1.9*nparticles}, {-0.1, 1.1}},
   Prolog -> {Orange, Rectangle[{nparticles - T, 0}, {nparticles + T, 1}], Black, Arrow[{{0, 0}, {1.9*nparticles, 0}}], Arrow[{{0, 0}, {0, 1.1}}], Text[Style["Fermi Energy", Medium, Bold], {nparticles, 1.05}], Text[Style["\!\(\*SubscriptBox[\(k\), \(B\)]\)T", Medium, Bold, Orange], {nparticles + T + 10, 0.8}]},
   Epilog -> {Table[ Disk[{j, 0}, 1*occupation[[j]]*{1, 1/nparticles}], {j, 1, Dimensions[occupation][[1]]}], Thick, Dashed, Line[{{nparticles, 0}, {nparticles, 1}}], Rotate[Text[Style["Fermi Function", Medium, Bold], {-5, 0.5}], \[Pi]/2], Text[Style["Energy", Medium, Bold], {0.8*nparticles, -0.06}]}]
  ]

sinstep[t_] := Sin[\[Pi]/2 t]^2;
frames = Flatten@Table[Table[plot[20*sinstep[t] + 0.001], {3}], {t, 0, 1, 0.01}];
ListAnimate[frames]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Fermi%20Gas.gifCategory:Self-published work
Category:Animated GIF files Category:Images with Mathematica source code Category:Fermions Category:Animations of statistical mechanics Category:Condensed matter
Category:Animated GIF files Category:Animations of statistical mechanics Category:CC-Zero Category:Condensed matter Category:Fermions Category:Images with Mathematica source code Category:Self-published work