Text Box: code cpp/test.c  converts the data in cpp/zeff.out to a function
#include <stdio.h>
double zeff(double x)
{  static int nc=0;
   int i,input;
   double h=0.01,dum;
   static double zfile[2001];
   FILE *fp;
   if(nc == 0)
     {nc=1;
      fp=fopen("zeff.out","r");
      if(fp == NULL){printf(" cannot open file zeff.out \n");
        return -1;}
      zfile[0]=11;
      for(i=1;i<=2000;i++)
        {input=fscanf(fp, "%lg %lg", &dum, &zfile[i]);}
      }

   i=x/h;
   if(i < 0 )return 11;
   if(i > 2000)return 1;
/*   z(i)+(x-i*h)*z'(i) */
   dum=zfile[i]+(x-h*i)*(zfile[i+1]-zfile[i])/h;
   return dum;}

   void main()
{  int itest;
   double funval,x;
   again:
   printf("enter a value for zeff -1 to stop\n");
   itest=scanf("%lg",&x);
   if(x == -1)return;
   funval = zeff(x);
   printf(" funval = %lg \n",funval);
   goto again;}
In this case the orbital energy of the 1s state is

(0.1)

1.      Calculate the energy of the 1s orbital in equation 1.6 suggested Fortran codefor/ASS4_1.FOR I took the 1s orbital from for/plotsorbs.for but made everything double precision.  The result was not quite as accurate as I hoped.  Writing the file out and reading it back in is not a very efficient way of keeping track of it.  I works, but I am sure that you can do better, however, …

2.      Use the Amoeba to fit the 1s orbital in equation 1.6 to the form Text Box:       PLOTPSIA.FOR.
     IMPLICIT REAL*8 (A-H,O-Z)
      DIMENSION CONS(4)
      REAL*4 PSIAT,RT
      DATA CONS/0.1276787D-02,0.5877620D+01,
     2 0.2146897D-01,0.2399382D+01/
      OPEN(1,FILE='PSIA.OUT')
      DO I=1,20
        R=.2D0*I
        PSIA=0
        IF(R.LT.CONS(4))THEN
          SPLINE=(CONS(4)-R)**3
          PSIA=CONS(3)*SPLINE
        ENDIF
        IF(R.LT.CONS(2))THEN
          SPLINE=(CONS(2)-R)**3
          PSIA=PSIA+CONS(1)*SPLINE
        ENDIF
        RT=R
        PSIAT=PSIA
        WRITE(1,*)RT,PSIAT
      ENDDO
      CLOSE(1)
      STOP 'normal end'
      END
 Note that the inefficient code in part 1 makes a file that can be used in this part.  My solution is of the form for/FINDPSI.FOR.  This gives an answer that seems goodsee text box test2.out.  But is it.  I decide to plot the result

3.          Use the amoeba to minimize the energy with respect to c1, c2, c3, and c4.

4.      Use the amoeba to fit the 2s orbital in equation 1.7 to the form


 where the prime means j=1, 3, 5.

5.      Use the amoeba to minimize
 

Text Box:     File test2.out
    0.1276787E-02       0.5877620E+01       0.2146897E-01       0.2399382E+01
    0.3508034E-02
    0.1276771E-02       0.5877632E+01       0.2146883E-01       0.2399392E+01
    0.3508034E-02
    0.1276759E-02       0.5877628E+01       0.2146887E-01       0.2399392E+01
    0.3508034E-02
    0.1276766E-02       0.5877615E+01       0.2146887E-01       0.2399403E+01
    0.3508033E-02
    0.1276751E-02       0.5877629E+01       0.2146908E-01       0.2399391E+01
    0.3508034E-02.

with respect to the same constants as in #4 above.

6.      Repeat for


7.      Change the large r boundary condition to

for the 3S wave function.

8.      Plot the energy of the 3S wave function as a function of rs for 2 < rs < 10.

 

Take the derivative of the energy “analytically”

 

Then integrate the first term by parts, note that in the strict r form, the boundary at zero is not zero at r=0, it is zero at x, y, z = +- infinity.

 

Now of course, I have simply re-derived the Schroedinger equation.  We note however that solving it is equivalent to minimizing the energy for every possible value of c, and hence every parameterization of the wave function.  More importantly, it has a zero everywhere.  In particular let us minimize.

 

Del2

            Very little in this life is free.  Now we need to take a second derivative.  Consider a function of r.

 

Now back to the expansion of f.

(2)

subtract the sum  plus  from   

(3)