Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

10/18/2017 MATSCI202HW3

In [2]: import numpy as np


import matplotlib.pyplot as plt

Here is the defined equation


1 1
E = hcR( )
2 2
n n
i f

In [38]: def delta_E(n_0,n_f):


dE = (6.626*10**(-34)*(3*10**(8))*(1.097*10**(7)))*(1/(float(n_0)**2)-1/(f
loat(n_f)**2))
in_eV = dE*6.242*10**(18)
return in_eV

This first series lets n0 = 1 and nf ranges from 2 to 13

http://localhost:8888/nbconvert/html/MATSCI202HW3.ipynb?download=false 1/4
10/18/2017 MATSCI202HW3

In [39]: x_1 = np.linspace(1,13,13)


y_1 = np.linspace(1,13,13)
for i in range(1,13):
n_initial = 1
n_final = x_1[i]
energy = delta_E(n_initial,n_final)
y_1[i] = energy

print(y_1)
plt.plot(x_1[2:],y_1[2:])
plt.show()

[ 1. 10.20855661 12.09903006 12.76069577 13.06695246


13.23331413 13.33362496 13.39873055 13.44336673 13.47529473
13.49891784 13.51688514 13.53086794]

As can be seen, this converges to photons with energy 13.5 eV or with wavelengths around 91nm

The next series lets ni = 2 and lets nf range from 3 to 13

http://localhost:8888/nbconvert/html/MATSCI202HW3.ipynb?download=false 2/4
10/18/2017 MATSCI202HW3

In [42]: x_2 = np.linspace(1,13,13)


y_2 = np.linspace(1,13,13)
for i in range(1,13):
n_initial = 2
n_final = x_2[i]
energy = delta_E(n_initial,n_final)
y_2[i] = energy

print(y_2)
plt.plot(x_2[3:],y_2[3:])
plt.show()

[ 1. 0. 1.89047345 2.55213915 2.85839585 3.02475751


3.12506835 3.19017394 3.23481012 3.26673812 3.29036122 3.30832853
3.32231132]

As can be seen, this converges to photons with energy 3.32 eV or with wavelengths around 370nm

The next series lets ni = 3 and lets nf range from 4 to 13

http://localhost:8888/nbconvert/html/MATSCI202HW3.ipynb?download=false 3/4
10/18/2017 MATSCI202HW3

In [43]: x_3 = np.linspace(1,13,13)


y_3 = np.linspace(1,13,13)
for i in range(1,13):
n_initial = 3
n_final = x_3[i]
energy = delta_E(n_initial,n_final)
y_3[i] = energy

print(y_3)
plt.plot(x_3[4:],y_3[4:])
plt.show()

[ 1. -1.89047345 0. 0.66166571 0.9679224 1.13428407


1.2345949 1.29970049 1.34433667 1.37626467 1.39988778 1.41785509
1.43183788]

As can be seen, this converges to photons with energy 1.43 eV or with wavelengths around 820nm

In [ ]:

http://localhost:8888/nbconvert/html/MATSCI202HW3.ipynb?download=false 4/4

You might also like