Zmax Calculator
for Stern-Gerlach

Button["Open (Subscript[Z, max]) Calculator",ZmaxDialog]

?Zmax

Zplot

Initialization Code

Constants of nature

Needs["Units`"]
Needs["PhysicalConstants`"]

(Subscript[μ, B])=Convert[BohrMagneton,Joule/Tesla];
(Subscript[k, B])=Convert[BoltzmannConstant,Joule/Kelvin];
T[tempC_]:=ConvertTemperature[1.0tempC,Celsius,Kelvin]Kelvin

Dimensions of the apparatus

(Subscript[L, 2])=12.7 Centimeter;
(Subscript[L, 3])=7.9 Centimeter;
dLogB=1.76(Centimeter^(-1));

Zmax as a function of B and Temperature

Zmax[Bz_,Toven_]:=Bz Convert[(((Subscript[L, 2])(((Subscript[L, 2])/2)+(Subscript[L, 3]))(Subscript[μ, B]))/(6(Subscript[k, B]) T[Toven]))dLogB  (Tesla/(Milli Meter)),1]
Zmax::usage="Zmax[B,(Subscript[T, oven])] calculates (Subscript[Z, max]) (in millimeters) for magnetic field B (Tesla) and oven temperature (Subscript[T, oven]) (Celsius). The expected distance between peaks is twice Zmax."

The plot

Zplot=Plot[{Zmax[b,116]},{b,0,2},AspectRatio->1,Frame->True,PlotLabel->Style["(Subscript[Z, max]) for 116°C Oven",Larger],GridLines->Automatic,GridLinesStyle->GrayLevel[.85],PlotStyle->Thick,FrameLabel->{Style["B (Tesla)",Larger,Italic],Style["(Subscript[Z, max]) (millimeters)",Larger,Italic]},ImageSize->450];

Here is a dynamic calculator of Zmax in a dialog window

ZmaxNotebook=Notebook[{}];

ZmaxDialog :=If[ZmaxNotebook===Notebook[{}],
ZmaxNotebook=CreateDialog[
{Manipulate[
Block[{z},
z=Zmax[Bz,Toven];
Grid[{
{Tooltip[Style["(Subscript[Z, max]) (mm): ",FontFamily->"Helvetica"],"(Subscript[Z, max]) calculated from the magnetic field and oven temperature"],Tooltip[Style[ToString[ Round[z,.001]],FontFamily->"Helvetica"],"(Subscript[Z, max]) calculated from the magnetic field and oven temperature (millimeters)"]},{}
},Alignment->{Left,Baseline}](* Grid *)
](* Block *),
Style["Enter Magnetic Field (Tesla) and Oven Temp (Celsius):",Larger],"",
{{Bz,1.0,
"Magnetic Field (Tesla)"}
,ControlType->InputField},
{{Toven,116.,
"Oven Temperature (Celsius)"}
,ControlType->InputField},
AppearanceElements->None](* Manipulate *)
},
Magnification->1.5,
Deployed->True,ShowCellBracket->False,Saveable->False,
WindowSize->All (*,WindowFrame->"Normal",WindowElements->"MagnificationPopUp" *),WindowFloating->False,
WindowTitle->"Zmax Calculator - Physics 7 Stern-Gerlach",
NotebookEventActions->{"WindowClose":>(ZmaxNotebook=Notebook[{}];)}
];,SetSelectedNotebook[ZmaxNotebook]];