<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: Acoustic simulations with different grid spacing</title>
		<link>http://www.k-wave.org/forum/topic/acoustic-simulations-with-different-grid-spacing</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:21:26 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/acoustic-simulations-with-different-grid-spacing" rel="self" type="application/rss+xml" />

		<item>
			<title>bencox on "Acoustic simulations with different grid spacing"</title>
			<link>http://www.k-wave.org/forum/topic/acoustic-simulations-with-different-grid-spacing#post-8269</link>
			<pubDate>Sat, 31 Jul 2021 18:18:03 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">8269@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Cristina, &#60;/p&#62;
&#60;p&#62;This is expected behaviour in k-Wave and is due to the bandlimited interplant, ie. the function that interpolates between the grid points in the algorithm that k-Wave uses. In broad terms, when you use a point source, k-Wave sees a sinc function, and the size of the main lobe of the sinc function will depend on the grid size, and this affects the amplitude of the wave that propagates. Could you place a sensor at the source, and correct for the amplitude difference in your application?&#60;/p&#62;
&#60;p&#62;Best wishes&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>cristinap on "Acoustic simulations with different grid spacing"</title>
			<link>http://www.k-wave.org/forum/topic/acoustic-simulations-with-different-grid-spacing#post-8221</link>
			<pubDate>Fri, 18 Jun 2021 08:51:35 +0000</pubDate>
			<dc:creator>cristinap</dc:creator>
			<guid isPermaLink="false">8221@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Treeby and collegues,&#60;/p&#62;
&#60;p&#62;I’m new to k-wave, and I’m running some initial simple tests with a point-source ultrasound source.&#60;br /&#62;
I ran simulation with the same grid size and source, but the pressure along time measured at four different sensors changed (both in terms of amplitude and phase) depending on the grid spacing (dx,dy). I am quite surprise to observe this quite big difference, because the grid spacing was in all case always smaller than 1/10 of the wavelength. Below you can fine the code I used.&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Cristina&#60;/p&#62;
&#60;p&#62;------------------------------- MATLAB CODE ------------------------------&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;/p&#62;
&#60;p&#62;Nx = 83;    % I chose 83, 216, 431        % number of grid points in the x (row) direction&#60;br /&#62;
Ny = Nx;           % number of grid points in the y (column) direction&#60;/p&#62;
&#60;p&#62;dx = 0.05/Nx;    	% grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;            % grid point spacing in the y direction [m]&#60;/p&#62;
&#60;p&#62;kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500;  % [m/s]&#60;br /&#62;
medium.alpha_coeff = 0.75;  % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.makeTime(medium.sound_speed);&#60;/p&#62;
&#60;p&#62;mask_source=zeros(Nx,Ny);&#60;br /&#62;
mask_source(round(Nx/2),round(Ny/2))=1;&#60;br /&#62;
source.p_mask = mask_source;&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal source&#60;br /&#62;
source_freq = 0.25e6;       % [Hz]&#60;br /&#62;
source_mag = 0.5;           % [Pa]&#60;br /&#62;
source.p = source_mag * sin(2 * pi * source_freq * kgrid.t_array);&#60;/p&#62;
&#60;p&#62;% filter the source to remove high frequencies not supported by the grid&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;% create a display mask to display the transducer&#60;br /&#62;
display_mask = source.p_mask;&#60;/p&#62;
&#60;p&#62;sensor.mask=[[-24e-3:1e-3:24e-3];[-24e-3:1e-3:24e-3]];&#60;/p&#62;
&#60;p&#62;% assign the input options&#60;br /&#62;
input_args = {'DisplayMask', display_mask, 'PMLInside', false, 'PlotPML', false};&#60;/p&#62;
&#60;p&#62;% plot the initial pressure and sensor distribution&#60;br /&#62;
figure('color','white');&#60;br /&#62;
imagesc(kgrid.y_vec * 1e3, kgrid.x_vec * 1e3,  source.p_mask, [-1, 1]);&#60;br /&#62;
hold on; plot(sensor.mask(1,20)*1e3,sensor.mask(2,20)*1e3,'ro','MarkerFaceColor','r')&#60;br /&#62;
hold on; plot(sensor.mask(1,15)*1e3,sensor.mask(2,15)*1e3,'ko','MarkerFaceColor','k')&#60;br /&#62;
hold on; plot(sensor.mask(1,10)*1e3,sensor.mask(2,10)*1e3,'mo','MarkerFaceColor','m')&#60;br /&#62;
hold on; plot(sensor.mask(1,5)*1e3,sensor.mask(2,5)*1e3,'go','MarkerFaceColor','g')&#60;/p&#62;
&#60;p&#62;colormap(getColorMap);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
xlabel('y-position [mm]');&#60;br /&#62;
axis image;&#60;/p&#62;
&#60;p&#62;%% run simulation&#60;br /&#62;
figure;&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% VISUALISATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;figure; plot(kgrid.t_array,sensor_data(20,:),'r')&#60;br /&#62;
hold on; plot(kgrid.t_array,sensor_data(15,:),'k')&#60;br /&#62;
hold on; plot(kgrid.t_array,sensor_data(10,:),'m')&#60;br /&#62;
hold on; plot(kgrid.t_array,sensor_data(5,:),'g')&#60;br /&#62;
legend('20','15','10','5')
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
