MATLAB velocity tools

2.8 MATLAB velocity tools

To this point, the discussion of velocity measures has been illustrated with an instantaneous veloc- ity whose form is a known analytic function. More realistically, velocity functions are inherently numerical because they are derived from experiment. The conversion of such numerical velocities

2.8. MATLAB VELOCITY TOOLS

2500 3000 3500 4000 meters/sec

meters/sec

meters/sec

Figure 2.9: (Left) A five legged v ins (z) with lin- Figure 2.10: (a) v ins (τ ) from Figure 2.9. (b) ear variation between the knees. (Right) The

finely sampled v rms (τ ). (c) de-sampled v rms (τ ). curve on the left has been converted to v ins (τ ).

(d) ten legged interval rms approximation to The variation between the knees is no longer lin-

v ins (τ ).

ear. from one form to another is often necessary in data processing and software tools are required for

this purpose. Two alternate approaches are (1) fit the numerical velocity functions with an n th order polynomial and perform the necessary integrations using polynomial integration rules, or (2) implement a numerical integration scheme for the conversion formulae. The second approach is taken here.

Five functions are available to convert velocity functions from one form to another. There is also

a utility plotting function to draw piecewise constant lines. vint2t Computes vertical traveltime given interval velocity versus depth. vint2vave Converts interval velocity to average velocity. vave2vint Converts average velocity to interval velocity. vint2vrms Converts interval to rms velocity. vrms2vint Converts rms velocity to interval velocity. drawvint Plots interval velocity curves as piecewise constant functions.

No utility is provided to deal with instantaneous velocity since this can be treated simply by generating a finely sampled interval velocity. Like seismic traces, velocity functions are specified by prescribing two vectors, one for the velocities and the other for the depth or time that they apply. Interval velocities are inherently piecewise constant and the convention used here is that the k th velocity, v k prescribed at depth z k , persists as a constant until depth z k+1 . Therefore, the last velocity in a velocity vector applies for all z greater than the last entry in the depth vector.

As a first example of the use of these functions, suppose that v ins (z) is a piecewise linear function with five “knees” prescribed by (v, z) pairs as (1200 m/s, 0 m), (2700 m/s, 500 m), (3500 m/s, 1400 m), (3000 m/s, 1600 m), (4000 m/s, 2000 m). Code Snippet 2.8.1 shows how to compute v ins (τ ) for

40 CHAPTER 2. VELOCITY this v ins (z) and displays its results in Figure 2.9. Line 2 uses piecewise linear interpolation (pwlint )

to resample the five legged function to a fine interval so that the piecewise constant interval velocity approximates the desired piecewise linear instantaneous velocity. Line 5 computes τ (z) by calling vint2t and thus defining v ins (τ ). (Note that the vint2t returns one-waytime so these values must

be doubled for two-waytime.) Code Snippet 2.8.1. This code defines a five legged, piecewise linear v ins (z) and then computes

v ins (τ ). It makes Figure 2.9.

1 v=[1200 2700 3500 3000 4000];z=[0 500 1400 1600 2000];

2 z2=0:10:2000;v2=pwlint(z,v,z2);

3 subplot(1,2,1);plot(v2,z2,v,z,’r*’);flipy

4 xlabel(’meters/sec’);ylabel(’meters’);

5 t2=vint2t(v2,z2);

6 t=interp1(z2,t2,z);

7 subplot(1,2,2);plot(v2,t2,v,t,’r*’);flipy;

8 xlabel(’meters/sec’);ylabel(’seconds’);

End Code

The computation of τ (z) requires the numerical computation of the integral in equation (2.3). Given a densely sampled function, the simplest way to do a numerical integration is with the functions sum and cumsum. The difference between these is that the first does a definite integral while the second does an indefinite integral. For example, the command sum([1:5].ˆ2) just adds the squares of the integers from 1 to 5 to get 55. This is a discrete approximation to the definite integral of the

function y = x 2 from .5 to 5.5 for which the analytic answer is (5.5 3 −.5 3 )/3 ≈ 55.4167. Alternatively cumsum([1:5].ˆ2) has the result [1, 5, 14, 30, 55] which gives the value of the integral of y = x 2 for a lower limit of .5 and five successive upper limits of 1.5, 2.5, 3.5, 4.5, and 5.5 . Thus sum approximates

x dx and is just a single number while cumsum approximates .5 ˜ x 2 d˜ x and results in a vector the same length as the input. Thus, the traveltime integration of equation (2.3) is done within vint2t with the single command t1(2:nz)=cumsum(dz./vint(1:nz-1)). The vector t1 is τ (z) and has been initialized to zero, dz is a vector of the depth intervals, and vint is the interval velocity vector. (For more details, browse the source code file.)

Often velocity functions from well logs do not begin at z = 0. Therefore the computation of τ (z) from z = 0 requires that some initial velocity be used for the depth range above the log. This can

be input to vint2t , in the form of a constant time shift τ 0 , as the fourth argument. τ 0 defaults to τ 0 = z(1)/v(1), that is the first depth divided by the first velocity. This can be estimated if the depth and time to some marker formation top are already known. Then vint2t can be run once with the initial velocity set to zero, and the time to the marker can be observed to be off by some ∆τ in one-way time.

Now consider the computation of v rms (τ ) and the construction of a ten layer approximation to v ins (τ ) using interval rms velocities. This is done in Code Snippet 2.8.2 and the result is shown in Figure 2.10. Line 2 creates the dense v rms (τ ) function using vint2vrms shown as curve ‘b’ in the figure. Line 3 defines a blocky ten legged time vector and line 4 creates the coarse v rms (τ ) (curve ‘c’) by calling vint2vrms with a third argument. Essentially, this is just a de-sampled version of the finely sampled v rms (τ ). (It was not necessary to create the finely sampled v rms (τ ) as this was done to demonstrate the software.) Finally line 6 creates the interval rms approximation to v ins (τ ) by sending the coarse v rms (τ ) to vrms2vint .

Code Snippet 2.8.2. This carries on after Code Snippet 2.8.1 to compute: v rms from the sur- face for everypoint in v ins (τ ) a ten point sparse v rms (τ ) and a ten-legged rms-interval velocity

approximation to v ins (τ ). Figure 2.10 is the result.

2.9. APPARENT VELOCITY: V X ,V Y ,V Z

x ∆x x

x ∆x

efr λ z

on tWa tWt im

z ∆z -

z ∆z -

eW t W

Figure 2.11: An impulsive plane wave ap- Figure 2.12: Similar to Figure 2.11 except that proaches horizontal and vertical receiver arrays

the plane wave is monochromatic.

1 plot(v2,t2,v,t,’r*’);flipy

2 vrms=vint2vrms(v2,t2);

3 tblock=linspace(min(t2),max(t2),10);

4 vrmsblock=vint2vrms(v2,t2,tblock);

5 drawvint(t2,vrms);drawvint(tblock,vrmsblock);

6 vint=vrms2vint(vrmsblock,tblock);

7 drawvint(tblock,vint);

8 xlabel(’meters/sec’);ylabel(’seconds’);

End Code

Exercise 2.8.1. Load the file vp_from_well.mat that contains a vector of P-wave velocities and a corresponding vector of depths. Create two ten-leg interval-velocityapproximations to v ins (z) one using average velocities and one using rms velocities. Compare the accuracyof time to depth con- version using these two alternate approximations. (For time to depth conversions, compute average velocities from both interval velocityfunctions). Is there anysignificant difference?

Exercise 2.8.2. Create a function called vrms2vave that converts average velocities to rms ve- locities. Then create the inverse function vave2vrms. Test your codes with the universal velocity function bycomparing with the analytic forms for v rms and v ave .

Exercise 2.8.3. Working with the universal velocityfunction, create v rms (τ ) for the depth range of

0 to 3000 m. Then use MATLAB’s random number generator, rand, to add a 2% random fluctuation to the v rms (τ ) function. Finallycalculate v ins (τ ) from the perturbed v rms (τ ) function and determine the percentage error in the v ins (τ ) estimates caused bythe 2% error in v rms (τ ). What does this say about the sensitivityof interval velocitycalculations to noise?