As we discussed in class, using fourth-order Runge-Kutta to solve
F'(x)=g(x) is equivalent to integrating
with
Simpson's rule. Debug your version of ``rk4ind'' by comparing the
output of the following code fragment with the output of your
``simpint'' routine for an appropriately designed ``derivs''
routine:
.
.
.
[Define f, r, dr, and Nu]
.
.
.
h=2./float(Nu)
dk=2
v(1)=0.
do k=1,Nu-1,2
x=(k-1)*h
call dphi(x,v,dv,k,f,r,dr,Nu)
call rk4ind(v,dv,1,x,h,v,dphi,k,dk,f,r,dr,Nu)
enddo
write(6,*) simpint(f,r,dr,Nu),v(1)
.
.
.