<?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: fantasyhaha</title>
		<link><a href='http://www.k-wave.org/forum/profile/fantasyhaha'>fantasyhaha</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:02:04 +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>Bradley Treeby on "Problem in PA simulation"</title>
			<link>http://www.k-wave.org/forum/topic/problem-in-pa-simulation#post-8654</link>
			<pubDate>Tue, 08 Nov 2022 10:32:34 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8654@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks fantasyhaha. Can you send more details about the differences in the output between the linux and windows simulations?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fantasyhaha on "Problem in PA simulation"</title>
			<link>http://www.k-wave.org/forum/topic/problem-in-pa-simulation#post-8631</link>
			<pubDate>Fri, 14 Oct 2022 00:47:10 +0000</pubDate>
			<dc:creator>fantasyhaha</dc:creator>
			<guid isPermaLink="false">8631@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you sir.&#60;br /&#62;
I have checked the code and I can show you the test code as follow:&#60;br /&#62;
clearvars;&#60;br /&#62;
close all&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
PML_size = 20;              % size of the PML in grid points&#60;br /&#62;
Nx = 446;     % number of grid points in the x direction&#60;br /&#62;
Ny = Nx;                    % number of grid points in the y direction&#60;br /&#62;
Nz = Nx;                    % number of grid points in the z direction&#60;br /&#62;
dx = 0.2e-3;                % grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;                    % grid point spacing in the y direction [m]&#60;br /&#62;
dz = dx;                    % grid point spacing in the z direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500;	% [m/s]&#60;/p&#62;
&#60;p&#62;% create initial pressure distribution using makeBall&#60;br /&#62;
% ball_magnitude = 10;        % [Pa]&#60;br /&#62;
ball_x_pos = Nx/2;            % [grid points]&#60;br /&#62;
ball_y_pos = Ny/2;            % [grid points]&#60;br /&#62;
ball_z_pos = Nz/2;            % [grid points]&#60;br /&#62;
% ball_radius = 30;            % [grid points]&#60;br /&#62;
% p0_binary = ball_magnitude * makeBall(Nx, Ny, Nz, ball_x_pos, ball_y_pos, ball_z_pos, ball_radius);&#60;br /&#62;
sz=80;&#60;br /&#62;
p0_init=zeros(Nx,Ny,Nz);&#60;br /&#62;
p0_init((Nx/2-sz/2+1):(Nx/2+sz/2+1),(Nx/2-sz/2+1):(Nx/2+sz/2+1),(Nx/2-sz/2+1):(Nx/2+sz/2+1))=10;&#60;br /&#62;
load('brain_up_2.mat')&#60;br /&#62;
brain=imresize3(V,[Nx Ny Nz]);&#60;br /&#62;
brain_BW=imbinarize(brain);&#60;br /&#62;
p0_init=p0_init.*brain_BW;&#60;br /&#62;
% smooth the initial pressure distribution and restore the magnitude&#60;br /&#62;
p0 = smooth(p0_init, true);&#60;/p&#62;
&#60;p&#62;% assign to the source structure&#60;br /&#62;
source.p0 = p0;&#60;/p&#62;
&#60;p&#62;% define a Cartesian spherical sensor&#60;br /&#62;
sensor_radius = 40e-3;       % [m]&#60;br /&#62;
center_pos = [0.5, 0.5, 0.5]*Nx*dx;     % [m]&#60;br /&#62;
num_sensor_points = 1024;&#60;br /&#62;
sensor_mask = makeCartSphere(sensor_radius, num_sensor_points, center_pos, true);&#60;/p&#62;
&#60;p&#62;% assign to the sensor structure&#60;br /&#62;
sensor.mask = sensor_mask;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
cfl=0.3;&#60;br /&#62;
% kgrid.makeTime(medium.sound_speed);&#60;br /&#62;
kgrid.makeTime(medium.sound_speed,cfl);&#60;br /&#62;
time_limit=(Nx+sz)*dx/medium.sound_speed;&#60;br /&#62;
kgrid.t_array(kgrid.t_array&#38;gt;time_limit)=[];&#60;br /&#62;
% set the input arguements&#60;br /&#62;
input_args = {'PMLSize', PML_size, 'PMLInside', false, 'PlotPML', true, ...&#60;br /&#62;
    'Smooth', false, 'DataCast', 'single', 'CartInterp', 'nearest'};&#60;br /&#62;
% % plot the initial pressure and sensor surface in voxel form&#60;br /&#62;
% voxelPlot(double(p0_init &#124; cart2grid(kgrid, sensor_mask)));&#60;br /&#62;
% view([60, 20]);&#60;br /&#62;
dt_stability_limit = checkStability(kgrid, medium);&#60;br /&#62;
% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;br /&#62;
%%
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Problem in PA simulation"</title>
			<link>http://www.k-wave.org/forum/topic/problem-in-pa-simulation#post-8622</link>
			<pubDate>Fri, 07 Oct 2022 13:35:13 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">8622@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi fantasyhaha, &#60;/p&#62;
&#60;p&#62;That sounds strange. You run the same simulation script on the same version of matlab and it's different if you're running Linux or Windows? Please can you send more details about the differences in the output.&#60;/p&#62;
&#60;p&#62;Best wishes&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fantasyhaha on "Problem in PA simulation"</title>
			<link>http://www.k-wave.org/forum/topic/problem-in-pa-simulation#post-8615</link>
			<pubDate>Sun, 02 Oct 2022 07:34:37 +0000</pubDate>
			<dc:creator>fantasyhaha</dc:creator>
			<guid isPermaLink="false">8615@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;This problem seems to happen on the server with a Linux system(Ubuntu 22.04). When I test it on a high-performance PC with Windows 10 with the same Matlab version, it's stable.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fantasyhaha on "Problem in PA simulation"</title>
			<link>http://www.k-wave.org/forum/topic/problem-in-pa-simulation#post-8613</link>
			<pubDate>Thu, 29 Sep 2022 02:05:05 +0000</pubDate>
			<dc:creator>fantasyhaha</dc:creator>
			<guid isPermaLink="false">8613@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello developers,&#60;br /&#62;
      We meet a problem in simulation in a relatively large space.&#60;br /&#62;
      Parameters are as follows:&#60;br /&#62;
PML_size = 10;              % size of the PML in grid points&#60;br /&#62;
Nx = 420;     % number of grid points in the x direction&#60;br /&#62;
Ny = Nx;                    % number of grid points in the y direction&#60;br /&#62;
Nz = Nx;                    % number of grid points in the z direction&#60;br /&#62;
dx = 0.2e-3;                % grid point spacing in the x direction [m]&#60;br /&#62;
dy = dx;                    % grid point spacing in the y direction [m]&#60;br /&#62;
dz = dx;                    % grid point spacing in the z direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;br /&#62;
% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500;	% [m/s]&#60;br /&#62;
sz=128;&#60;br /&#62;
p0_init=zeros(Nx,Ny,Nz);&#60;br /&#62;
p0_init((Nx/2-sz/2+1):(Nx/2+sz/2+1),(Nx/2-sz/2+1):(Nx/2+sz/2+1),(Nx/2-sz/2+1):(Nx/2+sz/2+1))=10;&#60;br /&#62;
% smooth the initial pressure distribution and restore the magnitude&#60;br /&#62;
p0 = smooth(p0_init, true);&#60;/p&#62;
&#60;p&#62;% assign to the source structure&#60;br /&#62;
source.p0 = p0;&#60;/p&#62;
&#60;p&#62;% define a Cartesian spherical sensor&#60;br /&#62;
sensor_radius = 40e-3;       % [m]&#60;br /&#62;
center_pos = [0, 0, 0];     % [m]&#60;br /&#62;
num_sensor_points = 1024;&#60;br /&#62;
sensor_mask = makeCartSphere(sensor_radius, num_sensor_points, center_pos, true);&#60;/p&#62;
&#60;p&#62;% assign to the sensor structure&#60;br /&#62;
sensor.mask = sensor_mask;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
cfl=0.15;&#60;br /&#62;
% kgrid.makeTime(medium.sound_speed);&#60;br /&#62;
kgrid.makeTime(medium.sound_speed);&#60;br /&#62;
% kgrid.t_array(3470:end)=[];&#60;br /&#62;
% set the input arguements&#60;br /&#62;
input_args = {'PMLSize', PML_size, 'PMLInside', false, 'PlotPML', true, ...&#60;br /&#62;
    'Smooth', false, 'DataCast', 'single', 'CartInterp', 'nearest'};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;We meet some problems during the simulation and the signal then the 'sensor_data' becomes continuous oscillation with very high amplitude.(I hope I can share you a figure to show the results) This happened before the wave reach our transducer or PML. We have already tested different 'cfl' values but can not solve this problem.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
