<?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: finer time and space grids make for more error?</title>
		<link>http://www.k-wave.org/forum/topic/finer-time-and-space-grids-make-for-more-error</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:29:14 +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/finer-time-and-space-grids-make-for-more-error" rel="self" type="application/rss+xml" />

		<item>
			<title>ad000000 on "finer time and space grids make for more error?"</title>
			<link>http://www.k-wave.org/forum/topic/finer-time-and-space-grids-make-for-more-error#post-5940</link>
			<pubDate>Mon, 22 May 2017 21:35:48 +0000</pubDate>
			<dc:creator>ad000000</dc:creator>
			<guid isPermaLink="false">5940@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Solved!  I had two problems:&#60;br /&#62;
The main one was that the sample freq for the wavelet was not what I thought.&#60;br /&#62;
The second was that I did not define kgrid.t_array.  I thought it would do it correctly by default. Maybe not. It worked well when I added:&#60;br /&#62;
 kgrid.t_array = 0:dt:T_END;&#60;/p&#62;
&#60;p&#62;Thanks again,&#60;br /&#62;
Andy
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "finer time and space grids make for more error?"</title>
			<link>http://www.k-wave.org/forum/topic/finer-time-and-space-grids-make-for-more-error#post-5936</link>
			<pubDate>Sun, 21 May 2017 16:07:03 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5936@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;HI ad000000,&#60;/p&#62;
&#60;p&#62;I ran a couple of quick simulations using the sine wave signal (I don't have the wavelet toolbox installed). It seems to look ok at first glance, aside from some minor variations that likely come from the length of the source changing slightly with dx to give an integer number of grid points. Do you notice the behaviour only with the wavelet source, or also with the continuous wave source?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ad000000 on "finer time and space grids make for more error?"</title>
			<link>http://www.k-wave.org/forum/topic/finer-time-and-space-grids-make-for-more-error#post-5922</link>
			<pubDate>Wed, 10 May 2017 21:56:19 +0000</pubDate>
			<dc:creator>ad000000</dc:creator>
			<guid isPermaLink="false">5922@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi.&#60;br /&#62;
The various documentation suggest that decreasing dt and dx will help accuracy. &#60;/p&#62;
&#60;p&#62;I have a 2D water simulation of a strip source (just a 0.3mm line) radiating a pulse of center freq=10MHz.  This should produce a field pattern with a beam half-width of about 30 degrees.  However as I decrease dt or dx, the beam just keeps getting more and more narrow.   I start with grid points per wavelength=7, and dt=0.3*dx/Cwater.&#60;br /&#62;
Thanks!&#60;/p&#62;
&#60;p&#62;code:&#60;br /&#62;
freq=10e6;&#60;br /&#62;
DiscWid=.31e-3;&#60;/p&#62;
&#60;p&#62;xlen=5e-3;&#60;br /&#62;
ylen=7e-3;  %(xdcr axis)&#60;br /&#62;
xdcrloc=.5e-3;&#60;br /&#62;
epw=15;  %points per wavelength&#60;/p&#62;
&#60;p&#62;Cwater = 1500;&#60;br /&#62;
rhoWater=1e3;&#60;/p&#62;
&#60;p&#62;%  setup grid =========================================&#60;br /&#62;
lambda=Cwater/freq;&#60;br /&#62;
dx=lambda/epw;&#60;br /&#62;
dy=dx;&#60;br /&#62;
Nx= ceil(xlen/dx);&#60;br /&#62;
Ny= ceil(ylen/dx);&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;medium.sound_speed=ones(kgrid.Nx, kgrid.Ny)*Cwater;&#60;/p&#62;
&#60;p&#62;medium.density=ones(kgrid.Nx, kgrid.Ny)*rhoWater;&#60;/p&#62;
&#60;p&#62;T_END=7e-3/Cwater;&#60;br /&#62;
dt=.3*dx/(2*Cwater);     %set this velocity for time steps (C should be Cmax)&#60;br /&#62;
kgrid.t_array = 0:dt:T_END;&#60;/p&#62;
&#60;p&#62;%  define source ==========================================&#60;br /&#62;
DiscX1=round((xlen/2-DiscWid/2)/dx);DiscX2=round((xlen/2+DiscWid/2)/dx);&#60;br /&#62;
DiscY=round(xdcrloc/dx);&#60;/p&#62;
&#60;p&#62;source.p_mask = makeLine(Nx, Ny, [DiscX1,DiscY], [DiscX2,DiscY]);&#60;/p&#62;
&#60;p&#62;NoPtsWave=round(4/freq/dt); %make a wavelet pulse.&#60;br /&#62;
signal = wavelet(freq,4,0,0); %,NoPtsWave);&#60;br /&#62;
%signal=sin(2*pi*freq*kgrid.t_array)&#60;br /&#62;
source.p=signal;&#60;/p&#62;
&#60;p&#62;% define receiver  ======================================&#60;br /&#62;
sensor.mask=[1;1;Nx;Ny];&#60;br /&#62;
sensor.record = {'p','p_max'};&#60;br /&#62;
display_mask = source.p_mask;&#60;/p&#62;
&#60;p&#62;% run model&#60;br /&#62;
input_args = {'DisplayMask', display_mask, 'PMLInside', false, 'PlotPML', false,'PlotScale',[-1 1]};&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;%  handle data&#60;br /&#62;
figure;imagesc(kgrid.y_vec, kgrid.x_vec, sensor_data.p_max);% sensor_data.ux_max.^2+sensor_data.uy_max.^2);&#60;br /&#62;
axis equal;grid on&#60;/p&#62;
&#60;p&#62;figure;imagesc(kgrid.y_vec, kgrid.x_vec, squeeze(sensor_data.p(:,:,end)));&#60;br /&#62;
axis equal;grid on
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
