<?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: Functionality of varying pressure sources</title>
		<link>http://www.k-wave.org/forum/topic/functionality-of-varying-pressure-sources</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 18:29: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/functionality-of-varying-pressure-sources" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Functionality of varying pressure sources"</title>
			<link>http://www.k-wave.org/forum/topic/functionality-of-varying-pressure-sources#post-6452</link>
			<pubDate>Sun, 13 May 2018 19:45:55 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6452@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brifa,&#60;/p&#62;
&#60;p&#62;Aside from the first time point, it seems that most of the source is close to zero. For example, run:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;figure; imagesc(source.p(:, 2:end)); colorbar;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Is that what you intended?&#60;/p&#62;
&#60;p&#62;With this in mind, you are essentially modelling an initial value problem with a time varying source. To do this correctly, you need to duplicate the source point (so there are two clicks in time, which sets the initial particle velocity to zero), and reverse the source scaling (equal to the CFL) that is applied for time varying sources. This scaling is correct for when the source has a large number of non-zero points, e.g., a tone-burst or CW signal. &#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Brifa on "Functionality of varying pressure sources"</title>
			<link>http://www.k-wave.org/forum/topic/functionality-of-varying-pressure-sources#post-6430</link>
			<pubDate>Fri, 20 Apr 2018 11:41:38 +0000</pubDate>
			<dc:creator>Brifa</dc:creator>
			<guid isPermaLink="false">6430@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thanks for this helpful comment. But then I don't understand, why my code doesn't work.&#60;/p&#62;
&#60;p&#62;I have a rectangular region of 100 nm in a gold sample. In this region the pressure should start at 0.5 and increase exponantially within a time constant of 5 ps to a saturation value of 1.&#60;br /&#62;
I think my code should give this, but there are several things which I don't understand.&#60;/p&#62;
&#60;p&#62;(i) The initial pressure isn't 0.5, but something around 0.036 even though the first column values in the source.p variable are 0.5.&#60;br /&#62;
(ii) The pressure doesn't increase to twice the starting value, even though the exp-function should provide that.  &#60;/p&#62;
&#60;p&#62;Here is my code&#60;/p&#62;
&#60;p&#62;%% create the computational grid&#60;br /&#62;
Nx = 8000;&#60;br /&#62;
dx = 1e-10;&#60;br /&#62;
kgrid = kWaveGrid(Nx,dx);&#60;/p&#62;
&#60;p&#62;%% define the properties of the propagation medium&#60;/p&#62;
&#60;p&#62;medium.sound_speed = 3390 * ones(Nx,1);&#60;br /&#62;
medium.density = 19300 * ones(Nx,1);&#60;br /&#62;
gamma_ratio = 0.5;                  % ratio of the Grüneisen parameters&#60;br /&#62;
tau = 5e-12;                        % time constant of exponential growth&#60;/p&#62;
&#60;p&#62;%% define the time array&#60;br /&#62;
t_end = 100e-12;&#60;br /&#62;
kgrid.t_array = 0:1e-15:t_end;&#60;/p&#62;
&#60;p&#62;%% initial pressure distribution&#60;br /&#62;
source.p_mask =zeros(Nx,1);&#60;br /&#62;
source.p_mask(1501:2500) = 1;       % create the 100 nm region&#60;/p&#62;
&#60;p&#62;TimeVector = kgrid.t_array;&#60;br /&#62;
TimeEFun = (1+(gamma_ratio-1)*exp(-TimeVector/tau));   % definition of the exp-Fkt&#60;br /&#62;
dTimeEFun = diff(TimeEFun);     % calculate the difference for adding at later t&#60;/p&#62;
&#60;p&#62;source.p = zeros (1000, size(TimeVector,2));&#60;br /&#62;
source.p(:,1) = (1+(gamma_ratio-1));    % assign starting value&#60;/p&#62;
&#60;p&#62;for i = 1:1000                          % assign values for later t&#60;br /&#62;
    source.p(i,2:end) = source.p(i,1)*dTimeEFun;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;sensor.mask = zeros(Nx,1);&#60;br /&#62;
sensor.mask(5000:7500) = 1;&#60;/p&#62;
&#60;p&#62;%% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder1D(kgrid, medium, source, sensor, 'PlotLayout', true);&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Brifa
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Functionality of varying pressure sources"</title>
			<link>http://www.k-wave.org/forum/topic/functionality-of-varying-pressure-sources#post-6405</link>
			<pubDate>Wed, 11 Apr 2018 09:19:35 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6405@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brifa,&#60;/p&#62;
&#60;p&#62;Yes, this is exactly how it works. The lines of code looks like this (the source is actually implemented as mass source, so added to the acoustic density):&#60;/p&#62;
&#60;p&#62;&#60;code&#62;rhox(p_source_pos_index) = rhox(p_source_pos_index) + source.p(p_source_sig_index, t_index);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Brifa on "Functionality of varying pressure sources"</title>
			<link>http://www.k-wave.org/forum/topic/functionality-of-varying-pressure-sources#post-6404</link>
			<pubDate>Tue, 10 Apr 2018 14:37:21 +0000</pubDate>
			<dc:creator>Brifa</dc:creator>
			<guid isPermaLink="false">6404@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I have a question regarding the functionality of the time varying pressure source. In my specific code, I have a thin film, where the acoustic waves become reflected and therefore interfere with the time varying source. I am not sure, if I implement it correctly.&#60;/p&#62;
&#60;p&#62;Consider, I define a time dependent pressure source P(t) at one point. I assign a pressure value for a time point t_i which is not the first one. &#60;/p&#62;
&#60;p&#62;When the simulation comes to this time now, does it add the value P(t_i) to the pressure value at this point and time in the simulation?&#60;/p&#62;
&#60;p&#62;Thanks for your help!&#60;br /&#62;
Best regards,&#60;br /&#62;
Brifa
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
