Wavefield Modeling and Raytracing

Gary F. Margrave Seismic Imaging Summer School 2009

Topics of Discussion
v(z) raytracing ray shooting and two-point raytracing arbitrary multi-modes, flexible s/r geometry synthetic P-P and P-S gathers v(x,z) raytracing ray shooting only complex media acoustic finite differencing 2D P-waves, complex media 2nd or 4th order in spatial derivative any s/r geometry, shot records and explodogram

Making a simple seismic section
>>help synsections CREWES synthetic sesimic by diffraction superposition The SYNSECTIONS toolbox provides a suite of tools to create synthetic seismic sections by superposition of hyperbolae and other events. Each function is designed to accept a matrix and to insert a single event into it. The event is always added (superimposed) on top of what is already there. Tools EVENT_DIP: inserts a dipping (linear) event in a matrix EVENT_DIPH: constructs a dipping event by diffraction superposition EVENT_DIPH2: constructs a dipping event with sparse diffraction superposition EVENT_HYP: inserts a hyperbolic event in a matrix. EVENT_PWLINH: diffraction superposition along a piecewise linear track EVENT_SPIKE: inserts a spike in a matrix Standard sections MAKESTDSYN: Make a non-diffraction synthetic to demo migration codes MAKESTDSYNH: Make a diffraction synthetic to demo migration codes Demos MAKESECTIONS: demo the use of the section tools DEMO_HYPERBOLAS: demo the superposition of diffraction hyperbolae

t. >> plotimage(seis.f.x) >> [fks.01 .002.length(x)). >> seis=zeros(length(t).[. >> seis=event_dip(seis.x).t=(0:500)*dt.x=(-100:100)*dx.t.k).[0 1000].2]. .A simple linear event >> dt=.t.k]=fktran(seis. >> plotimage(abs(fks).1).x.dx=10.f.

x..3)..t.1.x.t.Hyperbolic events >> seis=event_dip(seis.7.x.0.1.1. >> seis=event_hyp(seis. >> seis=event_hyp(seis.2].4000.4000.0.[.3.t.1). >> seis=event_hyp(seis.3).x.. >> plotimage(seis.1.01 .t.[0 -1000]. >> seis=event_hyp(seis.5.t.4000.x.x) .0.3)..0.3).4000.t.1.

[10 5]. So we are motivated to use this as a highcut: >> seis=filtf(seis.k).f.Bandlimiting It is obvious from the f-k spectrum in the previous slide that there is considerable spatial aliasing for frequencies above 100 Hz.[100 20]). >> plotimage(abs(fks).x) >> [fks.k]=fktran(seis.x). >> plotimage(seis. .f.t.t.t.

x.t=(0:500)*dt.1].x) .t.1 -.6).dx=5.t.1 .x) >> seis=filtf(seis. 300*ones(1.[100 20]).t.2000.1 -.Events with diffractions event_pwlinh constructs a piecewise-linear event by superposition of diffraction hyperbolae: >> dt=.1. >> seis=event_pwlinh(seis.t.[.002.1 . >> plotimage(seis.dx).[10 5]. >> plotimage(seis.1 .x=(0:400)*dx.seis=zeros(length(t).length(x)).[0 800 810 1200 1210 2000]....

Construct the corresponding seismic section and examine the f-k spectrum after each event is inserted. The ground roll should be very low frequency (5-15 Hz) while the first breaks should be perhaps 5-40 Hz. ground roll. Explain your results. . Explain your results. • Construct a seismic section with three or four events having precisely the same time dip but different spatial location. Make your deeper reflections have a lesser band limit than the shallow ones. and hyperbolic reflections using a different band-limiting wavelet for each event.Exercise • Try to model some simple geologic structure that interests you. • Make a shot record with first breaks. Examine the f-k spectrum after the insertion of each event. The structure should consist of simple events beneath a constant velocity overburden.

V(z) Raytracing ∆x v k ∆t k Layer k-1 θ k ∆z k Layer k Layer k+1 ∆x k = ∆z k tan θ k ∆z k ∆t k = v k cos θ k .

V(z) Raytracing t ( p) = ∑ x( p) = ∑ N N ∆zk 2 1 − p 2vk k =1 vk = Traveltime pvk ∆zk 2 1 − p 2vk = Horizontal distance k =1 sin θ k p= = The Ray Parameter vk The ray parameter is a constant for all layers and uniquely determines the raypath. .

Equivalent problems N layers 1 2 3 N-1 N 1 2 3 N-1 N N N-1 3 2 1 2N Layers .

Matlab V(z) Raytools Demo RAYTRACE_DEMO: interactive demonstration of v(z) raytracing capabilities Basic tools for v(z) DRAWRAY: draws rays given their ray parameters RAYFAN_A: similar to RAYFAN but the rays are specified by angle RAYFAN: shoots a fan of rays given their ray parameters for v(z) SHOOTRAY: similar to RAYFAN but with less error checking (faster) TRACERAY: traces an arbitrary ray given its raycode for v(z) TRACERAY_PP: traces a P-P (or S-S) reflection for v(z) TRACERAY_PS: traces a P-S (or S-P) reflection for v(z) .

A simple layered medium .

2). 12. 3.'v') line(0. 10.-1. 13.1.t).10.1. P-P mode.'marker'.xoff.ylabel('meters'). water depth 200 meters') xlabel('meters').'none'.flipy. 4. 9. %put source and receiver markers line(xoff. plot(xoff.ylabel('seconds') xlim([0 3000]) .zsrc.zrec*ones(size(xoff)).zsrc.'marker'. 6.'linestyle'.10.'b'. 7. 11.'r'.xlabel('meters').zd.grid.flipy %Trace P-P rays and plot in upper subplot [t.p]=traceray_pp(vp. 8.1. figure.zrec.'color'.'*') %annotate plot title('OBC simulation.1.grid %plot traveltime versus offset in lower subplot subplot(2.subplot(2. 5.'none'. 2.zp.'linestyle'.1).2).'color'.Code: P-P OBC reflection 1.

9. 3. 6.'linestyle'.grid.10.Code: P-S OBC reflection 1.'none'.'*') %annotate plot title('OBC simulation.1. subplot(2.'none'.xoff.1.zsrc.1).1. figure. 2.zs.subplot(2. P-S mode.zd.flipy %Trace P-S rays and plot in upper subplot [t. 10.'v') line(0.vs.'marker'.zrec*ones(size(xoff)).'color'. water depth 200 meters') grid.'linestyle'. %put source and receive markers line(xoff. 5.2).10.-1. 8.'r'.2). 7. xlim([0 3000]) . 4. plot(xoff.zsrc.t).flipy.xlabel('meters').zp.'color'.1.p]=traceray_ps(vp.ylabel('seconds').ylabel('meters').zrec.xlabel('meters'). 12.'b'. 11.'marker'.

OBC. P-P mode traceray_p .

OBC. P-S mode traceray_p .

xoff.vs. 8. .dflag).p]=traceray_ps(vp. %annotate plot title('OBC simulation. 7.zsrc. 2. end %draw source and receiver symbols line(xoff.'none'. P-S mode.else.1.-2.zp.zs.'color'.'linestyle'. 3.zsrc.Code: OBC P-S conversion point 1.zd(kk). 10.dflag=2.1.'*'). if(kk==1)dflag=1.30.'b'.'r'.'color'.zrec. 4. 9.zrec.'none'.'marker'.'v') line(0. 5. 6.10.'linestyle'. %loop over depth and show conversion point for kk=1:length(zd). fixed offset CCP determination').'marker'.grid.end [t.

OBC. P-S conversion point traceray_p s .

4.zs=zp.'color'.zd. 12. 18.ylim([0 3000]) .zrec(kk).zrec.2). end %draw source and receiver symbols line(xoff.5*vp. %plot traveltime versus depth subplot(2.vs=. 16.1). %build the velocity model zp=0:10:4000.'marker'.'none'.'color'.zrec). 9. [t(kk).ylabel('depth (meters)') grid.'*') %annotation title([' VSP Vertical gradient simulation.1.1. 3.'v') line(0.1.xlabel('seconds'). 8.'linestyle'.subplot(2. %preallocate t %loop over receiver depth for kk=1:length(zrec). plot(t.10.xoff.zp. 10.zsrc.'b'.Code: VSP P-P reflection 1. 11.p]=traceray_pp(vp.vp=1800+.30. P-P mode ']) grid. 5. 14.xlabel('meters').6*zp. 2.-2.flipy. 7.'marker'.1. 15.'r'.ylabel('meters'). 17. %P-P offset VSP figure.'linestyle'.zsrc.2).flipy t=zeros(size(zrec)).'none'. 19. 13. 6.

2).zrec(kk). 13. end %draw source and reciver symbols line(xoff.'color'.1. 3.ylabel('meters').'marker'.'linestyle'.'marker'.vs. 11. %plot traveltime versus depth subplot(2. 10.zsrc. 15.30.zd.'linestyle'. 16. %P-S offset VSP figure.xlabel('meters').xlabel('seconds').1.1.-2. plot(t.p]=traceray_ps(vp.'r'.ylim([0 3000]) .zp.'*') %annotate plot title([' VSP Vertical gradient simulation. grid.subplot(2. 6.Code: VSP P-S reflection 1.'none'.ylabel('depth (meters)'). t=zeros(size(zrec)).2).%preallocate t for kk=1:length(zrec).10.1). [t(kk).'b'.'none'. 12.'color'.zs. 5. P-S mode ']) grid. 2.zrec).zsrc. 4.'v') line(0. 9.flipy. 7.1.zrec. 8.xoff.flipy. 14.

VSP P-P reflection traceray_p .

VSP P-S reflection .

13.'r'.1).grid.1500 1.zs.subplot(2.'linestyle'.flipy plot(xoff.t).'color'.xoff.-1. 9.1.10.1300 1.1. 5.raycode.xlabel('offset'). 300 1].' line(0.2). 4.zp.1800 1. 3.1). 8.2000 1.'marker'. 10..'*') %annotate title('A P-P-P-P-P-P-P-P-P-P mode in vertical gradient media'). 1500 1. %Source and receiver symbols line(xoff.'marker'.1)*ones(size(xoff)).ylabel('time') xlim([0 3000]) .p]=traceray(vp.Code: Pure P multimode 1.raycode(end.'linestyle'.raycode(1. 6. 15..flipy %trace the rays xoff=1000:100:3000.'none'.2).vs.2000 1. 16.1000 1.2300 1.3000 1.'none'.'b'.1. figure.'color'.10.grid %Plot traveltimes subplot(2. 14.. 12. 11. [t. %define the ray code for a pure P multiple raycode=[0 1.1. 7. 2.

1.'r'. %define the ray code for a P-S multimode raycode=[0 1. 6. 9.xoff.'b'. 2. 16. 300 1].t). 10.10.1)*ones(size(xoff)).1).raycode(1.'none'.flipy %trace the rays xoff=1000:100:3000.1800 2.10.zs.grid.-1. 8. %source and receiver symbols line(xoff.grid %Plot traveltimes subplot(2. 15.ylabel('time') xlim([0 3000]) .'marker'. 5. 12.'*') %annotate title('A P-S-S-S-S-P-P-P-P-S mode in vertical gradient media').1.'color'.flipy plot(xoff.p]=traceray(vp. 1500 2.'linestyle'.subplot(2.'linestyle'.raycode. 14. 7. figure.1.vs.'none'.Code: P-S multimode 1.zp.. 4. [t.'color'..2300 1..raycode(end.1000 1.xlabel('offset').'marker'.' line(0.1500 2.2000 2. 13.1).1300 2.2).1. 3.3000 1. 11.2000 1.2).

1500 1.1000 1. 300 1].2000 1.1300 1.1800 1.2000 1. .1500 1.Pure P multimode raycode=[0 1.2300 1.3000 1.

3000 1.2300 1. . 300 1].1000 1.2000 2.1300 2.P-S multimode raycode=[0 1.1800 2.1500 2.2000 1.1500 2.

Then. and examine the code to see how things are done.Exercise -Run raytrace_demo. Then use traceray_pp to determine reflection traveltimes for a reflector at perhaps 1000m depth and offsets at least equal to the depth. observe the behavior. . Compare the raytraced traveltimes to those that are predicted by the Dix equation.Construct a layered. either investigate your own problem or see if you can do this one: . v(z). You can compute average and rms velocities using functions in the velocity toolbox. velocity function by any means that you choose.

V(x.  dx 2   = v ( x)p dt      dp ∇v( x ) = −  = −∇ ln ( v( x ) ) dt v( x ) .z) Raytracing Differential equations for the raypath can be derived from the eikonal equation.

z) Raytracing These equations are merged into a single equation by defining the abstract ray    vector: r = [ x . p] then the ray equation is  dr  =a dt where   2 a = v p.V(x. − ∇ ln v [ ] .

the ray is time-stepped through the velocity model. given initial values of the ray vector.   d rk = a k dt    rk +1 = rk + d rk sort of … . Roughly.V(x.z) Raytracing The ray equation may be solved using a 4th order Runge-Kutta method.

z).z) SHOOTRAYVXZ: RK4 raytracing in v(x. SHOOTRAYVXZ_G: more general raytracing in v(x.z) DRAYVEC: compute the derivative of ray vector (for vxz raytracing) DRAYVECLIN: compute the derivative of ray vector for v0=a*x+b*z RAYVELMOD: establish a velocity model for vxz raytracing SHOOTRAYTOSURF: shoot a ray to z=0 in v(x.z) raytrace code Tools for v(x. .Matlab V(x.z) Raytools Demo RAYVXZ_DEMO: demo the v(x.z) with nearest neighbor int.

xpoly-max(zb)/4).zpoly).zb=(0:nz+nsmooth-2)*dg. x=(0:nx-1)*dg. 13. 7.4*max(zb)]. % Define geometry nx=100.nz+nsmooth-1)-. zpoly=[max(zb)/3 max(zb)/2 2.6*max(zb) max(zb) .7*max(zb)].5*max(xb)/2.zpoly-max(xb)/4. xpoly=[min(xb) . dg=10.nsmooth=10. vrand=vdel*(rand(nx+nsmooth-1. v=v+vrand. 2.vhigh. 10.5 max(xb)/pi].1*max(zb)/2. v=afd_vmodel(dg. 5. 14.5). 12. 9.vhigh=3800.5 . %Build the velocity model vlow=2700.z=(0:nz-1)*dg. 6.vhigh. . 4.nz=nx.xpoly.nz+nsmooth-1).v. v=afd_vmodel(dg. xpoly=[max(xb)/2 2*max(xb)/3 1.6*max(xb) min(xb)].v. 8.5*max(zb) . 15.vhigh. v=vlow*ones(nx+nsmooth-1. zpoly=[. v=afd_vmodel(dg.zpoly).xpoly+max(xb)/4. 17. xb=(0:nx+nsmooth-2)*dg. 16.z) velocity model 1. 11.9*max(xb) . 3.vdel=1000.v.Code: v(x.

Velocity model afd_vmode l .

'color'. x0=round(nx/2)*dg. [t.dx)%install velocity model plotimage(v-mean(v(:)). 8.004.tstep=0:dt:tmax.tstep tmax=max(z)/vlow. 15. 7.x.indz=near(z. v0=v(indz. end . 14. 4.indx).z0=0.r]=shootrayvxz(tstep.z0).2). 2.ylabel('meters') %estimate tmax.5:70]*pi/180.r0).ones(size(t)). 5.r(:. 6. indx=near(x. rayvelmod(v.x0).z) xlabel('meters').1).dt=.z) raytracing 1. 9.'r'). %specify a fan of rays angles=[-70:2.Code: v(x. %trace the rays 12. for k=1:length(angles) 13. r0=[x0 z0 sin(angles(k))/v0 cos(angles(k))/v0]. line(r(:. 10. 11. 3. 16.dt.

Raytracing with no smoothing shootrayvx z .

Raytracing with 10 m smoothing shootrayvx z .

Raytracing with 50 m smoothing shootrayvx z .

Raytracing with 100 m smoothing shootrayvx z .

Waves in unsmoothed media finite difference simulation .

Waves and rays in unsmoothed meters meters .

Waves in unsmoothed Rays in smoothed meters meters .

Waves and rays in smoothed meters meters meters .

z. z. t + ∆t ) = 2 + ∆t 2 v 2 ( x . [ ] . t − ∆t ) This is the basic time-stepping equation.Finite difference modelling Start with the variable-velocity scalar-wave equation 1 ∂2 ∇ 2 Ψ ( x . z ) ∇ 2 Ψ ( x . z. t ) = 2 Ψ ( x . z ) ∂t Replace the time derivative with a finite difference operator and rearrange Ψ ( x . z. z. t ) 2 v ( x . t ) − Ψ ( x.

Finite difference modelling Considerations Second order or fourth order Laplacian? Stability  v max ∆t   ≤ ∆x    1 2 3 8 sec ond order Laplacian fourth order Laplacian .

makes exploding reflector models .... makes finite difference shot records AFD_EXPLODE ..Matlab Finite Difference Tools Sample scripts HIGHV_WEDGE: model an anticline beneath a high velocity wedge VZANTICLINE: model an anticline beneath a v(z) medium SYNCLINE: model a channel beneath a few layers CHANNEL: model a channel beneath a few layers Seismograms AFD_SHOTREC .

.Matlab Finite Difference Tools Utilities AFD_VMODEL . compute the 5 point Laplacian DEL2_9PT . compute the 9 point Laplacian AFD_BC_OUTER .. makes simple polygonal velocity models AFD_SOURCE ..... take one finite difference time step AFD_SNAPN .. example script to interpolate a velocity model AFD_REFLECT .... calculate the reflectivity from a velocity model AFD_MOVIESNAP: make movies of wavefield propagation Basic time-stepping AFD_SNAP ...... time steps a wavefield "n" steps DEL2_5PT .. generates a source array for uses with AFD_SHOTREC CHANGE_GRID_SPACING . apply absorbing boundary condition to outer boundary ...

Code: Velocity model 1.v2.%install layer 2 . %make a velocity model nx=128.%velocities vmodel=v3*ones(nx.vmodel. 10. zpoly=[-dx2 -dx2 z1+dx2 z1+dx2].dx=10.xpoly. xpoly=[-dx2 max(x)+dx2 max(x)+dx2 -dx2].nz).% fill matirx with v3 z1=(nz/8)*dx.dx2=dx/2.z=(0:nz-1)*dx.v3=3200.z2=(nz/2)*dx.zpoly).vmodel. 2. 9. 6. vmodel=afd_vmodel(dx. 3. 7. 4. v1=2000. 11.nz=128.zpoly).v2=2800.%install layer 1 zpoly=[z1+dx2 z1+dx2 z2+dx2 z2+dx2].v1. vmodel=afd_vmodel(dx. 5. %basic geometry x=(0:nx-1)*dx.xpoly. 8.

Velocity Model 2000 m/s 2800 m/s 3200 m/s afd_vmode l .

%time sample rate and max time xrec=x. 8. 7. 3. 9.0.length(x)/2)=1.dtstep..dt.xrec.%place the source %second order laplacian [seismogram2.Code: finite dif 1.%receiver locations zrec=zeros(size(xrec)).snap2.t]=afd_shotrec(dx. vmodel. 4.[5 10 30 40].snap2.tmax=1.t]=afd_shotrec(dx. snap2=snap1.1).seis4. 12..zrec. .seis2. dtstep=. 10.2). 6. 13.004.tmax.001. vmodel. 5.dtstep.snap1. .tmax.%time step dt=.. snap2(1. 11. 2.0.[5 10 30 40]. %fourth order laplacian [seismogram4.zrec.%receivers at zero depth snap1=zeros(size(vmodel)).xrec.. .snap1.dt.

dt=.001 afd_shotre c .Five point Laplacian dx=10.

dt=.Nine point Laplacian dx=10.001 afd_shotre c .

dt=.001 afd_shotre c .Five point Laplacian dx=5.

dt=.Nine point Laplacian dx=5.0009 afd_shotre c .

Trace comparison events artifacts 5 point9 point 5 point 9 point dx = 10 meters = 5 meters dx .

16.xpoly. max depth x=0:dx:xmax. 14.vrange=vhigh-vlow. zpoly=[z4 z4 z4+thk z4+thk].zpoly).z2=200.zpoly=[z2 z2 z3 z3].Code: velocity model dx=10. 18.vch.vel.xpoly.zmax=1000.v3=vlow+pi*vrange/5. 12.%initialize velocity matrix z1=100. 6.xpoly. max line length.%install last layer width=20.vch=vlow+vrange/6. 15. % x and z coordinate vector vhigh=4000. 17.v1. 7.%plot the velocity model 1.xmax=2500.vel.z. 3.vlow=2000. 8.zpoly=[z3 z3 z4 z4]. . vel=afd_vmodel(dx.%install channel plotimage(vel-.length(x)).vel.z=0:dx:zmax.vel.%install second layer z4=398.x).%first layer xpoly=[-dx xmax+dx xmax+dx -dx]. 10.zpoly=[z1 z1 z2 z2].v3.v2.%channel xpoly=[xmax/2-width/2 xmax/2+width/2 xmax/2+width/2 xmax/2-width/2]. 5. 9.%install third layer zpoly=[z4 z4 zmax+dx zmax+dx]. 2.%last layer vel=afd_vmodel(dx.v1=vlow+vrange/5.%install first layer z3=271.zpoly).zpoly).xpoly. % high and low velocities vel=vlow*ones(length(z).5*(vhigh+vlow).xpoly.%third layer vel=afd_vmodel(dx. 11.thk=50.zpoly).zpoly). 13.v2=vlow+2*vrange/5.vhigh.%second layer vel=afd_vmodel(dx. 4.vel.%grid size. vel=afd_vmodel(dx.

Velocity Model afd_vmode l .

Code: finite dif
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. %do a finite-difference exploding reflector model dt=.004; %temporal sample rate dtstep=.001; %modelling step size tmax=2*zmax/vlow; %maximum time [seisfilt,seis,t]=afd_explode(dx,dtstep,-dt,tmax, ... vel,x,zeros(size(x)),[10 15 40 50],0,1); %plot the seismogram plotimage(seisfilt,t,x) %compute times to top and bottom of channel tchtop=2*(z1/vlow + (z2-z1)/v1 + (z3-z2)/v2 + (z4-z3)/v3); tchbot=tchtop+2*(thk/vch); %annotate times h1=drawpick(xmax/2,tchtop,0,width); h2=drawpick(xmax/2,tchbot,0,width);

Explodogram L2, dx=10, dt=.001

afd_explod e

Explodogram L4, dx=10, dt=.001

afd_explod e

Explodogram L4.001 afd_explod e . dx=5. dt=.

Explodogram L2.0008 afd_explod e . dt=. dx=2.5.

vhigh.xpoly=[-dx2 xpinch -dx2].zpoly).% x&z coordinate vector vhigh=4000.%install the anticline xpoly=[0 xmax xmax 0]. 10.zmax+dx).xmax=2500. max depth xpinch=1500.zpoly=[.vel.xpoly.% install the wedge x0=xpinch/2. 4.%initialize velocity matrix dx2=dx/2.zpoly).zpoly=[-1 -1 zwedge]. 2.vel. zwedge=zmax/2.length(x)).zpoly=[za(1:ind) za(ind)]. 15. 3. 11.% wedge parameters x=0:dx:xmax.vel. % high and low velocities vel=vlow*ones(length(z).9*zmax zmax+dx zmax+dx].vhigh. % a parameter that determines the steepness of the flanks za=a*(x-x0).% install bottom layer . % model the anticline as a parabola % build a polygon that models the anticline ind=near(za. 13. z=0:dx:zmax.Code: velocity model 1.xpoly. 8.z0=zwedge+100. % grid size. vel=afd_vmodel(dx. % x and z of the crest of the anticline a=. dx=5.9*zmax .^2+z0. 14.xpoly. max line length.zmax=1000. 9. 6. vel=afd_vmodel(dx. 7.vhigh.zpoly).vlow=2000.% wedge vel=afd_vmodel(dx. 12. 5.xpoly=[x(1:ind) 0 ].0005.

Velocity Model 4000 m/s 2000 m/s 4000 m/s .

Reflectivity afd_reflect .

6.2).dt.. 4.t]=afd_explode(dx. 3. %temporal sample rate dtstep=.dtstep.001.tmax. %do a finite-difference model dt=.zeros(size(x)).x.Code: finite dif 1.004. .0. %maximum time [seisfilt. 5. tmax=2*zmax/vlow.seis. .. vel. 2.[5 10 40 50].

dt=.Explodogram Second order. dx=10.001 afd_explod e .

Explodogram Fourth order. dx=10.001 afd_explod e . dt=.

001 afd_explod e . dx=5.Explodogram Fourth order. dt=.