Hello,
Could you please give me some advice on the following paper of yours?
http://www.k-wave.org/papers/2010-Treeby-JBO.pdf
I would like to generate some simulation data from lossless medium, as you mentioned in the paper the combination of the linear first order equations would be a single second order wave equation. In such a medium I want to put a source and detect the signals. I tried the code you brought in the paper
% create the computational grid
Nx = 256;
Nz = 128;
dx = 50e-6;
dz = 50e-6;
kgrid = makeGrid(Nx, dx, Nz, dz);
% define the medium properties
medium.sound_speed = 1500
ones(Nz, Nx);
medium.sound_speed(1:50,:) = 1600;
medium.density = 1000
ones(Nz, Nx);
medium.density(1:50,:) = 1040;
% define the initial pressure
disc_x_pos = 120;
disc_z_pos = 75;
disc_radius = 8;
disc_mag = 3;
source.p0 = disc_mag*makeDisc(Nx, Nz,disc_x_pos, disc_z_pos, disc_radius);
% define a centered circular sensor
sensor_radius = 2.5e-3;
num_sensor_points = 50;
sensor.mask = makeCartCircle(sensor_radius, num_sensor_points);
% run the simulation
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);
But it didn’t work and I got the error message of
Running k-Wave simulation...
start time: 03-Oct-2014 13:26:20
reference sound speed: 1600m/s
dt: 9.375ns, t_end: 8.9437us, time steps: 955
input grid size: 256 by 128 grid points (12.8 by 6.4mm)
maximum supported frequency: 16MHz
smoothing p0 distribution...
calculating Delaunay triangulation...
precomputation completed in 0.20481s
starting time loop...
Error using .*
Matrix dimensions must agree.
Error in kspaceFirstOrder2D (line 762)
ux_sgx = bsxfun(@times, pml_x_sgx, ...
Error in Untitled (line 25)
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);
Thanks,