previous up next print clean
Next: The Problem Up: Karrenbach: automatic differentiation Previous: The PROCESS OF AUTOMATIC


For testing the preprocessor JAKEF, I chose to implement Toldi's (1985) objective function for velocity analysis. This example incorporates several numerical computations, which are typically used in exploration geophysics. Toldi's objective function (a simplified version for one CMP) can be described with the following formula and algorithm:

{\rm semb} = 
{\lbrace\sum_x Data( x,
t=\sqrt{(\tau_i^2 + ...
 ...ta( x,
t=\sqrt{(\tau_i^2 + w_i^2({\bf s}) x^2)}~) \rbrace^2
}\end{displaymath} (4)

This objective function measures the quality of a CMP gather stack by using semblance as a quality measure. Semblance is a nonlinear function of the input parameters, the interval slowness ${\bf s}$. In algorithmic terms we can write:

for each zero-offset time $\tau_i$ 
				 calculate stacking slowness wi (a)
				 calcluate moveout curve 		 (b)
				 calculate semblance $f(w_i({\bf s}))$ (c)
		add up all semblance values 

A subroutine (Appendix A) can be written that combines all these three steps. In order to see how we can use automatic differentiation, let's look at a subroutine for step (a):

	subroutine rmsv(nt,slowint,rms,dt)
	integer nt
	real slowint(nt)
	real dt
	real rms(nt)
	integer it

real sum,tau real jacob

do it=1,nt { sum = 0. do j=1,it { sum = sum + dt/(slowint(j)*slowint(j)) } tau = it*dt rms(it) = sqrt ( tau / sum )


# return stacking velocities rms

return end

This subroutine calculates the RMS slowness from a given interval slowness model. The second line in the routine is a keyword construct that tells the preprocessor that we want to calculate the Jacobian of the rms-slowness model (dependent variable) with respect to the interval slowness model (independent variable). The velocity model is a taken for only one CMP gather and constant velocity, just to illustrate the process of automatic differentiation. The preprocessor produces a subroutine in Fortran77 that simultaneously evaluates the RMS velocity function and calculates the Jacobian. Figure [*] shows the interval slowness model and the associated Jacobian for the RMS velocity model. The calculation is accurate to machine precision. We see that the Jacobian has values only below the diagonal, because an RMS slowness value at $\tau_i$ does not depend on interval slowness values below the point $\tau_i$. As we can see, the automatic differentiation works well on that piece of the algorithm. The calculation for step (b) proceeds successfully.

Figure 1
Comparison of the Jacobian of a RMS slowness model and the interval slowness model evaluated at the given model points. JAKEF produced a subroutine to evaluate the function and its Jacobian.

previous up next print clean
Next: The Problem Up: Karrenbach: automatic differentiation Previous: The PROCESS OF AUTOMATIC
Stanford Exploration Project