<?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: user5137</title>
		<link><a href='http://www.k-wave.org/forum/profile/user5137'>user5137</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 02:31:13 +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>user5137 on "Propagating acoustic wave appears more granular as the size of my grid increases"</title>
			<link>http://www.k-wave.org/forum/topic/propagating-acoustic-wave-appears-more-granular-as-the-size-of-my-grid-increases#post-3775</link>
			<pubDate>Wed, 10 Jul 2013 21:26:47 +0000</pubDate>
			<dc:creator>user5137</dc:creator>
			<guid isPermaLink="false">3775@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you for taking the time to look through this code and establish the source of the error. As I suspected, it was borne out of my ignorance rather than the fault of the toolbox.  Instead of setting the duration of the timestep myself, I've now taken to using the makeTime function and the simulation executes as one would expect. &#60;/p&#62;
&#60;p&#62;A couple of suggestions, while I am here.&#60;/p&#62;
&#60;p&#62;1. Have you considered using stackoverflow rather than a custom forum for these types of questions? I've seen quite a few open source projects moving to this platform and there is a strong community presence.&#60;/p&#62;
&#60;p&#62;2. I've seen others mention using a code repository (e.g. github or bitbucket) so I'd just add my vote as it would make contributing   to the project much easier :)&#60;/p&#62;
&#60;p&#62;Once again, thank you for your input - I'm looking forward to further exploring this toolbox.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Propagating acoustic wave appears more granular as the size of my grid increases"</title>
			<link>http://www.k-wave.org/forum/topic/propagating-acoustic-wave-appears-more-granular-as-the-size-of-my-grid-increases#post-3773</link>
			<pubDate>Wed, 10 Jul 2013 10:34:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">3773@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;The problem is related to the size of the time step. If you set this as dt = CFL * dx / c, where CFL &#38;lt;= 1, this should solve the problem. The CFL (Courant-Friedrichs-Lewy) number can be interpreted as the distance a wave can travel in a single time step relative to the spatial grid spacing. If you use the &#60;code&#62;makeTime&#60;/code&#62; function, the CFL number is set to 0.3 by default.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>user5137 on "Propagating acoustic wave appears more granular as the size of my grid increases"</title>
			<link>http://www.k-wave.org/forum/topic/propagating-acoustic-wave-appears-more-granular-as-the-size-of-my-grid-increases#post-3771</link>
			<pubDate>Mon, 08 Jul 2013 19:38:15 +0000</pubDate>
			<dc:creator>user5137</dc:creator>
			<guid isPermaLink="false">3771@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you for replying so promptly. It's wonderful to see a toolbox so actively developed.&#60;/p&#62;
&#60;p&#62;In answer to your questions, I am using Matlab 2011b (v7.13). I have not set the DataCast parameter - I see in the kspacefirstorder2D function that it is off by default. Also,  I know you didn't ask, but I am using kwave v1.0 (13 Nov 2012 release).&#60;/p&#62;
&#60;p&#62;I have modified my script to make it a little easier to parse, so the simulation will look slightly different to the screenshots posted above, however the effect of changing the grid remains the same. &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clear all;
close all;
close all hidden;

% create the computational grid
Nx = 512;           % number of grid points in the x (row) direction
Ny = 512;           % number of grid points in the y (column) direction
dx = 500e-6/Nx;      	% grid point spacing in the x direction [m]
dy = dx;            % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);

% define the properties of the propagation medium
medium.sound_speed = 1480;  % [m/s]

%define source.
source_frequency = 5e6;
source_mag = 1;

% create the time array
Nt = 250;  % time steps
dt = 1e-9; % size of time step
kgrid.t_array = (1:Nt)*dt;

% remove the detector
sensor.mask = zeros(Nx, Ny);

% angle of line source wrt grid
angle_of_source = pi/4;

length_of_line = Nx;
startpoint = [Nx/2 Ny/2];
source_line = makeLine(Nx, Ny, startpoint, angle_of_source, length_of_line);
source_positions = find(source_line &#38;gt;= 1);

% define a time varying sinusoidal source
source.p = source_mag*sin(2*pi*source_frequency*kgrid.t_array);

% make the source of only 1 cycle
time_for_one_cycle = 1 / source_frequency;
x = (find (kgrid.t_array &#38;gt; time_for_one_cycle));
source.p(x(1):length(kgrid.t_array)) = 0;

% filter the source to remove high frequencies not supported by the grid
 source.p = filterTimeSeries(kgrid, medium, source.p);

% select a source
source.p_mask = zeros(Nx, Ny);
source.p_mask(source_positions) = 1;

% create a display mask to display the transducer
display_mask = source.p_mask + sensor.mask;

% run the simulation with PML turned off
input_args = {&#38;#39;DisplayMask&#38;#39;, display_mask, &#38;#39;PlotScale&#38;#39;, [-0.5 0.5], &#38;#39;PMLAlpha&#38;#39;, [0 0]};

sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I do look forward to resolving this so I can continue to explore the toolbox and thank you in advance for your time :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Propagating acoustic wave appears more granular as the size of my grid increases"</title>
			<link>http://www.k-wave.org/forum/topic/propagating-acoustic-wave-appears-more-granular-as-the-size-of-my-grid-increases#post-3770</link>
			<pubDate>Mon, 08 Jul 2013 14:14:30 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">3770@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I certainly agree it looks a bit suspicious. If you are running a linear simulation in a lossless and homogeneous medium, there shouldn't be any numerical dispersion as the numerical scheme is exact. The fact that it starts to happen after a particular grid size is puzzling. What version of MATLAB are you using, and do have the &#60;code&#62;&#38;#39;DataCast&#38;#39;&#60;/code&#62; parameter set? &#60;/p&#62;
&#60;p&#62;Without seeing your code it's difficult to guess exactly what the problem might be. If you post it here I can check whether I see the same error or spot something wrong with your script.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>user5137 on "Propagating acoustic wave appears more granular as the size of my grid increases"</title>
			<link>http://www.k-wave.org/forum/topic/propagating-acoustic-wave-appears-more-granular-as-the-size-of-my-grid-increases#post-3766</link>
			<pubDate>Fri, 05 Jul 2013 17:00:07 +0000</pubDate>
			<dc:creator>user5137</dc:creator>
			<guid isPermaLink="false">3766@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi there.&#60;/p&#62;
&#60;p&#62;I'm getting started with trying to simulate the propagation of a simple acoustic wave through water. I am in an exploration stage at the moment and the majority of my code is an adaptation of the given examples. I was wondering if you could help me understand the following.&#60;/p&#62;
&#60;p&#62;I have put a line source (with absorbing boundaries switched off) at an angle of pi/4 wrt the grid axes. The grid (which I copied from your example) is as follows&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% create the computational grid
Nx = 256;           % number of grid points in the x (row) direction
Ny = 256;           % number of grid points in the y (column) direction
dx = 500e-6/Nx;      	% grid point spacing in the x direction [m]&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The 'video' playback looks reasonable - I have a screenshot of it here. &#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://i.imgur.com/PvXXv4F.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;When I increase the number of points in the grid the behaviour of the acoustic field becomes less believable. At Nx = Ny &#38;gt; 470 the propagating wave starts off looking more and more granular. By my estimation increasing Nx,Ny should increase the number of points per wavelength. An example where this granularity is quite clear is &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Nx = 512;           % number of grid points in the x (row) direction
Ny = 512;           % number of grid points in the y (column) direction
dx = 500e-6/Nx;      	% grid point spacing in the x direction [m]&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The playback changes to something like&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;http://i.imgur.com/kH85WQu.png&#34; /&#62;&#60;/p&#62;
&#60;p&#62;I expect this issue is borne out of my lack of experience using this toolbox. My question is whether this looks like a familiar error, eg spatial / temporal dispersion?&#60;/p&#62;
&#60;p&#62;The source is a single cycle sinusoid of frequency 5MHz.&#60;/p&#62;
&#60;p&#62;Many thanks,
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
