In [2]:

```
import math
#Variable declaration
E = 1.2e+004; # Electric field, V/m
B = 8.8e-004; # Magnetic field, T
l = 0.05; # Length of the deflection plates, m
v0 = E/B; # Initial velocity of the electron, m/s
theta = 30; # Angular deflection of the electron, degrees
#Calculations
q_ratio_m = E*math.tan(theta*math.pi/180)/(B**2*l); # Specific charge of the electron, C/kg
#Results
print "The initial velocity of the electron = %3.1e m/s"%v0
print "The specific charge of the electron = %3.1e C/kg"%q_ratio_m
```

In [1]:

```
import numpy
def check_visible(l):
if l >= 400 and l < 700:
return 1
else:
return 0
R_H = 1.0968e+007; # Rydberg constanr, per metre
f = numpy.zeros(7)
# Lyman series
print "\nFor Lyman series, the wavelengths are:\n"
n = 1.; # The lowest level of Lyman series
for k in range(2,4):
l = 1./(R_H*(1./n**2-1./k**2))/1.e-009;
print "k = %d, %5.1f nm"%(k, l);
f[k-1] = check_visible(l);
if f[k-1] == 1:
print(" (Visible) \n");
else:
print(" (Ultraviolet)\n");
if f[0] == 1 or f[1] == 1 or f[2] == 1:
print("Some wavelengths of Lyman series fall in the visible region.\n")
else:
print("All the wavelengths of Lyman series fall in the UV-region.\n")
# Balmer series
print("\nFor Balmer series, the wavelengths are:\n")
n = 2; # The lowest level of Balmer series
for k in range(3,8):
l = 1./(R_H*(1./n**2.-1./k**2))/1.e-009;
print "k = %d, %5.1f nm"%(k, l);
f[k-1] = check_visible(l);
if f[k-1] == 1:
print(" (Visible) \n");
else:
print(" (Ultraviolet)\n");
# Paschen series
print("\nFor Paschen series, the wavelengths are:\n")
n = 3.; # The lowest level of Lyman series
for k in range(4,6):
l = 1./(R_H*(1./n**2-1./k**2))/1e-009;
print "k = %d, %5.1f nm"%( k, l);
f[k-1] = check_visible(l);
if f[k-1] == 1:
print(" (Visible) \n");
else:
print(" (Infrared)\n");
# For limiting member
k = numpy.inf;
l = 1/(R_H*(1/n**2-1/k**2))/1e-009;
print "k = %f, %5.1f nm"%(numpy.inf, l);
f[5] = check_visible(l);
if f[5] == 1:
print(" (Visible) \n");
else:
print(" (Infrared)\n");
if f[3] == 1 or f[4] == 1 or f[5] == 1:
print("Some wavelengths of Paschen series fall in the visible region.")
else:
print("All the wavelengths of Paschen series fall in the IR-region.")
```

In [3]:

```
import math
#Variable declaration
T = 1600 + 273; # Temperature of the furnace, K
b = 2.898e-003; # Wein's constant, m-K
#Calculation
lamda_max = math.ceil(b/(T*1e-009)); # Maximum wavelength from Wein's Displacement Law, nm
#Results
print "The maximum wavelength emitted from the heated furnace = %4d nm"%lamda_max
print "This wavelength falls in the IR-region."
#answers differ due to rounding errors
```

In [4]:

```
import math
#Variable declaration
lambda_max = 500e-009; # Maximum intensity wavelength emitted by the sun, m
b = 2.898e-003; # Wein's constant, m-K
sigma = 5.67e-008; # Stefan's constant, W/Sq.m-K^4
r = 6.96e+008; # Radius of the sun, m
r_E = 6.37e+006; # Radius of the earth, m
R_E = 1.49e+011; # Mean-earth sun distance, m
#Calculations
S = 4*math.pi*r**2; # Surface area of the sun, Sq.m
T_sun = b/lambda_max; # The temperature of the sun's surface, K
R_T = sigma*T_sun**4; # Power per unit area radiated by the sun, W/Sq.m
P_sun = R_T*S; # The total power radiated from the sun's surface, W
F = r_E**2/(4*R_E**2); # Fraction of sun's radiation received by Earth
P_Earth_received = P_sun*F; # The radiation received by the Earth from the sun, W
U_Earth = P_Earth_received*60*60*24; # The radiation received by the Earth from the sun in one day, J
R_Earth = P_Earth_received/(math.pi*r_E**2); # Power received by the Earth per unit of exposed area, W/Sq.m
#Results
print "The surface temperature of the sun = %4d K"%math.ceil(T_sun)
print "The power per unit area emitted from the surface of the sun = %4.2e W/Sq.m"%R_T
print "The energy received by the Earth each day from the radiation of sun = %4.2e J"%U_Earth
print "The power received by the Earth per unit of exposed area = %4d W/Sq.m"%math.ceil(R_Earth)
#Answers differ due to rounding errors
```

In [5]:

```
#Variable declaration
phi = 2.36; # Work function of sodium, eV
N_A = 6.02e+023; # Avogadro's number
e = 1.6e-019; # Energy equivalent of 1 eV, J
I = 1e-008; # Intensity of incident radiation, W/Sq.m
K = 1.00; # Kinetic energy of the ejected photoelectron, eV
rho = 0.97; # Density of Na atoms, g/cc
M = 23; # Gram atomic mass of Na, g/mol
#Calculations
n = N_A*1e+006/M*rho; # Number of Na atoms per unit volume, atoms/metre-cube
# Assume a cubic structure, then 1/d^3 = n, solving for d
d = (1./n)**(1./3); # Thickness of one layer of sodium atoms, m
N = n*d; # Number of exposed atoms per Sq.m
R = I/(N*e); # Rate of energy received by each atom, eV/s
t = (phi+K)/R; # Time needed to absorb 3.36 eV energy
#Result
print "The exposure time of light to produce the photoelectron of %4.2f kinetic energy = %4.1f years"%(K, t/(60*60*24*365.25))
```

In [6]:

```
#Variable declaration
phi = 2.93; # Work function of lithium, eV
lamda = 400e-009; # Wavelength of incident light, m
e = 1.6e-019; # Energy equivalent of 1 eV, J
c = 2.998e+008; # Speed of light in vacuum, m/s
h = 6.626e-034; # Planck's constant, Js
#Calculations
E = h*c/(lamda*e); # Energy of incident light, eV
V0 = E - phi; # Stopping potential, V
#Results
print "The energy of incident photons = %4.2f eV"%E
print "The stopping potential = %4.2f V"%V0
```

In [7]:

```
#Variable declaration
phi = 2.93; # Work function of lithium, eV
c = 2.998e+008; # Speed of light in vacuum, m/s
K = 3.00; # Kinetic energy of photoelectron, eV
E = phi + K; # Total energy of the incident light, eV
h = 6.626e-034; # Planck's constant, Js
e = 1.6e-019; # Energy equivalent of 1 eV, J
#Calculations
f = E*e/h; # Frequency of incident light, Hz
lamda = c/f; # Wavelength of the incident light, m
#Results
print "The frequency of incident light = %4.2e Hz"%f
print "The wavelength of the incident light = %4.2f nm"%(lamda/1e-009)
```

In [11]:

```
#Variable declaration
lamda = 350; # Wavelength of incident light, nm
e = 1.6e-019; # Energy equivalent of 1 eV, J
E = 1.250e+003/lamda; # Total energy of the incident light, eV
I = 1e-008; # Intensity of incident light, W/Sq.m
#Calculations
# As Intensity, I = N*E, solving for N
N = I/(E*e); # The number of photons in the light beam
#Results
print "The number of photons in the light beam = %3.1e photons/Sq.m/s"%N
```

In [9]:

```
#Variable declaration
e = 1.6e-019; # Energy equivalent of 1 eV, J
c = 2.998e+008; # Speed of light in vacuum, m/s
h = 6.626e-034; # Planck's constant, Js
V0 = 35e+003; # Electron acceleration voltage, V
#Calculations
lambda_min = h*c/(e*V0); # Duane-Hunt rule for wavelength, m
#Result
print "The minimum wavelength of X-rays = %4.2e m"%lambda_min
```

In [10]:

```
import math
#Variable declaration
c = 2.998e+008; # Speed of light in vacuum, m/s
h = 6.626e-034; # Planck's constant, Js
m_e = 9.11e-031; # Rest mass of an electron, kg
lamda = 0.050; # Wavelength of the X-ray, nm
theta = 180; # The angle at which the recoil electron Ke becomes the largest, degree
#Calculations
E_x_ray = 1.240e+003/lamda; # Energy of the X-ray, eV
lambda_prime = lamda + (1-math.cos(theta*math.pi/180))*h/(m_e*c*1e-009); # The largest wavelength of the scattered photon, nm
E_prime_x_ray = 1.240e+003/lambda_prime; # Energy of the scattered photon, eV
K = (E_x_ray - E_prime_x_ray)/1e+003; # Kinetic energy of the most energetic recoil electron, keV
if (E_prime_x_ray < E_x_ray):
print "The X-ray is Compton-scattered by the electron."
else:
print "The X-ray is not Compton-scattered by the electron."
#Results
print "The largest wavelength of the scattered photon = %5.3f nm"%lambda_prime
print "The kinetic energy of the most energetic recoil electron = %3.1f keV"%K
print "The angle at which the recoil electron energy is the largest = %d degrees"%theta
```