next up previous contents
Next: Debugging Up: Complete and normalized wave Previous: ``interpolate''

``getPsi''

void getPsi(double Psi[], double E, int l,
            double V[], double r[], double dr[], int N)
Output:

Input:

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 tex2html_wrap_inline357 . Your routine will consist of several steps:

First, you should construct the appropriate effective potential,

displaymath359

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 tex2html_wrap_inline363 .

Next, interpolate your result to include values at the odd points using your new routine ``interpolate'', and finally, normalize the result using the formula

displaymath365

where you perform the integral using your ``simpint'' routine.



Tomas Arias
Fri Mar 3 11:23:54 EST 2000