<?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: wrong  Pressure of Focus in bowl focused transducer simulation</title>
		<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:02:58 +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/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8980</link>
			<pubDate>Thu, 07 Dec 2023 11:26:38 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8980@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Are you extracting the amplitude at the fundamental and the harmonics? Note, you can avoid start-up transients in your sensor data (including the &#60;code&#62;p_max&#60;/code&#62; calculation) by defining &#60;code&#62;sensor.record_start_index&#60;/code&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Arlen on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8978</link>
			<pubDate>Thu, 07 Dec 2023 06:17:34 +0000</pubDate>
			<dc:creator>Arlen</dc:creator>
			<guid isPermaLink="false">8978@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Bradley Treeby,&#60;br /&#62;
Thanks for your advice!&#60;br /&#62;
I found that this problem happens when simulation is in nonlinear condition. And I try to use sensor.record = {'p'} and extractAmpPhase() to find the max pressure, then the results are converged.  I think maybe when use sensor to record 'p_max', the sound field is unstable at the beginning, the max pressure of which is larger than when the sound field is stable, and the wrong max pressure is recorded.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8956</link>
			<pubDate>Fri, 24 Nov 2023 17:33:42 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8956@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;It sounds like the simulation hasn't converged. When you run nonlinear simulations, the grid needs to be fine enough to supported the generated higher frequency harmonics. If it's not, you will get a numerical error called spectral blocking. So in short, either reduce the amplitude of your source, or keep decreasing the grid size until the simulation output doesn't depend on the computational settings.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Arlen on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8931</link>
			<pubDate>Mon, 09 Oct 2023 10:23:04 +0000</pubDate>
			<dc:creator>Arlen</dc:creator>
			<guid isPermaLink="false">8931@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, Bradley&#60;br /&#62;
    I have changed the number of grid points (Nx, Ny, Nz), keeping the x_size (y_size, z_size) nearly same.  But when I delete 'medium.BonA=7', the pressure of focus converges, changing the grid size (dx, dy, dz).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8929</link>
			<pubDate>Sun, 08 Oct 2023 13:05:13 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8929@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Do you also change the number of grid points (Nx etc) as you change the grid spacing to keep the overall grid size constant?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Arlen on "wrong  Pressure of Focus in bowl focused transducer simulation"</title>
			<link>http://www.k-wave.org/forum/topic/wrong-pressure-of-focus-in-bowl-focused-transducer-simulation#post-8917</link>
			<pubDate>Mon, 25 Sep 2023 15:09:21 +0000</pubDate>
			<dc:creator>Arlen</dc:creator>
			<guid isPermaLink="false">8917@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi，&#60;br /&#62;
   I'm doing bowl focused transducer simulation, with signal of 1Mhz and 543.36e3 pa. But when I use smaller dx, dy, dz ,the  pressure of focus(max pressure) is  getting higher. And when I use 0.3mm of grid size, the max pressure is about 30 Mpa, and 0.2mm of grid size, the max pressure is about 40 Mpa! While the same parameters I put in focusedBowlONeil() to calculate, the max pressure at focus is just about 20 Mpa, almost the same 20 Mpa results when I use  0.5mm of grid size(dx,dy,dz). Am I use so large amplitude?&#60;br /&#62;
   My English isn't very well , hope you understand my confusion and help me to solve this problem.&#60;br /&#62;
   Thanks!!!&#60;/p&#62;
&#60;p&#62;   Here are my codes:&#60;br /&#62;
clear;&#60;br /&#62;
clf;&#60;br /&#62;
close all;&#60;br /&#62;
addpath('D:\k-wave-toolbox-version-1.4\k-Wave');&#60;/p&#62;
&#60;p&#62;Nx = 130*3;            % number of grid points in the x direction&#60;br /&#62;
Ny = 80*3;            % number of grid points in the y direction&#60;br /&#62;
Nz = 80*3;            % number of grid points in the z direction&#60;br /&#62;
dx =0.3e-3;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy =0.3e-3;        % grid point spacing in the y direction [m]&#60;br /&#62;
dz =0.3e-3;        % grid point spacing in the z direction [m]&#60;br /&#62;
x_size=dx*Nx;&#60;br /&#62;
y_size=dy*Ny;&#60;br /&#62;
z_size=dz*Nz;&#60;/p&#62;
&#60;p&#62;sound_speed=1500;         % [m/s]媒介声速&#60;br /&#62;
density = 1000 ;          % [kg/m^3]媒介密度&#60;/p&#62;
&#60;p&#62;% radius    = 63*2;         %换能器曲率半径&#60;br /&#62;
% diameter  = 63*2 - 1;          %换能器直径（奇数）&#60;/p&#62;
&#60;p&#62;kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.BonA=7;                             %水里的超声非线性参数&#60;br /&#62;
medium.sound_speed = sound_speed * ones(Nx, Ny, Nz);	% [m/s]&#60;br /&#62;
medium.density = density * ones(Nx, Ny, Nz);       % [kg/m^3]&#60;br /&#62;
kgrid.makeTime(medium.sound_speed,0.3,80e-6);&#60;/p&#62;
&#60;p&#62;% define a centered circular sensor&#60;br /&#62;
% define a series of Cartesian points to collect the data&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
sensor.mask(:, :, Nz/2) = 1;&#60;br /&#62;
% set the record mode such that only the max and peak values are stored&#60;br /&#62;
sensor.record = {'p_max'};&#60;/p&#62;
&#60;p&#62;% % input arguments&#60;br /&#62;
 input_args = {'PlotPML', true, ...&#60;br /&#62;
     'DataCast', 'single', 'CartInterp', 'linear','PlotSim',true,'PlotLayout',true,'PMLInside',true,'PMLSize',[20,20,20]};&#60;br /&#62;
% grid_size = [Nx, Ny, Nz];%网格空间&#60;br /&#62;
% bowl_pos  = [1, Ny/2,Nz/2];%bowl的中心点&#60;br /&#62;
% %radius    = Nx/2;%曲率半径&#60;br /&#62;
% %diameter  =Nx-1;%圆的直径&#60;br /&#62;
% focus_pos = [Nx/2, Ny/2, Nz/2 ];%与bowl_pos连线为对称轴（确定方向） 和法向量有一点点像 决定换能器姿态&#60;br /&#62;
% source.p_mask=makeBowl(grid_size, bowl_pos, radius, diameter, focus_pos, 'Plot', true);&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal source&#60;br /&#62;
source_mag = 543.36e3;     % [Pa]&#60;br /&#62;
% create empty array&#60;br /&#62;
karray = kWaveArray('SinglePrecision',true);&#60;br /&#62;
%position = [1, Ny/2, Nz/2];&#60;br /&#62;
position = [-x_size/2+20e-3,0,0];&#60;br /&#62;
% define arc properties&#60;br /&#62;
radius    = 63.2e-3;              % [m]&#60;br /&#62;
diameter  = 64e-3;              % [m]&#60;/p&#62;
&#60;p&#62;focus_pos = [x_size/2, 0, 0];&#60;/p&#62;
&#60;p&#62;karray.addBowlElement(position, radius, diameter, focus_pos);&#60;/p&#62;
&#60;p&#62;source.p_mask = karray.getArrayBinaryMask(kgrid);&#60;br /&#62;
voxelPlot(double(source.p_mask));&#60;/p&#62;
&#60;p&#62;source_freq = 1e6;      % [Hz]声源频率&#60;br /&#62;
sig1 = source_mag * sin(2 * pi * source_freq * kgrid.t_array);&#60;br /&#62;
 % smooth the source&#60;br /&#62;
sig1 = filterTimeSeries(kgrid, medium, sig1,'PlotSignals',true,'PlotSpectrums',true);&#60;/p&#62;
&#60;p&#62;source_signal = zeros(1,length(sig1));&#60;br /&#62;
source_signal(1,1:length(sig1)) = sig1;&#60;br /&#62;
source.p = karray.getDistributedSourceSignal(kgrid, source_signal);&#60;br /&#62;
sensor_data = kspaceFirstOrder3DG(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;sensor_data.p_max = reshape(sensor_data.p_max, [Nx, Ny]);&#60;br /&#62;
sensor_data.p_max = reshape(sensor_data.p_max, [Nx, Ny]);&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(kgrid.x_vec, kgrid.y_vec,sensor_data.p_max);&#60;br /&#62;
xlabel('x [m]');&#60;br /&#62;
ylabel('y [m]');&#60;br /&#62;
%zlabel('z [m]');&#60;br /&#62;
title('Maximum Pressure');&#60;br /&#62;
c = colorbar;&#60;br /&#62;
c.Label.String = 'pressure()';&#60;/p&#62;
&#60;p&#62;max = sensor_data.p_max(1,1);&#60;br /&#62;
maxi = [1,1];&#60;br /&#62;
[max, maxi];&#60;br /&#62;
    for a=floor(0.3*Nx):Nx&#60;br /&#62;
        for b=1:Ny&#60;br /&#62;
            if sensor_data.p_max(a,b)&#38;gt;max&#60;br /&#62;
           max= sensor_data.p_max(a,b);&#60;br /&#62;
           maxi=[a,b];&#60;br /&#62;
            end&#60;br /&#62;
        end&#60;br /&#62;
     end&#60;/p&#62;
&#60;p&#62;focus_x = 0;&#60;br /&#62;
focusx_max = 0;&#60;br /&#62;
focusy_max = 0;&#60;br /&#62;
focus_y = 0;&#60;br /&#62;
focus_l = 0;&#60;br /&#62;
focus_r = 0;&#60;br /&#62;
focus_u = 0;&#60;br /&#62;
focus_d = 0;&#60;br /&#62;
[focus_x,focus_y];&#60;br /&#62;
for a=floor(0.3*Nx):(Nx - 1)&#60;br /&#62;
    for b=1:(Ny - 1)&#60;br /&#62;
        if sensor_data.p_max(a,b)&#38;lt;0.71*max&#38;amp;&#38;amp;sensor_data.p_max(a,b+1)&#38;gt;0.71*max&#60;br /&#62;
           %sensor_data.p_max(a,b)=0;&#60;br /&#62;
           focus_l = b+1;&#60;br /&#62;
        end&#60;br /&#62;
        if sensor_data.p_max(a,b)&#38;gt;0.71*max&#38;amp;&#38;amp;sensor_data.p_max(a,b+1)&#38;lt;0.71*max&#60;br /&#62;
           %sensor_data.p_max(a,b)=0;&#60;br /&#62;
           focus_r = b+1;&#60;br /&#62;
        end&#60;br /&#62;
         if sensor_data.p_max(a,b)&#38;lt;0.71*max&#38;amp;&#38;amp;sensor_data.p_max(a+1,b)&#38;gt;0.71*max&#60;br /&#62;
           focus_u = a+1;&#60;br /&#62;
        end&#60;br /&#62;
        if sensor_data.p_max(a,b)&#38;gt;0.71*max&#38;amp;&#38;amp;sensor_data.p_max(a+1,b)&#38;lt;0.71*max&#60;br /&#62;
           %sensor_data.p_max(a,b)=0;&#60;br /&#62;
           focus_d = a+1;&#60;br /&#62;
        end&#60;br /&#62;
    end&#60;br /&#62;
    focus_x = focus_r - focus_l;&#60;br /&#62;
    focus_y = focus_d - focus_u;&#60;br /&#62;
    if focus_x &#38;gt; focusx_max&#60;br /&#62;
        focusx_max = focus_x;&#60;br /&#62;
    end&#60;br /&#62;
    if focus_y &#38;gt; focusy_max&#60;br /&#62;
        focusy_max = focus_y;&#60;br /&#62;
    end&#60;br /&#62;
%     if focus_d &#38;gt; 0&#60;br /&#62;
%         break;&#60;br /&#62;
%     end&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% define transducer parameters&#60;br /&#62;
radius      = 63.2e-3;   % [m]&#60;br /&#62;
diameter    = 64e-3;   % [m]&#60;/p&#62;
&#60;p&#62;frequency   = 1e6;      % [Hz]&#60;br /&#62;
sound_speed = 1500;     % [m/s]&#60;br /&#62;
density     = 1000;     % [kg/m^3]&#60;br /&#62;
Z = density*sound_speed;&#60;br /&#62;
p = 543.36e3;&#60;br /&#62;
velocity    = p/Z;   % [m/s]&#60;br /&#62;
% define position vectors&#60;br /&#62;
axial_position   = 0:5e-4:150e-3;       % [m]&#60;br /&#62;
lateral_position = -15e-3:5e-4:15e-3;   % [m]&#60;br /&#62;
% evaluate pressure&#60;br /&#62;
[p_axial, p_lateral] = focusedBowlONeil(radius, diameter, velocity, ...&#60;br /&#62;
    frequency, sound_speed, density, axial_position, lateral_position);&#60;/p&#62;
&#60;p&#62;% plot&#60;br /&#62;
figure;&#60;br /&#62;
subplot(4, 1, 1);&#60;br /&#62;
plot(axial_position .* 1e3, p_axial .* 1e-6, 'k-');&#60;br /&#62;
xlabel('Axial Position [mm]');&#60;br /&#62;
ylabel('Pressure [MPa]');&#60;br /&#62;
subplot(4, 1, 2);&#60;br /&#62;
plot((0:dx:(Nx-1)*dx) .* 1e3, sensor_data.p_max(:,Ny/2).* 1e-6, 'k-');&#60;br /&#62;
xlabel('Axial Position [mm]');&#60;br /&#62;
ylabel('Pressure [MPa]');&#60;br /&#62;
subplot(4, 1, 3);&#60;br /&#62;
plot(lateral_position .* 1e3, p_lateral .* 1e-6, 'k-');&#60;br /&#62;
xlabel('Lateral Position [mm]');&#60;br /&#62;
ylabel('Pressure [MPa]');&#60;br /&#62;
subplot(4, 1, 4);&#60;br /&#62;
plot((0:dy:(Ny-1)*dy).* sensor_data.p_max(Ny/2,:) .* 1e-6, 'k-');&#60;br /&#62;
xlabel('Lateral Position [mm]');&#60;br /&#62;
ylabel('Pressure [MPa]');&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(kgrid.x_vec, kgrid.y_vec,sensor_data.p_max);&#60;br /&#62;
xlabel('x [m]');&#60;br /&#62;
ylabel('y [m]');&#60;br /&#62;
%zlabel('z [m]');&#60;br /&#62;
title('Maximum Pressure');&#60;br /&#62;
c = colorbar;&#60;br /&#62;
c.Label.String = 'pressure()';
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
