<?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: Wave propagation in three mediums</title>
		<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:04:52 +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/wave-propagation-in-three-mediums" rel="self" type="application/rss+xml" />

		<item>
			<title>savpetr on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5177</link>
			<pubDate>Wed, 29 Jul 2015 10:11:09 +0000</pubDate>
			<dc:creator>savpetr</dc:creator>
			<guid isPermaLink="false">5177@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thank you so much. The code works.&#60;/p&#62;
&#60;p&#62;Savino
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5175</link>
			<pubDate>Tue, 28 Jul 2015 12:38:41 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5175@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi savpetr,&#60;/p&#62;
&#60;p&#62;You have both an instability and a plot scale issue. If you change the plot scale to &#60;code&#62;[-80, 80]&#60;/code&#62; and the definition of the time array to:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% create the time array
CFL = 0.1;
[kgrid.t_array, dt] = makeTime(kgrid, max(max(medium.sound_speed)), CFL);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;your simulation should run.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>savpetr on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5168</link>
			<pubDate>Thu, 23 Jul 2015 11:48:22 +0000</pubDate>
			<dc:creator>savpetr</dc:creator>
			<guid isPermaLink="false">5168@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Anthony,&#60;/p&#62;
&#60;p&#62;this is my code:&#60;/p&#62;
&#60;p&#62;clear all;&#60;br /&#62;
clc;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;l1 = 0.01;&#60;br /&#62;
l2 = 0.08;&#60;br /&#62;
l3 = 0.01;&#60;br /&#62;
l_tot = l1 + l2 + l3;&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nx = 128;           % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 128;           % number of grid points in the y (column) direction&#60;br /&#62;
dx = l_tot/Nx;    	% grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;            % 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;
medium.sound_speed = 1250*ones(Nx, Ny);&#60;br /&#62;
medium.density = 835*ones(Nx, Ny);&#60;br /&#62;
medium.sound_speed(round((l1+l2)/dx):end,:) = 5850;&#60;br /&#62;
medium.density(round((l1+l2)/dx):end, :) = 7800;&#60;br /&#62;
medium.sound_speed(1:round(l1/dx), : ) = 341;&#60;br /&#62;
medium.density(1:round(l1/dx), : ) = 1.2;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, max(max(medium.sound_speed)));&#60;/p&#62;
&#60;p&#62;% define a single source point&#60;br /&#62;
source.u_mask = zeros(Nx, Ny);&#60;br /&#62;
source.u_mask(end - Nx/4, Ny/2) = 1;&#60;/p&#62;
&#60;p&#62;% define a time varying sinusoidal velocity source in the x-direction&#60;br /&#62;
source_freq = 0.25e6;       % [Hz]&#60;br /&#62;
source_mag = 2/(min(min(medium.sound_speed))*min(min(medium.density)));&#60;br /&#62;
source.ux = -source_mag*sin(2*pi*source_freq*kgrid.t_array);&#60;/p&#62;
&#60;p&#62;% filter the source to remove high frequencies not supported by the grid&#60;br /&#62;
source.ux = filterTimeSeries(kgrid, medium, source.ux);&#60;/p&#62;
&#60;p&#62;% define a single sensor point&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(Nx/2, Ny/2) = 1;&#60;/p&#62;
&#60;p&#62;% define the acoustic parameters to record&#60;br /&#62;
sensor.record = {'p', 'p_final'};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, 'PlotScale', [-0.5, 0.5]);&#60;/p&#62;
&#60;p&#62;I saw 'Monopole Point Source In A Homogeneous Propagation Medium Example'. Why this code doesn't work?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anthony on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5138</link>
			<pubDate>Fri, 10 Jul 2015 10:42:24 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">5138@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi savpetr,&#60;/p&#62;
&#60;p&#62;It seems correct to me. Anyway, I don't think that the error message you get come from your medium definition... Did you change anything else in the example? Could you post your complete code? &#60;/p&#62;
&#60;p&#62;Anthony&#60;/p&#62;
&#60;p&#62;PS : By the way, you seem to have very large differences in the density and sound speed, see related topics but it may cause (other) problems.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>savpetr on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5136</link>
			<pubDate>Thu, 09 Jul 2015 18:17:20 +0000</pubDate>
			<dc:creator>savpetr</dc:creator>
			<guid isPermaLink="false">5136@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Anthony, &#60;/p&#62;
&#60;p&#62;Thank you for your answer. This is my code:&#60;/p&#62;
&#60;p&#62;medium.sound_speed = 1250*ones(Nx, Ny);&#60;br /&#62;
medium.density = 835*ones(Nx, Ny);&#60;br /&#62;
medium.sound_speed(1:round(l1/dx),:) = 5850;&#60;br /&#62;
medium.density(1:round(l1/dx), :) = 7800;&#60;br /&#62;
medium.sound_speed(round(l2/dx):round(l3/dx), : ) = 341;&#60;br /&#62;
medium.density(round(l2/dx):round(l3/dx), : ) = 1.2; &#60;/p&#62;
&#60;p&#62;l1,l2 and l3 are the distances from the start of the grid.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anthony on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5135</link>
			<pubDate>Thu, 09 Jul 2015 15:00:12 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">5135@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi savpetr&#60;/p&#62;
&#60;p&#62;The number of media should not change anything. The waitbar is only the bar which shows the progress of the computations. Could you post your code?&#60;br /&#62;
To define different media you can set heterogeneous maps of density, speed etc. in the variables &#60;code&#62;medium.sound_speed&#60;/code&#62;, &#60;code&#62;medium.sound_speed&#60;/code&#62; etc.&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Anthony
&#60;/p&#62;</description>
		</item>
		<item>
			<title>savpetr on "Wave propagation in three mediums"</title>
			<link>http://www.k-wave.org/forum/topic/wave-propagation-in-three-mediums#post-5134</link>
			<pubDate>Thu, 09 Jul 2015 12:17:32 +0000</pubDate>
			<dc:creator>savpetr</dc:creator>
			<guid isPermaLink="false">5134@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, I'm new to K-WAVE. I want to simulate the 2D propagation in three different mediums. I did it with two mediums without problems. When I define three mediums and run the simulation I receive the error:&#60;br /&#62;
&#34;Error using waitbar (line 90) The second argument must be a message string or a handle to an existing waitbar.&#34; How can I solve it?&#60;br /&#62;
Thanks.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
