<?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: Sources definition</title>
		<link>http://www.k-wave.org/forum/topic/sources-definition</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 15:48:37 +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/sources-definition" rel="self" type="application/rss+xml" />

		<item>
			<title>fouan on "Sources definition"</title>
			<link>http://www.k-wave.org/forum/topic/sources-definition#post-6119</link>
			<pubDate>Thu, 31 Aug 2017 14:53:53 +0000</pubDate>
			<dc:creator>fouan</dc:creator>
			<guid isPermaLink="false">6119@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you for your answer. Yes it is symetric now with the normal component of the stress.&#60;/p&#62;
&#60;p&#62;Thanks again for your time!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Sources definition"</title>
			<link>http://www.k-wave.org/forum/topic/sources-definition#post-6083</link>
			<pubDate>Wed, 02 Aug 2017 12:21:40 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6083@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Damien,&#60;/p&#62;
&#60;p&#62;Interesting puzzle. I think it's because of the staggered grid used in k-Wave, where the velocity is calculated at staggered points compared to the normal stress. If you instead define the source using the normal components of the stress (&#60;code&#62;source.sxx&#60;/code&#62; and &#60;code&#62;source.syy&#60;/code&#62;) then the output is symmetrical. I can't immediately think of a way around the grid staggering when using a velocity source. &#60;/p&#62;
&#60;p&#62;Regarding coupling, it looks like your source is already in contact with the tube, so in some sense it's already coupled.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fouan on "Sources definition"</title>
			<link>http://www.k-wave.org/forum/topic/sources-definition#post-6053</link>
			<pubDate>Wed, 12 Jul 2017 08:31:35 +0000</pubDate>
			<dc:creator>fouan</dc:creator>
			<guid isPermaLink="false">6053@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, Thank you very much for this code, its really helpfull!&#60;/p&#62;
&#60;p&#62;I have concerns about using it in a specific calculation. The idea is to simulate the propagation of ultrasound at very low frequency (8kHz) inside a tube filled with water. There are two opposite  sources on the side of the tube. Everything is supposed to be symetric here but the two sources behave very differently. How do you exlain the asymmetry in the calculation? Is there something wrong in my code?&#60;/p&#62;
&#60;p&#62;'Nx = 101;           % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 101;           % number of grid points in the y (column) direction&#60;br /&#62;
dx = 0.0005;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.0005;        % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
ray_int=18e-3;   % [m]&#60;/p&#62;
&#60;p&#62;medium.sound_speed_compression = 330*ones(Nx, Ny);         % [m/s]&#60;br /&#62;
medium.sound_speed_compression(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx+3)==1) = 5650;&#60;br /&#62;
medium.sound_speed_compression(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx)==1) = 1480;   &#60;/p&#62;
&#60;p&#62;medium.sound_speed_shear = 0*ones(Nx, Ny);         % [m/s]&#60;br /&#62;
medium.sound_speed_shear(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx+3)==1) = 3100;&#60;br /&#62;
medium.sound_speed_shear(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx)==1) = 0;    &#60;/p&#62;
&#60;p&#62;medium.density = 2*ones(Nx, Ny);         % [kg/m^3]&#60;br /&#62;
medium.density(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx+3)==1) = 8010;&#60;br /&#62;
medium.density(makeDisc(Nx,Ny,(Nx+1)/2,(Ny+1)/2,ray_int/dx)==1) = 1000;    &#60;/p&#62;
&#60;p&#62;% define a curved transducer element&#60;br /&#62;
source.u_mask = zeros(Nx,Ny);&#60;br /&#62;
source.u_mask((Nx+1)/2-20:(Nx+1)/2+20,(Nx+1)/2-ray_int/dx-2)=1;% create the time array&#60;br /&#62;
source.u_mask((Nx+1)/2-20:(Nx+1)/2+20,(Nx+1)/2+ray_int/dx+2)=1;% create the time array&#60;br /&#62;
% source.u_mask((Nx+1)/2-20:(Nx+1)/2+20,(Nx+1)/2-ray_int/dx-2)=1;% create the time array&#60;br /&#62;
% source.u_mask((Nx+1)/2-20:(Nx+1)/2+20,(Nx+1)/2+ray_int/dx+1)=1;% create the time array&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal source&#60;br /&#62;
source_freq1 = 8e3;       % [Hz]&#60;br /&#62;
source_freq2 = 8e3;       % [Hz]&#60;br /&#62;
source_mag = 0.03&#60;br /&#62;
t_end=1/source_freq2;&#60;br /&#62;
% create the time array&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, 16000, [], t_end);&#60;br /&#62;
signal_uy_plus = source_mag*sin(2*pi*source_freq1*kgrid.t_array);&#60;br /&#62;
signal_uy_moins = -source_mag*sin(2*pi*source_freq2*kgrid.t_array);&#60;br /&#62;
% filter the source to remove any high frequencies not supported by the grid&#60;br /&#62;
source.uy = [repmat(filterTimeSeries(kgrid, medium, signal_uy_plus),41,1);repmat(filterTimeSeries(kgrid, medium, signal_uy_moins),41,1)];&#60;br /&#62;
display_mask = source.u_mask;&#60;/p&#62;
&#60;p&#62;% define a centered circular sensor&#60;br /&#62;
% create a sensor mask covering the entire computational domain using the&#60;br /&#62;
% opposing corners of a rectangle&#60;br /&#62;
Pos_x=(Nx+1)/2;&#60;br /&#62;
Pos_y=(Ny+1)/2;&#60;br /&#62;
sensor.mask = zeros(Nx,Ny);&#60;br /&#62;
sensor.mask (Pos_x, :)=1;&#60;br /&#62;
sensor.mask (:,Pos_y)=1;&#60;/p&#62;
&#60;p&#62;sensor.record={'p'};&#60;br /&#62;
input_args = {'DisplayMask', display_mask, 'PMLInside', false, 'PlotPML', false,'PlotScale', [-100e3,100e3,-100e3,100e3],};&#60;br /&#62;
sensor_data = pstdElastic2D(kgrid, medium, source, sensor, input_args{:});'&#60;/p&#62;
&#60;p&#62;I supposed the definition of the sources is not correct. By changing the location of the sources (commented lines), the results are slightly more symetric..&#60;br /&#62;
Subsidiary question: Would it be better with a coupling between sources and tube?&#60;br /&#62;
Thank you in advance.&#60;/p&#62;
&#60;p&#62;Damien
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
