Hey,
We are trying to use this code to produce a graph between pressure vs. time using kspaceSecondOrder function and kspaceFirstOrder2D function but we are not getting the result. Can anyone please help us. Following is the code :
Nx = 128;
Ny = 128;
Nz = 128;
dx = .1*10^-3;
dy = .1*10^-3;
t_end = 6*10^-6;
medium.sound_speed = 1500;
medium.alpha_coeff = .75;
medium.alpha_power = 1.5;
disc_magnitude = 5;
disc_x_pos = 50;
disc_y_pos = 50;
disc_radius = 8;
disc_1 = disc_magnitude*makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);
disc_magnitude = 3;
disc_x_pos = 80;
disc_y_pos = 60;
disc_radius = 5;
disc_2 = disc_magnitude*makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);
source.p0 = disc_1 + disc_2;
sensor_x_pos = Nx/2;
sensor_y_pos = Ny/2;
sensor_radius = Nx/2-22;
sensor_arc_angle = 3*pi/2;
sensor.mask =makeCircle(Nx,Ny,sensor_x_pos,sensor_y_pos,sensor_radius,sensor_arc_angle);
kgrid = makeGrid(Nx, dx, Ny,dy);
kgrid.t_array = makeTime(kgrid,medium.sound_speed,[],t_end);
sensor.mask = cart2grid(kgrid, sensor.mask);
sensor_data = kspaceSecondOrder(kgrid, medium, source, sensor, 'ExpandGrid', true);
sensor_data_reordered =reorderSensorData(kgrid, sensor , sensor_data);
figure;
imagesc(sensor_data_reordered, [-1,1]);
colormap(getColorMap);
ylabel('Sensor Position');
xlabel('Time Step');
colorbar;
[~,scale,prefix] = scaleSI(max(kgrid.t_array));
plot(kgrid.t_array*scale,sensor_data.p);