You are on page 1of 12

Project No.

1 Graphical Simulation of Hydrogen Orbitals

Physics 115 Computational Physics -1L
Jay Lord V. Asedilla
Physics Division, Institution of Mathematical Sciences and Physics
University of the Philippines Los Baños

I. Introduction: II. Objective:

A mathematical function that describes The following are the objective if the project.
the wave-like behavior of an electron in an
1.) To construct a valid algorithm for the
atom is what we call atomic orbital, specifically
graphical simulation of the hydrogen
it can be said that it is the possible quantum
orbitals for the energy levels n
states of an individual electron in the electron = 1, 2, ..., 5.
cloud around a single atom, as described by the 2.) To implement as a working computer
function. The orbital can known as either the program the algorithm covered in
mathematical function or the region generated objective #1.
with the function. 3.) To correctly explain the behavior of the
probability density function for the
An atomic orbital is uniquely identified hydrogen atom in relation to position,
by the values of the three quantum numbers, and orbital angular momentum of the
electron with respect to the nucleus.
and each set of the three quantum numbers
corresponds to exactly one orbital, but the
quantum numbers only occur in certain III. Program code:
combinations of values.
Refer to Appendix A.
A hydrogen atom is an atom of the
chemical element hydrogen. It is composed of a IV. Discussion of Algorithm:
single negatively-charged electron circling a
The program code is composed of three
single positively-charged nucleus of the
functions including the main function.
hydrogen atom. The nucleus of hydrogen
Essentially the main concern for the algorithm
consists of only a single proton, or it may also
of the program is the display function. In the
include one or more neutrons. The electron is
main function we just basically have the inputs
bound to the nucleus by the Coulomb force.
and some display concern, but they are not that
We use the wave functions to calculate much important. The init function only
the probability distributions of the hydrogen initializes the displaying window (screen), e.g.
electrons. The position of the electron is spread the glOrtho which is an important one in terms
over space and is not well defined. We use the of displaying good view of the image.
radial wave function R to calculate radial
Much of the programming comes to the
probability distributions of the electron Y for its
display function. The image which is the
spherical harmonics.
hydrogen orbital is displayed using some
equations. To display the image, every points in
displaying window is generated with varying
color intensity depending on the probability
distribution that is given by the following

This function is calculated through psi which is

given by:

Psi given on the formula is in terms of R and Y

(Radial wave function and Spherical Harmonics).
This R and Y were calculated manually before
inputting it into the program. The following
formulas were used for calculating R and Y.

Figure 2: Normalized Spherical Harmonics formula

for n = 1 to n = 4

After knowing how the formulas were used now

how do we generate the points? Since the
formulas used (psi, R , Y) were in terms of r,
theta, and phi two for loop were used for r, and
theta, the element phi was neglected since phi
tags along with i in an exponential function,
doing psi star psi will cancel its existence on the
formula. The for loop of theta is from zero to its
minimum angel to cover a circle that is 2pi
Figure 1: Radial Wave Function for n=1 to n=3
while the for loop of r starts with zero up to rm
(rmax) depending on the size of the ortho.
The used formula was up to n = 5 for both Using glVertex code to generate points with the
Radial and Spherical Harmonics because of the coordinates x, y, 0 determined by the formula x
project specification. = sin(theta), and y = cos(theta). These formulas
were achieved by the using spherical coordinate
system conversion from cartitian coordinate.
The equation on x and y came from the
following formula with phi = 0:
We use Z instead of Y (spherical coordinate) for
a certain specification of view.

Switch-case code was used in selecting

the orbital to be view. One switch-case was
used for each n, l, and m quantum number to
select the certain orbital.

The display function also projects a

coordinate axis that its grid lines is terms of
bohr radius (a) and is scaled to times 5.

V. Program output:

Figure 4: n=2, l=0, m=0

Figure 3: n=1, l=0, m=0

Figure 5: n=2, l=1, m=0

Figure 6: n=2, l=1, m=1 Figure 8: n=3, l=1, m=0

Figure 7: n=3, l=0, m=0 Figure 9: n=3, l=1, m=1

Figure 10: n=3, l=2, m=0 Figure 12: n=3, l=2, m=2

Figure 11: n=3, l=2, m=1 Figure 13: n=4, l=0, m=0
Figure 14: n=4, l=1, m=0 Figure 16: n=4, l=2, m=0

Figure 15: n=4, l=1, m=1 Figure 17: n=4, l=2, m=1
Figure 18: n=4, l=2, m=2 Figure 20: n=4, l=3, m=1

Figure 19: n=4, l=3, m=0 Figure 21: n=4, l=3, m=2
Figure 22: n=4, l=3, m=3 Figure 24: n=5, l=1, m=0

Figure 23: n=5, l=0, m=0 Figure 25: n=5, l=1, m=1
Figure 26: n=5, l=2, m=0 Figure 28: n=5, l=2, m=2

Figure 27: n=5, l=2, m=1 Figure 29: n=5, l=3, m=0
Figure 30: n=5, l=3, m=1 Figure 32: n=5, l=3, m=3

Figure 31: n=5, l=3, m=2 Figure 33: n=5, l=4, m=0
Figure 34: n=5, l=4, m=1 Figure 36: n=5, l=4, m=3

Figure 35: n=5, l=4, m=2 Figure 37: n=5, l=4, m=4

VI. Discussion of the result:

The results show the distinction between

each energy states. The probability that an
electron can be found is high on the region with
brighter color while it is low or almost no
probability at the darker region.
The principal quantum number n dictates  Bransden, B.H.; C.J. Joachain (1983).
the number of the other quantum number (n < l Physics of Atoms and Molecules.
≤ |±m|). It is being observed from the results London: Longman. ISBN 0-582-44401-2.
 Daintith, J. (2004). Oxford Dictionary of
that at n = (1-5), l = 0, m = 0 the display
Chemistry. New York: Oxford University
illustrates a series rings and the number of ring Press. ISBN 0-19-860918-3
is equal to the n. This energy states resembles a  James G. Gilson (10 July 2008). "The
sphere in 3d plotting with the number of core fine structure constant, a 20th century
equal to n. mystery". Retrieved on 2008-07-15.

At n = (2-5), with l = (n-1) and m = ±(n-1)

the display will show a two oblong shape. As n
gets larger the gap between the two objects
becomes wider. At n = (3-5), with l = (n-2) and m
= ±(n-2) the display show 4 symmetric oval
shape that when n gets larger the object or the
distribution becomes wider. The number of
symmetric oval gets larger as l and m (l = |m|)
becomes smaller. The displayed object or
probability distribution of electron seems to
have some pattern. This can be observed in
every state.

VII. Conclusion:

The presented algorithm attached to this

paper has fulfil the objective of graphically
simulating the hydrogen orbital of energy level
n = 1 to 5. This was done through tough
validation of codes. The algorithm was
implemented and the results are shown on the
program output.

The last objective was yet to be achieved.

This is done through explaining the programs
output scientifically.


 Griffiths, David J. (1995). Introduction to

Quantum Mechanics. Upper Saddle
River, NJ: Prentice Hall. ISBN 0-13-