<?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: Unreasonable waveforms are received in heterogeneous media under closed conditio</title>
		<link>http://www.k-wave.org/forum/topic/unreasonable-waveforms-are-received-in-heterogeneous-media-under-closed-conditio</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 22:54:25 +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/unreasonable-waveforms-are-received-in-heterogeneous-media-under-closed-conditio" rel="self" type="application/rss+xml" />

		<item>
			<title>alau on "Unreasonable waveforms are received in heterogeneous media under closed conditio"</title>
			<link>http://www.k-wave.org/forum/topic/unreasonable-waveforms-are-received-in-heterogeneous-media-under-closed-conditio#post-9192</link>
			<pubDate>Wed, 05 Mar 2025 10:10:48 +0000</pubDate>
			<dc:creator>alau</dc:creator>
			<guid isPermaLink="false">9192@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi everyone, recently I have been trying to simulate point source propagation using straight tubes as a fixed acoustic path.&#60;/p&#62;
&#60;p&#62;The inside of the straight pipe is water and the outside is air. The point source propagates from the outside of the straight tube to the inside, and the sensor is at the other end of the straight tube. It is expected that the sensor can receive the signal only when the sound wave propagation time is: t=L_ tube /c_ water, but the actual simulation result is that there is a strange signal at the beginning, and the envelope of this signal is in the form of sine waves. When I increase the initial pressure amplitude, I can see that at the beginning of the simulation, there are strange waves reaching the sensor directly.&#60;/p&#62;
&#60;p&#62;I checked the code but can not find the problem. Can anyone helo?&#60;/p&#62;
&#60;p&#62;Best Regards&#60;/p&#62;
&#60;p&#62;The code is as follows:&#60;/p&#62;
&#60;p&#62;If the disc_magnitude is set to 50000, the phenomenon can be clearly seen.&#60;/p&#62;
&#60;p&#62;%%%%%straight pipe&#60;/p&#62;
&#60;p&#62;d_length=8e-2;   %  length&#60;br /&#62;
d_wide=10e-3;   %   wide&#60;/p&#62;
&#60;p&#62;d_x=2.5e-5;   %50um   40um&#60;br /&#62;
d_y=2.5e-5;   %50um  &#60;/p&#62;
&#60;p&#62;n_wide=d_wide./d_y;&#60;br /&#62;
n_length=d_length./d_x;&#60;/p&#62;
&#60;p&#62;r_Nx=n_length+100;&#60;br /&#62;
r_Ny=n_wide+100;&#60;/p&#62;
&#60;p&#62;mask=zeros(r_Nx,r_Ny);&#60;/p&#62;
&#60;p&#62;mask(50:n_length+50,50:n_wide+50)=1;&#60;/p&#62;
&#60;p&#62;%%%%%Sensor position&#60;/p&#62;
&#60;p&#62;[row_sensor,cow_sensor]=find(mask(50,:)==1);   &#60;/p&#62;
&#60;p&#62;n_cow_sensor=length(cow_sensor);&#60;/p&#62;
&#60;p&#62;sensor_mask=zeros(r_Nx,r_Ny);&#60;br /&#62;
sensor_mask(50,50:n_cow_sensor)=1;&#60;/p&#62;
&#60;p&#62;%%%%simulation&#60;/p&#62;
&#60;p&#62;PML_size =20;              % size of the PML in grid points&#60;br /&#62;
Nx = r_Nx ;    % number of grid points in the x direction&#60;br /&#62;
Ny = r_Ny ;    % number of grid points in the y direction&#60;br /&#62;
dx = d_y;                % grid point spacing in the x direction [m]&#60;br /&#62;
dy = d_x;                % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% define a  sensor line&#60;br /&#62;
sensor.mask = sensor_mask;&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
result = logical(mask);&#60;br /&#62;
medium.sound_speed = 343 * ones(Nx, Ny);   % [m/s]  空气中声速 343&#60;br /&#62;
medium.sound_speed(result) = 1500;       % [m/s]  水中声速&#60;/p&#62;
&#60;p&#62;medium.density = 1.225 * ones(Nx, Ny);       % [kg/m^3]  空气密度 1.225&#60;br /&#62;
medium.density(result) = 1000;       % [kg/m^3]  水密度&#60;/p&#62;
&#60;p&#62;% set the simulation time to capture the reflections&#60;br /&#62;
t_end =6.5e-5;&#60;br /&#62;
% 2.5 * kgrid.x_size / max(medium.sound_speed(:));&#60;/p&#62;
&#60;p&#62;% define the time array&#60;br /&#62;
cfl=0.25;&#60;br /&#62;
kgrid.makeTime(medium.sound_speed, cfl,t_end);&#60;/p&#62;
&#60;p&#62;% create initial pressure distribution using makeDisc&#60;br /&#62;
n_row_source=3255;&#60;br /&#62;
n_cow_source=310;  &#60;/p&#62;
&#60;p&#62;disc_magnitude =50000;         % [Pa]&#60;br /&#62;
disc_y_pos = n_cow_source;            % [grid points]&#60;br /&#62;
disc_x_pos =n_row_source;           % [grid points]&#60;br /&#62;
disc_radius=2;   &#60;/p&#62;
&#60;p&#62;disc_1 = disc_magnitude * makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);&#60;/p&#62;
&#60;p&#62;% smooth the initial pressure distribution and restore the magnitude&#60;br /&#62;
p0 = smooth(disc_1, true);&#60;/p&#62;
&#60;p&#62;% assign to the source structure&#60;br /&#62;
source.p0 = p0;&#60;/p&#62;
&#60;p&#62;input_args = {'PMLSize', PML_size};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor,input_args{:});&#60;br /&#62;
sensor_t=sum(sensor_data);&#60;/p&#62;
&#60;p&#62;plot(sensor_data);&#60;/p&#62;
&#60;p&#62;%% &#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% VISUALISATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% plot the initial pressure and sensor distribution&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(kgrid.y_vec * 1e3, kgrid.x_vec * 1e3, p0 + sensor.mask * disc_magnitude, [-disc_magnitude, disc_magnitude]);&#60;br /&#62;
colormap(getColorMap);&#60;br /&#62;
ylabel('x-position [mm]');&#60;br /&#62;
xlabel('y-position [mm]');&#60;br /&#62;
axis image;&#60;br /&#62;
colorbar;&#60;br /&#62;
scaleFig(1, 0.65);&#60;br /&#62;
%% %% 单探测器&#60;/p&#62;
&#60;p&#62;sensordata=mean(sensor_data);  %之前用的是mean&#60;/p&#62;
&#60;p&#62;plot(kgrid.dt:kgrid.dt:kgrid.dt*kgrid.Nt,sensordata);&#60;br /&#62;
xlabel('t/s');&#60;br /&#62;
ylabel('PA');&#60;br /&#62;
title(disc_y_pos);&#60;/p&#62;
&#60;p&#62;%%&#60;br /&#62;
plot(kgrid.dt:kgrid.dt:kgrid.dt*kgrid.Nt,sensor_data(25,:));&#60;br /&#62;
xlabel('t/s');&#60;br /&#62;
ylabel('PA');&#60;br /&#62;
 title('原信号');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
