Scanning the Internet for External Cloud Exposures via SSL Certs
Numerical solution of the Schr¨odinger equation
1. Zewail city of science and Technology
Assignment 1
Numerical solution of the Schr¨odinger
equation
Author
Mohamed Ramadan
201400711
Supervisor
Dr. Amr Bayoumi
November 1, 2017
2. Assignment 1.
Numerical solution of the Schr¨odinger equation
The time-independent Schr¨odinger equation describing a particle of mass m constrained to motion
in a time-independent, one-dimensional potential V(x) is
−
¯h2
2m
ψ [x] + V [x]ψ[x] = Eψ[x] (1)
and it can be written in terms of the Hamiltonian operator as
ˆHψ[x] = Eψ[x] (2)
where
ˆH = −
¯h2
2m
d2
dx2
+ V [x] (3)
E are energy eigenvalues, and Ψ are time-independent stationary states.
To solve this equation numerically, one must first discretize the functions. A first approach sam-
ples the wave function and potential at a discrete set of N + 1 equally-spaced points in such a way
that position Xj = J × ∆, the index j = 0, 1, 2, 3, ..., N , and ∆ is the interval between adjacent
sampling points. Thus, one may define Xj+1 ≡ Xj + ∆. Such sampling of a particle wave function
and potential is illustrated Fig. 1.
The region in which we wish to solve the Schr¨odinger equation is of length L = N∆. At each
sampling point the wave function has value Ψj = Ψ(xj ). The potential Vj = V(xj ) = 0 for the infinite
potential well, for which we are solving the Schr¨odinger equation.
The first derivative of the discretized wave function Ψ(xj ) in the two-point finite-difference ap-
proximation is:
d
dx
Ψ(xj ) =
Ψ(xj ) − Ψ(xj−1)
∆
(4)
1
3. To find the second derivative of the discretized wave function, we use the three-point finite difference
approximation,which gives:
d2
dx2
Ψ(xj ) =
Ψ(xj−1) − 2Ψ(xj ) + Ψ(xj+1)
∆2
(5)
with boundary conditions Ψ(x0) = Ψ(xN ) = 0
The result is that the original PDE is replaced by a linear system for nodal values:
−¯h2
m∆2
j = 1 Ψ(x0)−2Ψ(x1)+Ψ(x2)
∆2 = EΨ(x1)
j = 2 Ψ(x1)−2Ψ(x2)+Ψ(x3)
∆2 = EΨ(x2)
j = 3 Ψ(x2)−2Ψ(x3)+Ψ(x4)
∆2 = EΨ(x3)
j = 4 Ψ(x3)−2Ψ(x4)+Ψ(x5)
∆2 = EΨ(x4)
In matrix form HΨ = EΨ, where:
d −u 0 0
−u d −u 0
0 −u d −u
0 0 −u d
Ψ1
Ψ2
Ψ3
Ψ4
=
E1
E2
E3
E4
Ψ1
Ψ2
Ψ3
Ψ4
where d = ¯h2
m∆2 and u = ¯h2
2m∆2 .
We can use MATLAB to solve for the eigenvalues and eigenfunctions.
2
4. Solution
1) Using the method outlined, write a MATLAB program to solve the Schr¨odinger wave equation
for the first four eigenvalues and eigenstates of an electron confined to a rectangular potential well
of width L = 10nm bounded by infinite barrier potential energy. Plot the wavefunctions.
L = 10nm and N = 201 so ∆ = 0.04975nm
Firstly,we will calculate the values of d and u which will be :
d =
¯h2
m∆2
=
(1.05457 ∗ 10−34
)2
(9.10938 ∗ 10−31) ∗ (0.04975 ∗ 10−9)2
= 4.9326 ∗ 10−18 (J.S)2
rad2.Kg.m2
u =
¯h2
2m∆2
=
(1.05457 ∗ 10−34
)2
2 ∗ (9.10938 ∗ 10−31) ∗ (0.04975 ∗ 10−9)2
= 2.4663 ∗ 10−18 (J.S)2
rad2.Kg.m2
Substituting in the matrix form then:
H =
4.9326 ∗ 10−18
2.4663 ∗ 10−18
0 0 . .
2.4663 ∗ 10−18
4.9326 ∗ 10−18
2.4663 ∗ 10−18
0 . .
0 2.4663 ∗ 10−18
4.9326 ∗ 10−18
. .
. . . . . .
. . . . . .
. . . . 2.4663 ∗ 10−18
4.9326 ∗ 10−18
Using [V, D] = eigs(H), the eigenvalues,which are E, and eignvectors,which are Ψ can be calcu-
lated.
The eigenvalues are:
E1 E2 E3 E4
D =
0.9864 ∗ 10−17
0 0 0
0 0.9862 ∗ 10−17
0 0
0 0 0.9859 ∗ 10−17
0
0 0 0 0.9855 ∗ 10−17
The eigenvectors are:
Ψ1 Ψ2 Ψ3 Ψ4
V =
−0.0016 0.0031 −0.0047 −0.0062
0.0031 −0.0062 0.0093 0.0124
−0.0047 0.0093 −0.0140 −0.0186
0.0062 −0.0124 0.0186 0.0247
. . . .
. . . .
For plotting, each wavefunction [Ψ1Ψ2Ψ3Ψ4] should be plotted VS. the width of the infinite well,
considering that Ψ0 = Ψ201 = 0 and the step value of x is equal to 0.04975nm.
3
5. Using plot function in MATLAB,the wavefunction vector:
Ψ1 =
0
−0.0016
0.0031
−0.0047
0.0062
.
.
0
can be plotted VS. the well distance: X =
0
0.0498
0.0995
0.1493
0.1990
.
.
10
Considering that Ψ1(x=0)
= Ψ1(x=10)
= 0 ;as these two points are at the walls of the infinite well.
2) Plot the probability density for the obtained wavefunctions.
The plot of the wavefunction of the electron in the first orbital and it’s probability are:
repeating the same steps for [Ψ2Ψ3Ψ4] resulting these plots:
For Ψ2:
4
6. For Ψ3:
For Ψ4:
3) For the ground state (n=1), calculate the probability of finding the electron between 0.25 <
x < 0.75 nm.
The trapz MATLAB function can be used to calculate the probability of finding the electron
between 0.25 < x < 0.75 nm for (n = 1).
The probability (0.25 < x < 0.75) = 0.05
e = [0.2488 : 0.04975 : 0.75]
y = transpose(V (:, N))
z = [0 y 0]
q = 10. ∗ z.2
v = q(1, 6 : 16)
5
7. trapz(e, v) = 0.0026
This is the GUI which can implement all these solutions:
6