Dear All
I am very beginner user of k-wave. I started with 2D simulations to 'feel' the software. I run first example and everything was ok. But then I tried to perform simulations with linear source placed on one side of the medium. The strange thing is that when change the medium speed from 1500 m/s to 2000 m/s the pulse arrive at the same time. Do you have any idea what is wrong. the code I placed below.
The second question concerning the rules of appropriate positioning the source.
The default PML layer for 2D is 20 so it is obligatory to put the source and sensor out of this range?(e.g. if the size of my medium in x direction is 200. then I have to put the source/sensor in the range 21 and 189?
Michal
The code
clear all;
close all
clc
% =========================================================================
% SIMULATION
% =========================================================================
%% create the computational grid
Nx = 128; % number of grid points in the x (row) direction
Ny = 128; % number of grid points in the y (column) direction
dx = 0.1e-3; % grid point spacing in the x direction [m]
dy = 0.1e-3; % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);
%% define the properties of the propagation medium
medium.sound_speed =2000; % [m/s] or 1500 m/s
medium.density=1000; %[kg/m3]
%% define source
source.p_mask=zeros(Nx,Ny);
source.p_mask(21,:)=1;
source.p(1,:)=toneBurst(10e6,0.5e6,3);
%% define a centered circular sensor
sensor.mask = zeros(Nx,Ny);
sensor.mask (Nx-21,:)=1;
sensor.record={'p'};
%% run the simulation
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);%,'PlotScale','auto');
% =========================================================================
% VISUALISATION
% =========================================================================
plot(mean(sensor_data.p))