Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 71
# In this worksheet,you will calculate energies and wave functions of a particle in a one-dimensional box as a function of quantum number, n, and the length of the box, L. The formula for calculating energy for a particle in a box is var("n m h L E") show(E==(n**2*h**2)/(8*m*L**2))
(n, m, h, L, E)
E=h2n28L2m\displaystyle E = \frac{h^{2} n^{2}}{8 \, L^{2} m}
# where n is the quantum number, # h is Planck's constant (Js), # m is the mass of an electron (kg), and # L is the length of the box (m) E = ((n**2*h**2)/(8*m*L**2)) show(E)
h2n28L2m\displaystyle \frac{h^{2} n^{2}}{8 \, L^{2} m}
h = 6.62606931*10**(-34)
m = 9.10938356*10**(-31)
# Quantum number, n, is an integer greater than or equal to 1. Enter your value for n below: n = 1
# L is the length of the box in meters. Insert your value for L in meters below: L = 1*10**(-9)
E
1/8*h^2*n^2/(L^2*m)
# E.substitute(all of the values we assigned above) or simply copy and paste the equation and run 1/8*h^2*n^2/(L^2*m)
6.02466596830344e-20
# Now we will attempt to graph the energy as a function of n # We can make a graph to show how energy changes as a function of n, leaving L constant # Start by restarting the Sage worksheet. (Since we are ignoring the top of the worksheet, we have to redeclare our variables) var("n m h L E") E = n**2*h**2/(8*m*L**2)
(n, m, h, L, E)
h = 6.62606931*10**(-34)
m = 9.10938356*10**(-31)
# Insert your value for L in meters below: L = 1*10**(-9)
#Let us take the time to now define E formally as a function of n E(n) = n**2*h**2/(8*m*L**2)
E(1) E(2) E(3) E(4) E(5) E(6) E(7) E(8) E(9) E(10)
6.02466596830344e-20 2.40986638732138e-19 5.42219937147310e-19 9.63946554928550e-19 1.50616649207586e-18 2.16887974858924e-18 2.95208632446869e-18 3.85578621971420e-18 4.87997943432579e-18 6.02466596830344e-18
plot(n**2*h**2/(8*m*L**2), xmin=0, xmax=10, color = "white") + point((1 , 6.02466596830344e-20), size= 50)+ point((2 , 2.40986638732138e-19), size= 50)+ point((3 , 5.42219937147310e-19), size= 50)+ point((4 , 9.63946554928550e-19), size= 50)+ point((5 , 1.50616649207586e-18), size= 50)+ point((6 , 2.16887974858924e-18), size= 50)+ point((7 , 2.95208632446869e-18), size= 50)+ point((8 , 3.85578621971420e-18), size= 50)+ point((9 , 4.87997943432579e-18), size= 50)+ point((10 , 6.02466596830344e-18), size= 50)
# While the above graph sucessfully shows E in terms of n, the coding is very cumbersome. Fortunately I stumbled upon the command seen below which is much nicer. Thus, the finalized document will have cells 57-74 deleted. list_plot([n**2*h**2/(8*m*L**2) for n in range(11)])
# Next we will try to graph energy as a function of n and L # To begin this section, restart the cells once again and proceed from this point on. var("n m h L E") h = 6.62606931*10**(-34) m = 9.10938356*10**(-31) def E(n,L): return n**2*(6.62606931*10**(-34))**2/(8*(9.10938356*10**(-31))*L**2)
(n, m, h, L, E)
E(1, 1*10**(-9))
6.02466596830344e-20
P = plot3d(E,(1,10), (1*10**(-9) , 1*10**(-6)))
P.show()
3D rendering not yet implemented
sqrt(4)
2
# Lastly, we are going to explore wave functions of different energy levels for a given box length L. The function f_n(x) is the wave function of energy level n. # Restart now and continue var("n m h L E") h = 6.62606931*10**(-34) m = 9.10938356*10**(-31) L = 1 * 10**(-9) def f(x,n): return sqrt(2/L)*sin(n*pi*x/L)
(n, m, h, L, E)
show(f(x,n))
200005sin(1000000000πx)\displaystyle 20000 \, \sqrt{5} \sin\left(1000000000 \, \pi x\right)
f(1,1)
0
n=1
plot(f(x,n), xmin=0, xmax=L)