<?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: Strange display/computation with velocity sources</title>
		<link>http://www.k-wave.org/forum/topic/strange-displaycomputation-with-velocity-sources</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 12:08:51 +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/strange-displaycomputation-with-velocity-sources" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Strange display/computation with velocity sources"</title>
			<link>http://www.k-wave.org/forum/topic/strange-displaycomputation-with-velocity-sources#post-5706</link>
			<pubDate>Wed, 12 Oct 2016 21:24:59 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5706@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi dupond,&#60;/p&#62;
&#60;p&#62;Is this using the unscaled velocity source as the input? Is it a plot scale issue? For example, if you turn off the log scale option and set &#60;code&#62;&#38;#39;PlotScale&#38;#39;, &#38;#39;auto&#38;#39;&#60;/code&#62; (or a suitable range) does it look ok?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dupond on "Strange display/computation with velocity sources"</title>
			<link>http://www.k-wave.org/forum/topic/strange-displaycomputation-with-velocity-sources#post-5704</link>
			<pubDate>Wed, 12 Oct 2016 10:52:05 +0000</pubDate>
			<dc:creator>dupond</dc:creator>
			<guid isPermaLink="false">5704@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi!&#60;/p&#62;
&#60;p&#62;Thank you for your answer! However, my question is more about the fact that the first computation seems to diverge (see my first picture), whereas the final result looks ok. Is it normal?&#60;/p&#62;
&#60;p&#62;Thank you again
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Strange display/computation with velocity sources"</title>
			<link>http://www.k-wave.org/forum/topic/strange-displaycomputation-with-velocity-sources#post-5699</link>
			<pubDate>Thu, 06 Oct 2016 22:28:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5699@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi dupond,&#60;/p&#62;
&#60;p&#62;This is the expected behaviour. In a plane wave, the acoustic pressure and particle velocity are related by the characteristic acoustic impedance of the medium. Thus, if you want to produce approximately the same pressure field using a velocity source instead of a pressure source, then you should scale the velocity source by the acoustic impedance.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>dupond on "Strange display/computation with velocity sources"</title>
			<link>http://www.k-wave.org/forum/topic/strange-displaycomputation-with-velocity-sources#post-5694</link>
			<pubDate>Mon, 03 Oct 2016 10:33:39 +0000</pubDate>
			<dc:creator>dupond</dc:creator>
			<guid isPermaLink="false">5694@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;br /&#62;
I’m basically new with k-wave and I’m trying to figure out how it works. For the moment, I would simply like to simulate the pressure field radiated by a squared-piston. At first, I tried with a pressure source, which seems to work quite well.&#60;br /&#62;
But for the purpose of my study I rather want to use velocity inputs. But when I run the same piece of code with source.ux, the simulation seems to diverge (Picture below)&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://nsa37.casimages.com/img/2016/10/03/161003114709146512.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;If I normalize my input velocity by the acoustic impedance of the medium, let say 1.5e6, the computation seems to go quite well (Picture below)&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://nsa37.casimages.com/img/2016/10/03/16100311450287793.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;What is surprising to me is the fact that the computed pressure at my sensor location is the same in both cases, ignoring the scaling factor (result in the latter case has been multiplied by 1.5e6) (Figure below)&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://nsa38.casimages.com/img/2016/10/03/161003114748605010.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;How is this possible? Is it a display problem? Thank you for your help&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clear all;

f0=1e6;
lambda=1500/f0;

% create the computational grid
dx = 0.1e-3;        % grid point spacing in the x direction [m]
dy = 0.1e-3;        % grid point spacing in the y direction [m]
dz = 0.1e-3;

d_field_x = 10e-3;
d_field_y = 5e-3;
d_field_z = 5e-3;

Nx = 2^nextpow2(ceil(d_field_x/dx));           % number of grid points in the x (row) direction
Ny = 2^nextpow2(ceil(d_field_y/dy));           % number of grid points in the y (column) direction
Nz = 2^nextpow2(ceil(d_field_z/dz));

kgrid = makeGrid(Nx, dx, Ny, dy,Nz,dz);

% define the properties of the propagation medium
medium.sound_speed = 1500*ones(Nx, Ny,Nz); % [m/s]
medium.density     = 1000*ones(Nx, Ny,Nz);     % [kg/m^3]

kgrid.t_array = makeTime(kgrid,medium.sound_speed);

fech=1./kgrid.dt;

% creation of the velocity input
t=0:kgrid.dt:5/f0;
sig=10e-9*sin(2*pi*f0*t);
sig2=[zeros(1,10) sig zeros(1,10)].*blackman(numel([zeros(1,10) sig zeros(1,10)])).&#38;#39;;
vit=diff(sig2)/kgrid.dt; 

source.ux = vit; %case 1
% source.ux = vit/(1.5e6); %case 2
source.u_mask = zeros(Nx,Ny,Nz);
source.u_mask(25,[-2:2]+Ny/2,[-2:2]+Nz/2)=1;

sensor.mask = zeros(Nx,Ny,Nz);
sensor.mask(50,Ny/2,Nz/2) = 1;
sensor.record={&#38;#39;p&#38;#39;};

% define the input arguments
input_args = {&#38;#39;PlotPML&#38;#39;, false, &#38;#39;RecordMovie&#38;#39;, false, &#38;#39;MovieName&#38;#39;, &#38;#39;example_movie_1&#38;#39;, &#38;#39;PlotFreq&#38;#39;, 5, &#38;#39;MovieArgs&#38;#39;, {&#38;#39;fps&#38;#39;, 30},&#38;#39;LogScale&#38;#39;,true,&#38;#39;PlotLayout&#38;#39;,false, &#38;#39;DisplayMask&#38;#39;,sensor.mask};

% run the simulation
pressure=kspaceFirstOrder3D(kgrid, medium, source,sensor, input_args{:});&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
