<?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: Reflection From Boundary</title>
		<link>http://www.k-wave.org/forum/topic/reflection-from-boundary</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 14:55:36 +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/reflection-from-boundary" rel="self" type="application/rss+xml" />

		<item>
			<title>sedy_shes on "Reflection From Boundary"</title>
			<link>http://www.k-wave.org/forum/topic/reflection-from-boundary#post-6791</link>
			<pubDate>Mon, 18 Mar 2019 20:41:54 +0000</pubDate>
			<dc:creator>sedy_shes</dc:creator>
			<guid isPermaLink="false">6791@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you Brad.&#60;br /&#62;
That makes a lot of sense for me now.&#60;/p&#62;
&#60;p&#62;Best,&#60;br /&#62;
Sedy.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Reflection From Boundary"</title>
			<link>http://www.k-wave.org/forum/topic/reflection-from-boundary#post-6780</link>
			<pubDate>Sun, 17 Mar 2019 22:30:49 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6780@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Sedy,&#60;/p&#62;
&#60;p&#62;The performance of the PML depends on the frequency of incoming waves. So if you reduce the frequency of the source (or decrease the grid spacing), things should improve. I noticed that your source is essentially a step with a value of -2 lasting for 150 microseconds:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;figure; plot(1e6 * kgrid.t_array(1:length(source.ux)), source.ux);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Is that what you intended? The sharp jumps at the beginning and end of the time trace will generate high frequencies and these won't be properly absorbed by the PML as mentioned above. If you use a smoother signal, things will improve.&#60;/p&#62;
&#60;p&#62;A note to be careful when using the automatic plot scale, as when the waves have left from the domain, you will always see reflections and wave wrapping from the PML, even if the values are very small.&#60;/p&#62;
&#60;p&#62;Finally, if all else fails and you want to improve PML performance, you can try increasing the thickness.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sedy_shes on "Reflection From Boundary"</title>
			<link>http://www.k-wave.org/forum/topic/reflection-from-boundary#post-6755</link>
			<pubDate>Mon, 11 Feb 2019 22:57:51 +0000</pubDate>
			<dc:creator>sedy_shes</dc:creator>
			<guid isPermaLink="false">6755@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;br /&#62;
Thanks for the useful toolbox.&#60;/p&#62;
&#60;p&#62;I guess it is a really basic question, but I've always had the reflection problems since I started to learn K-wave, although I have read some examples provided in the website and tried to follow what is usually done for applying PML. Here is a sample code.&#60;br /&#62;
We see all the reflection in the normal stress,for example, after running the code.&#60;br /&#62;
I really appreciate your guidance in advance.&#60;br /&#62;
Best,&#60;br /&#62;
Sedy&#60;/p&#62;
&#60;p&#62;%---------------------------------------&#60;br /&#62;
clearvars;&#60;/p&#62;
&#60;p&#62;PML_size = 20;          % [grid points]&#60;br /&#62;
Nx = 168 - 2*PML_size;  % [grid points]&#60;br /&#62;
Ny = 168 - 2*PML_size;  % [grid points]&#60;/p&#62;
&#60;p&#62;dx = 0.1e-4;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.1e-4;        % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed_compression = 10;  % [m/s]&#60;br /&#62;
medium.sound_speed_shear       = 3.5;  % [m/s]&#60;br /&#62;
medium.density                 = 1000;  % [kg/m^3] &#60;/p&#62;
&#60;p&#62;% define the absorption properties&#60;br /&#62;
medium.alpha_coeff_compression = 0.03; % [dB/(MHz^2 cm)]&#60;br /&#62;
medium.alpha_coeff_shear       = 0.999; % [dB/(MHz^2 cm)] &#60;/p&#62;
&#60;p&#62;% define a single source point&#60;br /&#62;
source.u_mask = zeros(Nx, Ny);&#60;br /&#62;
% source.u_mask(5, Ny/2) = 1;&#60;br /&#62;
source.u_mask(1:Nx/2, Ny/2-10:Ny/2+11) = 1;&#60;/p&#62;
&#60;p&#62;% Defining Guassian source&#60;br /&#62;
sig= 5e-4;&#60;br /&#62;
xx= kgrid.y_vec(Ny/2-10:Ny/2+11)';&#60;br /&#62;
FGaus =zeros(Nx/2,Ny/2+11-(Ny/2-10)+1);&#60;br /&#62;
FGaus=repmat((-1/2/sig^2)*exp(-(xx./(2*sig)).^2),Nx/2,1);&#60;br /&#62;
% FGaus(:,Ny/2-10:Ny/2+10)=repmat((-1/2/sig^2)*exp(-(xx./(2*sig)).^2),Nx,1)&#60;/p&#62;
&#60;p&#62;ux_F = FGaus.*kgrid.dx./medium.sound_speed_compression;&#60;br /&#62;
ux=reshape(ux_F,[],1);&#60;br /&#62;
source.ux=ux;&#60;/p&#62;
&#60;p&#62;sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
% sensor.mask(Nx/2-10:Nx/2+10, Ny/2) = 1;&#60;br /&#62;
sensor.mask(Nx/2, Ny/2-40:Ny/2+40) = 1;&#60;br /&#62;
% sensor.mask(pos2, Ny/2) = 1;&#60;br /&#62;
sensor.record = {'u','p',};&#60;/p&#62;
&#60;p&#62;% set the CFL&#60;br /&#62;
cfl = 0.1;&#60;/p&#62;
&#60;p&#62;% define the properties of the PML to allow plane wave propagation&#60;br /&#62;
pml_alpha = 2;&#60;br /&#62;
% pml_size  = [10, 2];&#60;/p&#62;
&#60;p&#62;% set the input arguments&#60;br /&#62;
% input_args = {'PlotScale', 'auto', 'PMLSize', pml_size,...&#60;br /&#62;
%     'PMLAlpha', pml_alpha, 'PlotPML', false,'PMLInside',false};&#60;br /&#62;
input_args = {'PlotScale', 'auto','PlotPML', false,'Smooth',true...&#60;br /&#62;
    'PMLInside',false,'PMLAlpha', pml_alpha, 'RecordMovie',true,'DataCast', 'single'};&#60;/p&#62;
&#60;p&#62;% set end time&#60;br /&#62;
t_end = 0.3e-3;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.makeTime(max(medium.sound_speed_compression, medium.sound_speed_shear), cfl, t_end);&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = pstdElastic2D(kgrid, medium, source, sensor, input_args{:});&#60;br /&#62;
sensor_data_reordered.p = reorderSensorData(kgrid, sensor, sensor_data.p);&#60;br /&#62;
sensor_data_reordered.ux = reorderSensorData(kgrid, sensor, sensor_data.ux);&#60;br /&#62;
sensor_data_reordered.uy = reorderSensorData(kgrid, sensor, sensor_data.uy);&#60;br /&#62;
%&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(sensor_data_reordered.p,[-2000,2000]);&#60;br /&#62;
colormap(getColorMap);&#60;br /&#62;
ylabel('Sensor Position');&#60;br /&#62;
xlabel('Time Step');&#60;br /&#62;
colorbar;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
