RAY EXAMPLES

Producing P-P reflections, multiples, and P-S reflections

|   Back to main page   |  Back to geophysical INFO main page   |  Back to programs index   |

First Step

Before you proceed to the example below, you should have read others article on RAYPP, RAYPS, and RAYMUL.

Program

The program below is the program to produce different kinds of reflections to plot in the same figure.

// Linking
npp = link('raypp.o','raypp','f');
nps = link('rayps.o','rayps','f');
nmu = link('raymul.o','raymul','f');

// Model
vp = [1000 2000 2500]';
vs = [577 1155 1443]';
d  = [100 200 250]';
x  = [0:50:500]';
nmul  = 2; // number of multiples
imul1 = [1 1 1 1]'; // first multiple
lmul1 = length(imul1);
imul2 = [1 2 2 2 2 1]'; /second multiple
lmul2 = length(imul2);

// Ray tracing
nl   = mini([length(vp) length(vs) length(d)])
ns   = length(x);
tmpp = fort("raypp",vp,1,"r",d,2,"r",nl,3,"i",x,4,"r",ns,5,"i",...
       "out",[nl,ns],6,"r");
tmps = fort("rayps",vp,1,"r",vs,2,"r",d,3,"r",nl,4,"i",x,5,"r",ns,6,"i",...
       "out",[nl,ns],7,"r");
tmu1 = fort("raymul",vp,1,"r",d,2,"r",nl,3,"i",...
       imul1,4,'i',lmul1,5,'i',x,6,"r",ns,7,"i",...
       "out",[1,ns],8,"r");
tmu2 = fort("raymul",vp,1,"r",d,2,"r",nl,3,"i",...
       imul2,4,'i',lmul2,5,'i',x,6,"r",ns,7,"i",...
       "out",[1,ns],8,"r");
tm   = [tmpp ; tmps ; tmu1 ; tmu2]

// Plotting using different colors
// 2 for blue -> P-P reflections
// 6 for cyan -> P-S reflections
// 7 for red  -> multiple reflections
st = [2*ones(1,nl) , 6*ones(1,nl) , 7*ones(1,nmul)];
xbasc();
plot2d1("onn",x,tm',st,"021");
xtitle('All','Offset (meter)','Waktu (detik)');
xend();

HAVE A LOT OF FUN.