- #1
erok81
- 464
- 0
Homework Statement
In a neutral hydrogen atom, the electronic ground state 1s, and excited state 2s, are given by wave functions
ψ1s = 1/π1/2 1/a3/2 e-r/a
ψ2s = 1/(32π)1/2 (2-r/a)2 e-r/(2a)
where "r" is the radial distance to the nucleus, and "a" is the Bohr radius.
Write a C++ program hatom.cc that calculates the radial probability density,
Pr(r) = 4πr2ψ*ψ,
from r=0 to 10 Bohr radii (r=10a) with a stepsize of dr=0.01a. At each radial step, print out three columns to standard output: r (units of Bohr radii), Pr(r) for the 1s state, and Pr(r) for the 2s state.
To check your output, confirm that your values of Pr are such that the integral of Pr out to 10a gives you something close to unity. (An integral may be crudely approximated using summation of the function at a series of uniformly separated points times the separation (delta x) between adjacent points)
Homework Equations
None.
The Attempt at a Solution
I can see where to get started here, but need a little help understanding the problem.
This part loses me...from r=0 to 10 Bohr radii (r=10a) with a stepsize of dr=0.01a. At each radial step, print out three columns to standard output: r (units of Bohr radii), Pr(r) for the 1s state, and Pr(r) for the 2s state.
I need a for loop that will calculate r=0 to r=10 with an interval of 0.01a. First I am not sure how to make the loop calculate in steps, but can probably figure that. It's the r=10a part that I don't get. I know from my physics classes that the Bohr radius is given by [itex]a_0 = \frac{\hbar}{m_{e} c \alpha}[/itex]. Does it look like you run loop as 0, 1a, 2a, 3a,...10a? With a given by my Bohr radius formula?
I'll probably need a little help with the C++ part as well after I get past this part.
Last edited: