<?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; User Favorites: jkiv</title>
		<link><a href='http://www.k-wave.org/forum/profile/jkiv'>jkiv</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:34:16 +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/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>jkiv on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-75</link>
			<pubDate>Thu, 14 Oct 2010 17:03:05 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">75@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Using a single value behaves as one would expect: there is no ghosting; attenuation is high with a high &#60;code&#62;alpha_coeff&#60;/code&#62;, low with a low one; etc.&#60;/p&#62;
&#60;p&#62;I'm not too cozy with the math, so I wouldn't be able to figure out what is needed to have heterogeneous &#60;code&#62;alpha_coeff&#60;/code&#62;.  So I'm eager to see this addressed in the a future version.  Hopefully it won't affect the algorithm too much as I've reimplemented the time-loop in CUDA and it's highly orchestrated (ie, a lot of my kernels are written for partial steps in calculations, storing results in then-unused memory spaces to avoid allocating &#60;em&#62;any&#60;/em&#62; more memory than I need, etc.)&#60;/p&#62;
&#60;p&#62;Anyway, I'll keep you updated on anything else I run in to.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Jon
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-74</link>
			<pubDate>Thu, 14 Oct 2010 11:54:21 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">74@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Jon,&#60;/p&#62;
&#60;p&#62;Did setting a scalar absorption value sort out your problem?&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jkiv on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-73</link>
			<pubDate>Wed, 13 Oct 2010 15:47:08 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">73@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks Brad,&#60;/p&#62;
&#60;p&#62;This may be the source of my confusion.  I'll see if I can find an appropriate scalar value to use.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jkiv on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-72</link>
			<pubDate>Wed, 13 Oct 2010 15:35:58 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">72@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Here's the example: &#60;a href=&#34;https://gist.github.com/dc9aa9351ec1997c8321&#34;&#62;https://gist.github.com/dc9aa9351ec1997c8321&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Line 66 (&#60;code&#62;% medium.alpha_coeff(PML_mask == 1) = 0; % [dB/(MHz^y cm)]&#60;/code&#62;), if uncommented, sets the &#60;code&#62;medium.alpha_coeff = 0&#60;/code&#62; in the PML.&#60;/p&#62;
&#60;p&#62;In order to see the effects I plot the log of the pressure in &#60;code&#62;kspaceFirstOrder2D.m&#60;/code&#62;:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;br /&#62;
p_plot = 20*log10(abs(p_plot));&#60;br /&#62;
plot_scale = [-30 0];&#60;br /&#62;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#60;/p&#62;
&#60;p&#62;% update plot&#60;br /&#62;
imagesc(kgrid.x(1,:)*scale, kgrid.z(:,1)*scale, p_plot, plot_scale);&#60;br /&#62;
colormap(COLOR_MAP);&#60;br /&#62;
ylabel(['z-position [' prefix 'm]']);&#60;br /&#62;
xlabel(['x-position [' prefix 'm]']);&#60;br /&#62;
axis image;&#60;br /&#62;
drawnow;&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;Also let me know what you think about the maximum pressure over both.  If the high &#60;code&#62;&#60;/code&#62;alpha_coeff` is in the PML, there is a lot of attenuation in the entire system:&#60;br /&#62;
&#60;img src=&#34;http://imgur.com/JvV5d.png&#34; alt=&#34;&#34; /&#62;&#60;/p&#62;
&#60;p&#62;If it is 0 in the PML there is very little attenuation:&#60;br /&#62;
&#60;img src=&#34;http://imgur.com/Xf2Bz.png&#34; alt=&#34;&#34; /&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-71</link>
			<pubDate>Wed, 13 Oct 2010 14:47:12 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">71@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Jon,&#60;/p&#62;
&#60;p&#62;The current release of the toolbox (B.0.2) was coded assuming scalar values of the absorption coefficients (so these are not expanded when &#60;code&#62;PMLInside&#60;/code&#62; is set to &#60;code&#62;false&#60;/code&#62;). We are currently working on a new release so will take a look into what problems using heterogeneous absorption values creates. In the meantime, perhaps using a single value of absorption will be sufficient for you to move forward in your simulations?&#60;/p&#62;
&#60;p&#62;Thanks for letting us know the issues you are encountering,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jkiv on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-70</link>
			<pubDate>Wed, 13 Oct 2010 14:19:33 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">70@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hey Ben,&#60;/p&#62;
&#60;p&#62;I tried &#60;code&#62;PMLInside&#60;/code&#62; to find it fails:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
Running k-space simulation...&#60;br /&#62;
  dt: 7.5ns, t_end: 41.97us, time steps: 5597&#60;br /&#62;
  input grid size: 216 by 984 pixels (13.5 by 61.5mm)&#60;br /&#62;
  maximum supported frequency: 12MHz&#60;br /&#62;
  expanding computational grid...&#60;br /&#62;
  expanding sound speed grid...&#60;br /&#62;
  expanding density grid...&#60;br /&#62;
  computational grid size: 256 by 1024 pixels&#60;br /&#62;
  smoothing sound speed distribution...&#60;br /&#62;
  smoothing density distribution...&#60;br /&#62;
??? Error using ==&#38;gt; times&#60;br /&#62;
Matrix dimensions must agree.&#60;/p&#62;
&#60;p&#62;Error in ==&#38;gt; kspaceFirstOrder2D at 827&#60;br /&#62;
    absorb_param = absorb_tau.*absorb_nabla1.*rho0;&#60;/p&#62;
&#60;p&#62;Error in ==&#38;gt; test_PML at 161&#60;br /&#62;
    [sensor_data, p_final] = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;This happens because &#60;code&#62;absorb_nabla1&#60;/code&#62; and &#60;code&#62;rho0&#60;/code&#62; are 1024x256 whereas &#60;code&#62;absorb_tau&#60;/code&#62; is 984x216.&#60;/p&#62;
&#60;p&#62;The same error occurs when I alter &#60;code&#62;example_na_controlling_the_pml.m&#60;/code&#62; setting &#60;code&#62;example_number = 3&#60;/code&#62; and adding a &#60;code&#62;medium.alpha_coeff&#60;/code&#62; and &#60;code&#62;medium.alpha_power&#60;/code&#62; (specifically &#60;code&#62;medium.alpha_coeff = 2*ones(Nz,Nx)&#60;/code&#62; and &#60;code&#62;medium.alpha_power = 1.15&#60;/code&#62;.)&#60;/p&#62;
&#60;p&#62;Either way, I will eventually be doing 3D.  I've only been doing 2D because I get NaNs when I run a 3D version of what I described in the first post.  I'll clean up the &#60;code&#62;.m&#60;/code&#62; I'm using and post it later today to see if anyone can reproduce what I'm seeing.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-68</link>
			<pubDate>Tue, 12 Oct 2010 23:02:44 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">68@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Jon,&#60;/p&#62;
&#60;p&#62;Thanks for using k-Wave. Do you get the same thing if you set the PML to be outside the domain of interest, ie. setting 'PMLInside' to false when calling kspaceFirstOrder2D? &#60;/p&#62;
&#60;p&#62;Just so I can replicate your example, what sort of source/initial condition are you using?&#60;/p&#62;
&#60;p&#62;With regard to the optimal PML conditions, we've not done a systematic study of the ideal PML settings but have set defaults that we found worked for most cases. k-Wave ramps the absorption within the PML with the curve of the form ((x-x0)/(xmax-x0))^4, where x0 is the inside edge of the PML and xmax the outer edge. This is suggested by Tabei, M., T. D. Mast, et al., J. Acoust. Soc. Am., 111(1), 53-63, (2002), the paper which the earliest versions of k-Wave were derived from. Designing PMLs that guarantee a certain level of reduction for a given incident wave sounds like an interesting project, but not one we've done yet, I'm afraid.&#60;/p&#62;
&#60;p&#62;Ben&#60;/p&#62;
&#60;p&#62;PS. For newcomers reading this, see &#60;a href=&#34;http://www.k-wave.org/documentation/example_na_controlling_the_pml.php&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org/documentation/example_na_controlling_the_pml.php&#60;/a&#62; for an intro to the PML.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jkiv on "Optimizing PML effectiveness"</title>
			<link>http://www.k-wave.org/forum/topic/optimizing-pml-effectiveness#post-66</link>
			<pubDate>Tue, 12 Oct 2010 19:10:15 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">66@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Good day,&#60;/p&#62;
&#60;p&#62;I'm a student using k-Wave to simulate propagation for high intensity focused ultrasound (HIFU).  I'm currently having some issues dealing with the PML.&#60;/p&#62;
&#60;p&#62;I've been defining my heterogeneous material without thought of the PML.  That is, if the top half of my system is material A and the bottom is material B, I make all of the top material A and all of the bottom material B including the area where the PML lies.  However, if a material with a high &#60;code&#62;alpha_coeff&#60;/code&#62; (eg. 2.43 dB/MHz-cm) lies within the PML we get unusual artifacts.  Here's an example, where &#60;code&#62;PMLSize&#60;/code&#62; is 20 pixels, &#60;code&#62;PMLAlpha&#60;/code&#62; is 4 Np/(rad/s-m), and &#60;code&#62;alpha_power&#60;/code&#62; is 1.15.&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://imgur.com/tro7w.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://imgur.com/RxV4V.png&#34; /&#62;&#60;br /&#62;
(Note: the image above is a plot of the log10 of the pressure)&#60;/p&#62;
&#60;p&#62;If I set the medium's &#60;code&#62;alpha_coeff&#60;/code&#62; in the PML to a small value (eg. 0.2 dB/MHz-cm) , the effect is diminished.  Trying an &#60;code&#62;alpha_coeff = 0&#60;/code&#62; in the PML leaves only a minimal effect:&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://imgur.com/fXOTO.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://imgur.com/xsOsm.png&#34; /&#62;&#60;br /&#62;
(Note: the image above is a plot of the log10 of the pressure)&#60;/p&#62;
&#60;p&#62;This leads me to my first question: why might this be happening?  Is this a bug, a consequence of my setup, or a consequence of the methods being used?&#60;/p&#62;
&#60;p&#62;My second question is more general that the documentation does not address directly.  How does one set up their PML optimally?  Given my material, my source frequency, etc, how might it be possible to automate the setup of the PML properties such that a sufficient amount of the propagation is absorbed?&#60;/p&#62;
&#60;p&#62;Thanks in advance,&#60;br /&#62;
Jon
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "3D case with non-equal dimensions fails to run?"</title>
			<link>http://www.k-wave.org/forum/topic/3d-case-with-non-equal-dimensions-fails-to-run#post-63</link>
			<pubDate>Wed, 22 Sep 2010 18:42:04 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">63@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi jkiv,&#60;/p&#62;
&#60;p&#62;Thanks for your feedback, I'm glad you got your example to run. Please let us know if you have any more questions.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jkiv on "3D case with non-equal dimensions fails to run?"</title>
			<link>http://www.k-wave.org/forum/topic/3d-case-with-non-equal-dimensions-fails-to-run#post-62</link>
			<pubDate>Wed, 22 Sep 2010 17:21:20 +0000</pubDate>
			<dc:creator>jkiv</dc:creator>
			<guid isPermaLink="false">62@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Good day,&#60;/p&#62;
&#60;p&#62;I'm trying to run a 3D example whose dimensions are non-equal.  I'm trying 64x32x16 but during sound-speed/density smoothing the following term fails (in smooth.m):&#60;/p&#62;
&#60;p&#62;&#60;code&#62;f_sm = abs(ifftn(fftshift(fftshift(fftn(f)).*Hann_filt)));&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The issue is &#60;code&#62;Hann_filt&#60;/code&#62; is 16x64x32 whereas &#60;code&#62;f&#60;/code&#62; is 64x32x16 and thus the &#60;code&#62;.*&#60;/code&#62; fails.&#60;/p&#62;
&#60;p&#62;I might be setting up my data wrong and I'd like assurance from the developers that smooth.m is correct for the 3D case.  This is how I'm setting up my data:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% physical dimensions
X = 1e-2; % m
Y = X;
Z = X;

% resolution
Nx = 64;  % points
Ny = 32;
Nz = 16;

% dimensions per pixel
dx = X/Nx;
dy = Y/Ny;
dz = Z/Nz;

kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and my c, rho, etc. are made to be 64x32x16 (e.g. &#60;code&#62;1500*ones(64,32,16)&#60;/code&#62;).&#60;/p&#62;
&#60;p&#62;Any ideas?&#60;br /&#62;
Thanks in advance!&#60;/p&#62;
&#60;p&#62;EDIT: I re-visited the provided examples for 3D (which I originally dismissed because they were equal dimensions) and the c, rho, etc. are made with &#60;code&#62;Nz x Nx x Ny&#60;/code&#62; and not &#60;code&#62;Nx x Ny x Nz&#60;/code&#62;.  I've done the same and it remedied the situation.  Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
