In a single source, single sensor, 2D homogeneous scenario should I not expect to be able to verify the k-Wave simulation result against the homogeneous acoustic 2D solution? I am specifically referring to the solution typically given by the 2D Green Function: G(x,x')=i/4*H_{0}^{1}(2*pi*f/c*|x-x'|), where H_{0}^{1} is the Hankel function.
I've been trying to use a simple sinusoidal point source, with two sensor locations, one at the source and one at some x distance away. The sine wave I measure should be able to be predicted by applying the gain and phase shift given by the above equation, but I notice that even if I adjust the grid spacing, I do not get consistent results.
I notice:
1) the source and sensor at the source give different values, and altering the grid resolution (making it finer) reduces the amplitude recorded by the sensor at the source by orders of magnitude while trying to converge on a consistent record (i.e. when verifying grid is fine enough)
2) If I tweak what I can to get the same result as the Green Function, they do not match if I change the distance of the target sensor.
Nx = 128*8; % number of grid points in the x (row) direction
Ny = 64; % number of grid points in the y (column) direction
dx = 50e-3/Nx; % grid point spacing in the x direction [m]
dy = dx; % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);
medium.sound_speed = 1500; % [m/s]
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed);
source.p_mask = zeros(Nx, Ny);
source.p_mask(end - Nx/4, Ny/2) = 1;
source_freq = 0.25e6; % [Hz]
source_mag = 1; % [Pa]
source.p = source_mag*cos(2*pi*source_freq*kgrid.t_array);
source.p = filterTimeSeries(kgrid, medium, source.p);
sensor.mask = zeros(Nx, Ny);
sensor.mask(Nx/2, Ny/2) = 1;
sensor.mask(end-Nx/4, Ny/2) = 1;
sensor.record = {'p', 'p_final'};
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, 'PlotLayout', true);
Do you have any issues with my approach, or notice any obvious errors?
thanks,
-Chris