-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathViscoAcoustic_2D_FDTD_SG1.m
More file actions
45 lines (40 loc) · 896 Bytes
/
ViscoAcoustic_2D_FDTD_SG1.m
File metadata and controls
45 lines (40 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
clc,clear
% ViscoAcoustic wave simulation using finite difference. with staggered-grid.
% By zhaoqingwei
% Chengdu University of Technology (CDUT), 2021-2025
%%%%%%%%%%%%%%%%
% P--Vx--P
% | |
% Vz-----vz
% | |
% P--Vx--P
%%%%%%%%%%%%%%%
FM=20;
DT=0.001;dt=DT;
T=2;
nx=600;
nz=600;
DH=10;dx=DH;dz=DH;
s=wavelet(FM,DT,T)*1e5;
vx0=zeros(nz,nx);vx1=vx0;
vz0=vx0;vz1=vx0;
p0=vx0;p1=vx0;
v=ones(nz,nx)*4000;Q=ones(nz,nx)*100;
z0=round(nz/2);x0=round(nx/2);
nn=3;
dxd=FDcoeffDx(nn);ddz0=dxd';ddz1=[dxd 0]';ddx0=ddz0';ddx1=ddz1';
TX=dt/dx;TZ=dt/dz;
for t=DT:DT:T
disp(t);
k=round(t/DT);
vz1=vz0+TZ*imfilter(p0,ddz0);
vx1=vx0+TX*imfilter(p0,ddx0);
p1=p0+(v.*v+1i*v.*v./Q).*(TZ.*imfilter(vz1,ddz1)+TX.*imfilter(vx1,ddx1));
p1(z0,x0)=p1(z0,x0)+s(k);
p0=p1;
vz0=vz1;vx0=vx1;
if mod(t,0.5)==0
figure();
imagesc(real(p1));
end
end