import java.util.Scanner; class finest { public static void main(String[] args) { /* Sommerfeld (= Dirac ) model fine structure */ double c=2.99792e8; /* = light speed m/s */ double h=6.626069e-34; /* = planck constant Js */ double hbar= 1.05457e-34; /* = plank/2pi Js */ double mu=1.256637e-6; /* = magnetic permeability */ double epsi=8.854187e-12; /* = electric permittivity */ double ele=1.602176e-19; /* = electron charge Q */ double me=9.1093826e-31; /* = electron mass kg */ double pai=3.141592653589793; /* = pi */ double ah=(epsi*h*h)/(pai*ele*ele*me); /* = Bohr radius (m) */ Scanner stdIn=new Scanner(System.in); System.out.println("central charge (= Z )H "); double Z=stdIn.nextDouble(); System.out.println("energy level ( n = 2, 3 ... )H "); double n=stdIn.nextDouble(); System.out.println("Input '1' (= j3/2 - j1/2 ), '2' (= j5/2-j3/2) ... "); double l=stdIn.nextDouble(); /* l = angular momentum */ double jd=l-0.5; double ju=l+0.5; /* lower and upper j */ double alpha=(ele*ele)/(4.0*pai*epsi*hbar*c); /* finestructure constant */ double Ad =n-jd-0.5+Math.sqrt((jd+0.5)*(jd+0.5) - Z*Z*alpha*alpha ); double Au =n-ju-0.5+Math.sqrt((ju+0.5)*(ju+0.5) - Z*Z*alpha*alpha ); /* Energy in Dirac hydrogen */ double Ed = (me*c*c)/(Math.sqrt(1.0+(Z*Z*alpha*alpha)/(Ad*Ad) )); double Eu = (me*c*c)/(Math.sqrt(1.0+(Z*Z*alpha*alpha)/(Au*Au) )); /* fine = fine structure spilitting by Dirac, sommerfeld */ double fine=(Eu-Ed)*6.241509e18; /* energy J >> eV */ /* W = approximate energy form (eV) = Z^4/n^3 form */ double chuu=(ele*ele*hbar*hbar)/(4.0*me*me); double W=(2.0* mu * chuu * Z*Z*Z*Z)/(4.0*pai*ah*ah*ah*n*n*n*l*(l+1)) * 6.241509e18; System.out.print("\n" ); System.out.print(" principal quantum number n = "+ (int)n + "\n" ); String upp="3/2"; String low="1/2"; if ( (int)l ==2 ) { upp="5/2"; low="3/2"; } if ( (int)l ==3 ) { upp="7/2"; low="5/2"; } if ( (int)l ==4 ) { upp="9/2"; low="7/2"; } if ( (int)l ==5 ) { upp="11/2"; low="9/2"; } System.out.print("Dirac energy level, upper j="+ upp + " lower j="+ low + "\n" ); System.out.printf(" \n"); System.out.print(" Sommerfeld upper, nr=" + (int) (n-ju-0.5) + " angular ="+ (int)(ju+0.5) + "\n" ); System.out.print(" Sommerfeld lower, nr=" + (int) (n-jd-0.5) + " angular ="+ (int)(jd+0.5) + "\n" ); System.out.printf(" \n"); System.out.printf(" finestructure by original equation = %.8f (eV) \n ", fine); System.out.printf(" finestructure by Z^4/n^3 form = %.8f (eV) \n", W); System.out.printf(" \n"); double cfine =fine * 8.065544e3; /* ( eV >> cm-1 ) */ System.out.printf(" finestructure : %.4f (cm-1) \n ", cfine); System.out.printf(" \n"); }}