<?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: About piston pressure field</title>
		<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 08:58:35 +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/about-piston-pressure-field" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "About piston pressure field"</title>
			<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field#post-5237</link>
			<pubDate>Mon, 14 Sep 2015 21:58:12 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5237@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Jan,&#60;/p&#62;
&#60;p&#62;A simulation on a 2D Cartesian grid inherently assumes that everything is infinitely extended in the third dimension. For example, a point source modelled in 2D will give the same response as an infinite line source in 3D. Consequently, if you try to model a piston source as a line in 2D, the response you observe will actually be that of an infinitely long rectangular aperture. This is the difference in the response compared to a piston source in 3D. &#60;/p&#62;
&#60;p&#62;Note, it is also possible (although not currently in k-Wave) to perform 2D simulations assuming the field is axisymmetric. In this case, you would see the correct response.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hettljan on "About piston pressure field"</title>
			<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field#post-5234</link>
			<pubDate>Thu, 10 Sep 2015 13:02:25 +0000</pubDate>
			<dc:creator>hettljan</dc:creator>
			<guid isPermaLink="false">5234@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I used the following code&#34;&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;/p&#62;
&#60;p&#62;clear all;&#60;/p&#62;
&#60;p&#62;%% CREATE COMPUTATIONAL GRID&#60;br /&#62;
Nx= 128;                    % number of grid points in the x direction&#60;br /&#62;
Ny= 256;                    % number of grid points in the y direction&#60;br /&#62;
dx = 20.6e-3/Nx;            % grid point spacing in the y direction [m]&#60;br /&#62;
dy = 40e-3/Ny;    	    % grid point spacing in the x direction [m]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;%% SET MEDIUM&#60;br /&#62;
medium.sound_speed = 1500;  % [m/s]&#60;/p&#62;
&#60;p&#62;%% DEFINE THE TRANSDUCER&#60;br /&#62;
dia=2*floor(inch2m(0.5)/(2*dx));        % diameter of the transducer in grid pts&#60;br /&#62;
source.p_mask = makeLine(Nx, Ny, [Nx/2-dia/2 1], [Nx/2+dia/2 1]);&#60;/p&#62;
&#60;p&#62;%% DEFINE INPUT SIGNAL&#60;br /&#62;
excitation='CW';&#60;br /&#62;
switch excitation&#60;br /&#62;
    case 'toneBurst'&#60;br /&#62;
        source_mag = 1e5;          % [Pa]&#60;br /&#62;
        f = 1e6;        % [Hz]&#60;br /&#62;
        tone_burst_cycles = 5;&#60;br /&#62;
        [kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed);&#60;br /&#62;
        source.p = source_mag.*toneBurst(1/kgrid.dt, f, tone_burst_cycles);&#60;br /&#62;
    case 'CW'&#60;br /&#62;
        f = 1e6;                        % excitation frequency  [Hz]&#60;br /&#62;
        source_mag = 0.5e6;             % excitation amplitude [Pa]&#60;br /&#62;
        nTimeSteps=2500;&#60;br /&#62;
        dt=2e-8;&#60;br /&#62;
        kgrid.t_array=(0:1:nTimeSteps)*dt;&#60;br /&#62;
        source.p = source_mag*sin(2*pi*f*kgrid.t_array);            % generate cw sine&#60;br /&#62;
        ramp_length = round((2*pi/f)/dt);&#60;br /&#62;
        ramp = (-cos( (0:(ramp_length-1))*pi/ramp_length ) + 1)/2;  % prepare ramp wfm for moothing&#60;br /&#62;
        source.p(1:ramp_length) = ramp .* source.p(1:ramp_length);  % &#34;windowed&#34; cw sine&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;%% SENSOR&#60;br /&#62;
sensor.mask = [1, 1, Nx, Ny].';&#60;br /&#62;
sensor.record = {'p'};&#60;br /&#62;
sensor.record_start_index = kgrid.Nt - 10*1/(f*dt) + 1;&#60;/p&#62;
&#60;p&#62;%% ASSIGN INPUT PARAMETERS AND RUN SIMULATION&#60;br /&#62;
display_mask = source.p_mask;                               % create a display mask to display the transducer&#60;br /&#62;
input_args = {'DisplayMask', display_mask, 'PMLInside', false,...&#60;br /&#62;
    'DataCast', 'gpuArray-single', 'DataRecast', true,...&#60;br /&#62;
    'PlotScale', [-1, 1]*source_mag, 'DisplayMask', source.p_mask,};&#60;/p&#62;
&#60;p&#62;sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;%% POST-PROCESSING&#60;br /&#62;
NormPressField=rms(sensor_data.p,3);&#60;br /&#62;
NormPressField=NormPressField./maxND(NormPressField);&#60;/p&#62;
&#60;p&#62;%% VISUALISATION&#60;br /&#62;
figure  % beam pattern&#60;br /&#62;
pcolor((0:1:Ny-1)*dy*1e3, kgrid.x_vec*1e3,NormPressField);&#60;br /&#62;
shading flat&#60;br /&#62;
caxis([0 1])&#60;br /&#62;
colormap(jet);&#60;br /&#62;
xlabel('x [mm]','FontSize',14);&#60;br /&#62;
ylabel('y [mm]','FontSize',14);&#60;br /&#62;
title('Beam Pattern','FontSize',16)&#60;br /&#62;
axis image;&#60;br /&#62;
colorbar&#60;/p&#62;
&#60;p&#62;figure % on axis pressure&#60;br /&#62;
Pressure=NormPressField(end/2,2:end);&#60;br /&#62;
plot((2:1:Ny)*dy*1e3,Pressure,'b*')&#60;br /&#62;
xlabel('x-position [mm]');&#60;br /&#62;
ylabel('RMS pressure');&#60;br /&#62;
axis tight;&#60;br /&#62;
title('On axis RMS pressure');&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hettljan on "About piston pressure field"</title>
			<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field#post-5233</link>
			<pubDate>Thu, 10 Sep 2015 13:00:38 +0000</pubDate>
			<dc:creator>hettljan</dc:creator>
			<guid isPermaLink="false">5233@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I tried to do the same simulation in 2D instead of a full 3D solution, but I've got very different results. Instead of having the near field/far field interface for 0.5&#34; circular element at approx. 25 cm, it has shifted further to approx. 35 cm. The beam pattern looks reasonable though.&#60;/p&#62;
&#60;p&#62;Is there any explanation for that? Can I simulate the beam pattern for circular single element transducer  accurately in 2D?&#60;/p&#62;
&#60;p&#62;Thanks for the answer,&#60;br /&#62;
Jan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "About piston pressure field"</title>
			<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field#post-4844</link>
			<pubDate>Thu, 20 Nov 2014 11:19:49 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4844@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Most analytical solutions give the variation of the pressure &#60;em&#62;amplitude&#60;/em&#62; as a function of distance, given a continuous wave source at a particular frequency. To compare with k-Wave (which is a time domain solver), you will need to wait until the simulation reaches steady state, and then extract the amplitude of the pressure at each position. It also helps if you define the spatial and time grid spacings to be an integer number of points per wavelength and period. &#60;/p&#62;
&#60;p&#62;I've written a simple example to compare k-Wave with the analytical solution for the on-axis pressure from a circular piston source, which you can download &#60;a href=&#34;http://www.k-wave.org/downloads/example_circular_piston.m&#34;&#62;here&#60;/a&#62;. Let me know if something isn't clear.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>nj_fanxudong on "About piston pressure field"</title>
			<link>http://www.k-wave.org/forum/topic/about-piston-pressure-field#post-4838</link>
			<pubDate>Fri, 14 Nov 2014 03:35:22 +0000</pubDate>
			<dc:creator>nj_fanxudong</dc:creator>
			<guid isPermaLink="false">4838@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am also a little bit new to kWave, so my apologies for this low-level question.&#60;/p&#62;
&#60;p&#62;I am trying to define a source which moves like a piston.And I want to get the pressure distribution along the propagation direction.But the simulation results are not the same as the ones calculated by acoustic theory.Can someone please explain what is the right approach? &#60;/p&#62;
&#60;p&#62;Thank you in advance.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
