<?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 simulation not giving expected focal gain</title>
		<link>http://www.k-wave.org/forum/topic/2d-simulation-not-giving-expected-focal-gain</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:47:20 +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-simulation-not-giving-expected-focal-gain" rel="self" type="application/rss+xml" />

		<item>
			<title>chuck_c on "2D simulation not giving expected focal gain"</title>
			<link>http://www.k-wave.org/forum/topic/2d-simulation-not-giving-expected-focal-gain#post-6559</link>
			<pubDate>Thu, 16 Aug 2018 22:46:46 +0000</pubDate>
			<dc:creator>chuck_c</dc:creator>
			<guid isPermaLink="false">6559@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks for the good explanation. This is helpful and makes sense.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "2D simulation not giving expected focal gain"</title>
			<link>http://www.k-wave.org/forum/topic/2d-simulation-not-giving-expected-focal-gain#post-6558</link>
			<pubDate>Thu, 16 Aug 2018 21:14:06 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">6558@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Charles, &#60;/p&#62;
&#60;p&#62;In your 2D simulation you're modelling the focussing of (part of) a cylindrical wave, not (part of) a spherical wave. The 2D simulation can be thought of as modelling a 3D scenario in which everything is constant in the unmodelled dimension, so the curved source in 2D could be thought of as modelling a 3D source that is the shape of side of a cylinder, eg. shaped like guttering. So the focus will certainly be very different, yes.&#60;/p&#62;
&#60;p&#62;Best wishes,&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>chuck_c on "2D simulation not giving expected focal gain"</title>
			<link>http://www.k-wave.org/forum/topic/2d-simulation-not-giving-expected-focal-gain#post-6537</link>
			<pubDate>Fri, 27 Jul 2018 19:39:48 +0000</pubDate>
			<dc:creator>chuck_c</dc:creator>
			<guid isPermaLink="false">6537@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am trying to simulate a spherical cap shaped piezoceramic transducer in 2D. I have characterized the physical transducer with a hydrophone, and my 3D simulations yield the expected pressure pattern and gain (ratio of max to source pressure) of 40. However, when I try to collapse the simulation to 2D for kspaceFirstOrder2D, I only get a gain of ~9. Is this behavior expected?&#60;/p&#62;
&#60;p&#62;Any input is helpful and appreciated.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Charles&#60;/p&#62;
&#60;p&#62;----------------------Begin code snippet---------------------&#60;br /&#62;
clear all;&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nz = 256*2;           % number of grid points in the z (row) direction7&#60;br /&#62;
Nx = Nz;           % number of grid points in the y (column) direction&#60;br /&#62;
dx = 200e-6;        % grid point spacing in the x direction [m]&#60;br /&#62;
dz = dx;        % grid point spacing in the y direction [m]&#60;/p&#62;
&#60;p&#62;medium.sound_speed = ones([Nx Nz])*1480; % m/s sound speed in water&#60;br /&#62;
medium.density = ones([Nx Nz])*1e03; % kg/m^3 density of water&#60;/p&#62;
&#60;p&#62;kgrid = makeGrid(Nx, dx, Nz, dz);&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed);&#60;/p&#62;
&#60;p&#62;Nt = length(kgrid.t_array);&#60;/p&#62;
&#60;p&#62;%%&#60;/p&#62;
&#60;p&#62;% first define transduce geometry and place elemental sources in the kgrid&#60;br /&#62;
transducer_radius_m = (64e-03);&#60;br /&#62;
transducer_height_m = (63.2 - 51.74)*1e-03;&#60;/p&#62;
&#60;p&#62;transducer_radius_pix = round( transducer_radius_m / dz );&#60;br /&#62;
transducer_height_pix = round( transducer_height_m / dx );&#60;/p&#62;
&#60;p&#62;sphere = rot90(makeArc([Nx Nz], [Nx/2 10], transducer_radius_pix, transducer_radius_pix+1, [Nx/2 Nx/2]),-1);&#60;/p&#62;
&#60;p&#62;[sx, sy, sz] = size(sphere);&#60;/p&#62;
&#60;p&#62;source.p_mask = zeros(Nx,Nz);&#60;br /&#62;
source.p_mask = sphere; &#60;/p&#62;
&#60;p&#62;%% source signal&#60;br /&#62;
% transducer source parameters&#60;br /&#62;
% define a time varying sinusoidal source&#60;br /&#62;
source_freq = 1.1e6;       % [Hz]&#60;br /&#62;
source_mag = 1e6/40;       % [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 any high frequencies not supported by the grid&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
plot( source_freq*kgrid.t_array, source.p );&#60;br /&#62;
xlabel('# cycles (freq * time)');&#60;br /&#62;
ylabel('Input pressure [Pa]');&#60;/p&#62;
&#60;p&#62;%% setup sensor and run simulation&#60;/p&#62;
&#60;p&#62;sensor.mask = ones(Nx,Nz);&#60;br /&#62;
sensor.record = {'p_max'};&#60;/p&#62;
&#60;p&#62;input_args = {'PlotSim', true, 'DisplayMask', source.p_mask, 'DataCast', 'single', 'PMLInside', false, 'PlotPML', false};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
[sensor_data] = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:} );&#60;/p&#62;
&#60;p&#62;pmap = reshape(sensor_data.p_max(:), Nx, Nz);&#60;/p&#62;
&#60;p&#62;%% Image pressure map&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(1e03*dx * (1:Nx), 1e03*dz*(1:Nz), transpose(pmap));&#60;br /&#62;
xlabel('x [mm]');&#60;br /&#62;
ylabel('z [mm]');&#60;br /&#62;
pmap_single = gather(pmap);&#60;br /&#62;
colormap(jet)&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;--------------------------------End Code Snippet-----------------------------------
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
