void getPsi(double Psi[], double E, int l, double V[], double r[], double dr[], int N)Output:
- Psi[k]: values of normalized
on all grid points r[k]
Input:
- E: electron energy found from ``getallEs''
- l: angular momentum of
![]()
- V[]: potential on grid points
- r[], dr[], N: standard grid points
Write a routine ``getPsi'', of the above prototype, which produces the
values on the grid r[] of the wave function with energy E and angular
momentum l, properly normalized so that
. Your routine will consist of several steps:
First, you should construct the appropriate effective potential,
Next, you need to determine an appropriate point, kmatch, for matching the inward and outward solutions. To find the outermost point where V(r)<E, you may use the following fragment:
.
.
kmatch=0;
for (k=0; k<=N; k++)
if (Veff[k]<E) kmatch=k;
if (kmatch==0) {
printf("Veff never below E=%f in getPsi.\n",E);
exit(1);
}
.
.
(This is the so-called ``classical turning point''.)
Then, you should perform the inward (k=0..kmatch) and outward
(k=N..kmatch) integrations, scaling both solutions to match so that
Next, interpolate your result to include values at the odd points using your new routine ``interpolate'', and finally, normalize the result using the formula
where you perform the integral using your ``simpint'' routine.