<?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: Ultrasound heating does not work in a heteregeneous</title>
		<link>http://www.k-wave.org/forum/topic/ultrasound-heating-does-not-work-in-a-heteregeneous</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 08:27:01 +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/ultrasound-heating-does-not-work-in-a-heteregeneous" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Ultrasound heating does not work in a heteregeneous"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-heating-does-not-work-in-a-heteregeneous#post-7559</link>
			<pubDate>Sat, 06 Jun 2020 14:38:28 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7559@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi hamram,&#60;/p&#62;
&#60;p&#62;I would instead start with defining your desired PPW, and then use this to calculate the required grid spacing &#60;code&#62;dx&#60;/code&#62; based on the same formula and a reference sound speed (e.g., the sound speed in the background).&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hamram on "Ultrasound heating does not work in a heteregeneous"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-heating-does-not-work-in-a-heteregeneous#post-7523</link>
			<pubDate>Fri, 22 May 2020 06:06:20 +0000</pubDate>
			<dc:creator>hamram</dc:creator>
			<guid isPermaLink="false">7523@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I am trying to get the heating by ultrasound example working but in a 2D heterogeneous medium., but it does not work. I think the problem is that defining time arrey  (kgrid.setTime) depends on Nt and dt and they also depend on ppp which is a matrix and not a single integer anymore. Is there a way to fix this? I appreciate any hint. Here is the code I use but does not work:&#60;/p&#62;
&#60;p&#62;clearvars;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% ACOUSTIC SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define the PML size&#60;br /&#62;
pml_size = 20;              % [grid points]&#60;/p&#62;
&#60;p&#62;% define the grid parameters&#60;br /&#62;
Nx = 256 - 2 * pml_size;    % [grid points]&#60;br /&#62;
Ny = 256 - 2 * pml_size;    % [grid points]&#60;br /&#62;
dx = 0.25e-3;               % [m]&#60;br /&#62;
dy = 0.25e-3;               % [m]&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;/p&#62;
&#60;p&#62;medium.alpha_coeff = 0.75;  % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;/p&#62;
&#60;p&#62;medium.sound_speed = 1500 * ones(Nx, Ny);   % [m/s]&#60;br /&#62;
medium.sound_speed(1:Nx/2, :) = 1800;       % [m/s]&#60;br /&#62;
medium.density = 1000 * ones(Nx, Ny);       % [kg/m^3]&#60;br /&#62;
medium.density(:, Ny/4:Ny) = 1200;          % [kg/m^3]&#60;/p&#62;
&#60;p&#62;% define the source parameters&#60;br /&#62;
diameter = 45e-3;           % [m]&#60;br /&#62;
radius   = 35e-3;           % [m]&#60;br /&#62;
freq     = 1e6;             % [Hz]&#60;br /&#62;
amp      = 0.5e6;           % [Pa]&#60;/p&#62;
&#60;p&#62;% define a focused ultrasound transducer&#60;br /&#62;
source.p_mask = makeArc([Nx, Ny], [1, Ny/2], round(radius / dx), round(diameter / dx) + 1, [Nx/2, Ny/2]);&#60;/p&#62;
&#60;p&#62;% calculate the time step using an integer number of points per period&#60;br /&#62;
ppw = medium.sound_speed / (freq * dx); % points per wavelength&#60;br /&#62;
cfl = 0.3;                              % cfl number&#60;br /&#62;
ppp = ceil(ppw / cfl);                  % points per period&#60;br /&#62;
T   = 1 / freq;                         % period [s]&#60;br /&#62;
dt  = T / ppp;                          % time step [s]&#60;/p&#62;
&#60;p&#62;% calculate the number of time steps to reach steady state&#60;br /&#62;
t_end = sqrt( kgrid.x_size.^2 + kgrid.y_size.^2 ) / medium.sound_speed;&#60;br /&#62;
Nt = round(t_end / dt);&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.setTime(Nt, dt);&#60;/p&#62;
&#60;p&#62;% define the input signal&#60;br /&#62;
source.p = createCWSignals(kgrid.t_array, freq, amp, 0);&#60;/p&#62;
&#60;p&#62;% set the sensor mask to cover the entire grid&#60;br /&#62;
sensor.mask = ones(Nx, Ny);&#60;br /&#62;
sensor.record = {'p', 'p_max_all'};&#60;/p&#62;
&#60;p&#62;% record the last 3 cycles in steady state&#60;br /&#62;
num_periods = 3;&#60;br /&#62;
T_points = round(num_periods * T / kgrid.dt);&#60;br /&#62;
sensor.record_start_index = Nt - T_points + 1;&#60;/p&#62;
&#60;p&#62;% set the input arguements&#60;br /&#62;
input_args = {'PMLInside', false, 'PlotPML', false, 'DisplayMask', ...&#60;br /&#62;
    'off', 'PlotScale', [-1, 1] * amp};&#60;/p&#62;
&#60;p&#62;% run the acoustic simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
