double func_Schrodinger(double E, int kmatch, double Veff[], double r[], double dr[], int N)
As discussed in lecture, our basic strategy to find the energies of
the atom is to set
and
at one end of our solution
(r=0 or
), define a function f(E) as the value
of
at the other end, and then seek the roots of f(E).
As discussed in class, there are a variety of methods for root finding, solving one equation in one unknown of the form f(x)=0. Computationally, these methods depend upon calling a function subroutine which returns the value of the function f(x) for any input value x.
Design a routine ``func_Schrodinger'' with the above prototype which calls upon ``schint'' to integrate Schrödinger's equation from k1=0 to k2=N using Psi=0 and Psip=1 as initial conditions, and then returns the final value of Psi.
Note that we do not make use of the argument kmatch but will use it in the next homework.