<?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: 2D Array Simulations</title>
		<link>http://www.k-wave.org/forum/topic/2d-array-simulations</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:09:04 +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/2d-array-simulations" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "2D Array Simulations"</title>
			<link>http://www.k-wave.org/forum/topic/2d-array-simulations#post-8374</link>
			<pubDate>Thu, 16 Dec 2021 11:07:55 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8374@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Noora,&#60;/p&#62;
&#60;p&#62;When using &#60;code&#62;kWaveArray&#60;/code&#62; you can have as many elements as you like in any position and orientation. So one way would be to have a double for loop over x and y positions, and use &#60;code&#62;addRectElement&#60;/code&#62; to add them to the array.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Noora on "2D Array Simulations"</title>
			<link>http://www.k-wave.org/forum/topic/2d-array-simulations#post-8328</link>
			<pubDate>Sun, 17 Oct 2021 04:42:48 +0000</pubDate>
			<dc:creator>Noora</dc:creator>
			<guid isPermaLink="false">8328@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I am new to kwave and planning to model a 2D array transducer of 32x32 element and I am a bit confused as most of the examples are for the 1D array can you check my code as the transducer is my sensor and grid size is 192x192x192 and dx=0.73 mm, my pressure source is varying with time. The code below is for 1D array how to generalize it for 2D array?&#60;/p&#62;
&#60;p&#62;% create empty array&#60;br /&#62;
karray = kWaveArray;&#60;/p&#62;
&#60;p&#62;sensor_focus    = 100e-3;    % focal length [m]&#60;br /&#62;
element_num     = 32;       % number of elements&#60;br /&#62;
element_width   = 3.65e-3;     % width [m]&#60;br /&#62;
element_length  = 3.65e-3;    % elevation height [m]&#60;br /&#62;
element_pitch   = 0.2e-3;     % pitch [m]&#60;/p&#62;
&#60;p&#62;% set indices for each element of the array transducer&#60;br /&#62;
if rem(element_num, 2)&#60;br /&#62;
    ids = (1:element_num) - ceil(element_num/2);&#60;br /&#62;
else&#60;br /&#62;
    ids = (1:element_num) - (element_num + 1)/2;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% create empty kWaveArray&#60;br /&#62;
karray = kWaveArray('BLITolerance', 0.05, 'UpsamplingRate', 10);&#60;/p&#62;
&#60;p&#62;for ind = 1:element_num&#60;/p&#62;
&#60;p&#62;    % set element y position&#60;br /&#62;
    x_pos(ind) = 0 - (element_num * element_width / 2 - element_width / 2) + (ind - 1) * element_width;&#60;/p&#62;
&#60;p&#62;    % add element (see note in header)&#60;br /&#62;
    karray.addRectElement([x_pos(ind), 0, kgrid.z_vec(1)], element_width, element_length,[0,0,0]);  &#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;% assign binary mask&#60;br /&#62;
sensor.mask = karray.getArrayBinaryMask(kgrid);
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
