<?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: simulating power low absorption</title>
		<link>http://www.k-wave.org/forum/topic/simulating-power-low-absorption</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:47:47 +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/simulating-power-low-absorption" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "simulating power low absorption"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-power-low-absorption#post-6316</link>
			<pubDate>Tue, 06 Mar 2018 23:46:07 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6316@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Benji,&#60;/p&#62;
&#60;p&#62;The problem is that for large absorption values, the theoretical absorption given by the fractional Laplacian wave equation (which k-Wave solves) isn't exactly given by a0*f^y. To account for this, you can select different values for &#60;code&#62;alpha_coeff&#60;/code&#62; and &#60;code&#62;alpha_power&#60;/code&#62; to give you the desired behaviour using the function &#60;code&#62;fitPowerLawParams&#60;/code&#62;. There are some details of this towards the end of Sec. II.D of &#60;a href=&#34;http://bug.medphys.ucl.ac.uk/papers/2014-Treeby-JASA.pdf&#34;&#62;this paper&#60;/a&#62;. If you account for this, it will give much better agreement. See below for a slightly modified version of your script.&#60;/p&#62;
&#60;p&#62;As an aside, if you want to get precise amplitude values from the simulation, a better way would be to define the time step to give an integer number of points per period, only record for the last few periods, and then get the amplitude using &#60;code&#62;extractAmpPhase&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Brad.&#60;/p&#62;
&#60;p&#62;---&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clearvars

% define absorption properties
a0_1 = 1;
a0_2 = 10;
y    = 1.1;

% define other medium properties
medium.sound_speed = 1624;
medium.density     = 1109;

% define grid
Nx = 100;
Ny = 32;
Nz = 32;
dx = 1e-3;
dy = 1e-3;
dz = 1e-3;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);

% define time array to use an integer number of points per period
t_end = 8e-5;
kgrid.makeTime(medium.sound_speed, [], t_end);

% define source and sensor mask
pos1 = 20;
pos2 = 80;
source.p_mask = zeros(Nx, Ny, Nz);
source.p_mask(pos1, Ny/2, Nz/2) = 1;
sensor.mask = zeros(Nx, Ny, Nz);
sensor.mask(pos2, Ny/2, Nz/2) = 1;

% define driving signal
f0 = 200e3;
source.p = 20*sin(2*pi*f0*kgrid.t_array);
source.p = filterTimeSeries(kgrid, medium, source.p);

% define input args
input_args = {&#38;#39;DisplayMask&#38;#39;, source.p_mask, &#38;#39;DataCast&#38;#39;, &#38;#39;single&#38;#39;};

% compute modified absorption parameters
f_min = 50e3;
f_max = 500e3;
plot_fit = true;
[a0_1_fit, y_1_fit] = fitPowerLawParams(a0_1, y, medium.sound_speed, f_min, f_max, plot_fit);
[a0_2_fit, y_2_fit] = fitPowerLawParams(a0_2, y, medium.sound_speed, f_min, f_max, plot_fit);

% assign absorption properties
medium.alpha_coeff = a0_1_fit;
medium.alpha_power = y_1_fit;

% run simulation
data1 = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});

% assign absorption properties
medium.alpha_coeff = a0_2_fit;
medium.alpha_power = y_2_fit;

% run simulation
data2 = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});

% compare theoretical and numerical absorption values
model_att = 20 * log10(max(data2) / max(data1))
theor_att = -(a0_2 - a0_1) * (f0 * 1e-6) ^ y * (pos2 - pos1) * dx * 1e2&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>benji on "simulating power low absorption"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-power-low-absorption#post-6289</link>
			<pubDate>Sat, 17 Feb 2018 10:45:15 +0000</pubDate>
			<dc:creator>benji</dc:creator>
			<guid isPermaLink="false">6289@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;hi,&#60;br /&#62;
i tryed introducing absorption to my simulation, and noticed results didn't fit expectations in terms of the absotption per length.&#60;br /&#62;
i created this simple simulation in order to examine the absorption modeling:&#60;/p&#62;
&#60;p&#62;clear&#60;/p&#62;
&#60;p&#62;alpha=8;&#60;/p&#62;
&#60;p&#62;Nx=100;&#60;br /&#62;
Ny=100;&#60;br /&#62;
Nz=100;&#60;br /&#62;
medium.alpha_coeff=alpha*ones(Nx,Ny,Nz);&#60;br /&#62;
medium.alpha_power=1.1;&#60;/p&#62;
&#60;p&#62;medium.sound_speed(:,:,:)=1624;&#60;br /&#62;
medium.density(:,:,:)=1109;&#60;/p&#62;
&#60;p&#62;dx =0.001;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy =0.001;        % grid point spacing in the y direction [m]&#60;br /&#62;
dz =0.001;        % grid point spacing in the z direction [m]&#60;/p&#62;
&#60;p&#62;kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed,[],2*10^(-4));&#60;/p&#62;
&#60;p&#62;source.p_mask=zeros(Nx,Ny,Nz);&#60;br /&#62;
source.p_mask(20,40,40)=1;&#60;br /&#62;
sensor.mask=zeros(Nx,Ny,Nz);&#60;br /&#62;
sensor.mask(80,40,40)=1;&#60;/p&#62;
&#60;p&#62;f0=200000;&#60;br /&#62;
source.p=20*sin(2*pi*f0*kgrid.t_array);&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p);&#60;/p&#62;
&#60;p&#62;med=medium.sound_speed;&#60;br /&#62;
t=kgrid.t_array;&#60;/p&#62;
&#60;p&#62;sensor.record = {'p', 'p_final'};&#60;/p&#62;
&#60;p&#62;input_args = {'DisplayMask', source.p_mask, 'DataCast', 'single', 'CartInterp', 'nearest'};&#60;/p&#62;
&#60;p&#62;simple_data8=kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;as u can see, the distance between source and sensor is 60*1mm= 6cm and the frequency is 0.2MHz. I ran the simulation with different alpha_coeff values changing from alpha=2 to alpha=12 (alpha power is constantly=1.1).&#60;/p&#62;
&#60;p&#62;Now, i examine the difference between amplitude measured with differnent alpha.&#60;br /&#62;
for example, for alpha=12 and alpha=2, I would expect a difference in power of (12-2)*6cm*0.2^1.1 [dB] = 10.21dB in the recieved signal 6cm from source. In practice, the sensor wave amplitude measured is: h2(amplitude for alpha=2)=0.0151 and h12=0.0329 , which means aan energy loss of 20*log(h12/h2)=6.74dB.&#60;/p&#62;
&#60;p&#62;I tryed the same calculation for a few more alpha values - and it just dosen't make sense...&#60;/p&#62;
&#60;p&#62;Any explatnation for that?&#60;/p&#62;
&#60;p&#62;Benji
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
