You are on page 1of 16

PRAKTIKUM RAY-TRACING

(GEO - TOMOGRAPHY)

4 SKS
Jejak Sinar Gelombang (Ray Tracing)
Penelusuran jejak sinar (ray tracing) adalah metode untuk
menghitung jalan geolombang /partikel melalui sistem dengan
berbagai kecepatan propagasi, karakteristik penyerapan, dan
permukaan

Rekonstruksi penjejakan sinar gelombang (ray tracing)


dibutuhkan dalam menghitung waktu tempuh gelombang
dari sumber ke stasiun penerima
Metode ray tracing :
1. Straight
2. Shooting (Snells Law)
3. Bending (fermats Principle)
4. Full Wave Front
Ray Tracing dengan Metode Straight
Model kecepatan 2 lapis dengan batas lapisan tegak
V1=1000 m/s dan V2=2000 m/s
source (0,8) dan receiver (10,0).
%% Input Data & Parameter
Source.X = 0;
Source.Y = 8;
Receiver.X = 10;
Receiver.Y = 0;
x0 = 0;
y0 = 0;
dx = 5;
dy = 10;
Xgrid = x0:dx:10;
Ygrid = y0:dy:10;
nx = length(Xgrid)-1;
ny = length(Ygrid)-1;
[Mesh.X Mesh.Y] =meshgrid(Xgrid,Ygrid);
Velocity = [1000 2000];
VelocityPlot = [Velocity; Velocity(size(Velocity,1),:)];
VelocityPlot = [VelocityPlot
VelocityPlot(:,size(VelocityPlot,2))];
%% Straight Ray Tracing
RayPath.X = linspace(Source.X,Receiver.X,100);
RayPath.Y = linspace(Source.Y,Receiver.Y,100);
%% Waktu Tempuh Gelombang
for i=1:length(RayPath.X)
iblok = fix((RayPath.X(i)-x0)/dx)+1;
jblok = fix((RayPath.Y(i)-y0)/dy)+1;
nblokpath(i) = (jblok-1)*nx+iblok;
if i<length(RayPath.X)
distance(i) =sqrt((RayPath.X(i)-RayPath.X(i+1))^2+(RayPath.Y(i)-
RayPath.Y(i+1))^2);
end
end
TempPanjang = 0;
LengthInBlock = zeros(size(Velocity,1),size(Velocity,2));
for i=1:length(RayPath.X)-1
TempPanjang = TempPanjang + distance(i);
if nblokpath(i)~= nblokpath(i+1)
LengthInBlock(nblokpath(i)) = TempPanjang;
TempPanjang = 0;
end
end
Slowness = 1./Velocity;
TimeCalculation = LengthInBlock*Slowness';
%% Visualisasi
pcolor(Mesh.X,Mesh.Y,VelocityPlot)
set(gca,'Ydir','Reverse')
hold on
plot(Source.X,Source.Y,'*r')
hold on
plot(Receiver.X,Receiver.Y,'vb')
hold on
plot(RayPath.X,RayPath.Y,'c')
title('Straight Ray Tracing')
xlabel('Distance')
ylabel('Depth')
HASIL
Ray Tracing dengan Metode Shooting
Model kecepatan 2 lapis dengan batas lapisan tegak
V1=1000 m/s dan V2=2000 m/s
source (0,8) dan receiver (10,0).
%% Input Data & Parameter
close all
clear all
Source.X = 0;
Source.Y = 8;
Receiver.X = 10;
Receiver.Y = 0;
x0 = 0;y0 = 0;
dx = 5;dy = 10;
Xgrid = x0:dx:10;
Ygrid = y0:dy:10;
nx = length(Xgrid)-1;
ny = length(Ygrid)-1;
[Mesh.X Mesh.Y] =meshgrid(Xgrid,Ygrid);
Velocity = [1000 2000];
VelocityPlot = [Velocity;
Velocity(size(Velocity,1),:)];
VelocityPlot = [VelocityPlot
VelocityPlot(:,size(VelocityPlot,2))];
ErrorDist = sqrt((Receiver.X-
%% Ray Tracing Shooting Receiver.X)^2+(ReceiverTempY-Receiver.Y)^2);
SudutDatang = 0:0.1:90; if ErrorDist < ErrorMin
BatasLapisanX = 5; ErrorMin = ErrorDist;
ErrorMin = inf; RayPath.X = [Source.X BatasLapisanX
for i=1:length(SudutDatang) Receiver.X];
dyy = tan(deg2rad(SudutDatang(i)))*dx; RayPath.Y = [Source.Y BatasLapisanY
if Source.Y > Receiver.Y ReceiverTempY];
BatasLapisanY = Source.Y - dyy; end
else end
BatasLapisanY = Source.Y + dyy; %% Time Calculation
end TimeCalculation = 0;
SudutTransmisi = for i=1:length(RayPath.X)-1
sin(deg2rad(SudutDatang(i)))*Velocity(2)/Velo TimeCalculation = TimeCalculation +
city(1); sqrt((RayPath.X(i)-
dyy = tan(SudutTransmisi)*dx; RayPath.X(i+1))^2+(RayPath.Y(i)-
if Source.Y > Receiver.Y RayPath.Y(i+1))^2)/Velocity(i);
ReceiverTempY = Source.Y - dyy; end
else
ReceiverTempY = Source.Y + dyy;
end
%% Visualisasi
pcolor(Mesh.X,Mesh.Y,VelocityPlot)
set(gca,'Ydir','Reverse')
hold on
plot(Source.X,Source.Y,'*r')
hold on
plot(Receiver.X,Receiver.Y,'vb')
hold on
plot(RayPath.X,RayPath.Y,'c')
hold off
title('Shooting Ray Tracing')
xlabel('Distance')
ylabel('Depth')
colorbar
HASIL
Ray Tracing dengan Metode Bending
Model kecepatan 2 lapis dengan batas lapisan tegak
V1=1000 m/s dan V2=2000 m/s
source (0,8) dan receiver (10,0).
%% Input Data & Parameter
close all
clear all
Source.X = 0;
Source.Y = 8;
Receiver.X = 10;
Receiver.Y = 0;
x0 = 0;y0 = 0;
dx = 5;dy = 10;
Xgrid = x0:dx:10; Ygrid = y0:dy:10;
nx = length(Xgrid)-1; ny = length(Ygrid)-1;
[Mesh.X Mesh.Y] =meshgrid(Xgrid,Ygrid);
Velocity = [1000 2000];
VelocityPlot = [Velocity;
Velocity(size(Velocity,1),:)];
VelocityPlot = [VelocityPlot
VelocityPlot(:,size(VelocityPlot,2))];
%% Ray Tracing Bending
%Bending Point %% Visualisasi
BatasLapisanY = 0:1:10; pcolor(Mesh.X,Mesh.Y,VelocityPlot)
BatasLapisanX = set(gca,'Ydir','Reverse')
5*ones(1,length(BatasLapisanY)); hold on
minTime = inf; plot(Source.X,Source.Y,'*r')
for i=1:length(BatasLapisanY) hold on
Time1 = sqrt((Source.X- plot(Receiver.X,Receiver.Y,'vb')
BatasLapisanX(i))^2+(Source.YBatasLapisanY(i)) hold on
^2)/Velocity(1); plot(RayPath.X,RayPath.Y,'c')
Time2 = sqrt((Receiver.X- hold on
BatasLapisanX(i))^2+(Receiver.YBatasLapisanY(i plot(BatasLapisanX,BatasLapisanY,'.w')
))^2)/Velocity(2); title('Bending Ray Tracing')
TimeCalculation = Time1+Time2; xlabel('Distance')
if TimeCalculation < minTime ylabel('Depth')
minTime = TimeCalculation; colorbar
RayPath.X = [Source.X BatasLapisanX(i)
Receiver.X];
RayPath.Y = [Source.Y BatasLapisanY(i)
Receiver.Y];
end
end
HASIL

You might also like