<?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: 3D simulations of Lamb wave in plate</title>
		<link>http://www.k-wave.org/forum/topic/3d-simulations-of-lamb-wave-in-plate</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:45:02 +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/3d-simulations-of-lamb-wave-in-plate" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "3D simulations of Lamb wave in plate"</title>
			<link>http://www.k-wave.org/forum/topic/3d-simulations-of-lamb-wave-in-plate#post-6897</link>
			<pubDate>Sat, 22 Jun 2019 20:32:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6897@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Sounds like a classic instability. Have you tried making the time step (CFL) smaller?&#60;/p&#62;
&#60;p&#62;Note, your simulations will run much faster if you choose grid sizes with small prime factors (59 is a prime number, so a particularly bad choice).&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pakulam on "3D simulations of Lamb wave in plate"</title>
			<link>http://www.k-wave.org/forum/topic/3d-simulations-of-lamb-wave-in-plate#post-6858</link>
			<pubDate>Wed, 22 May 2019 07:39:15 +0000</pubDate>
			<dc:creator>pakulam</dc:creator>
			<guid isPermaLink="false">6858@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I have the problem with 3D simulation of Lamb wave in plate wich is embended in artificial fluid (which should simulate air).&#60;br /&#62;
My simulations were based on existing in help code for simulations of shearwave and Snells law.&#60;/p&#62;
&#60;p&#62;I have performed simulations in 2D and the results are very good and in agreement with theoretical (analitical) model. Then I tried to perform such anaysis in 3D and in fact simulations is working but the results are bad (I receive NAN in the values of UX, uy, uz, p). Below please find well working 2D code and the 3D code I have developed based on 2D code. I would appreciate for any sugestions&#60;br /&#62;
Kind Regards Michal&#60;/p&#62;
&#60;p&#62;1. 2D code - GOOD&#60;br /&#62;
clear all;&#60;br /&#62;
clc&#60;br /&#62;
close all&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% SIMULATION PARAMETERS&#60;br /&#62;
% =========================================================================&#60;br /&#62;
scale = 1;&#60;br /&#62;
% create the computational grid&#60;br /&#62;
PML_size = 20;               % size of the PML in grid points&#60;br /&#62;
Nx = 59*scale - 2*PML_size; % number of grid points in the x direction&#60;br /&#62;
Ny = 300*scale - 2*PML_size; % number of grid points in the y direction&#60;br /&#62;
% Nz = 300*scale - 2*PML_size; % number of grid points in the y direction&#60;br /&#62;
dx = 0.5e-3/scale;           % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.5e-3/scale;           % grid point spacing in the y direction [m]&#60;br /&#62;
% dz=dx;&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;br /&#62;
% kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;br /&#62;
% define the medium properties&#60;br /&#62;
cp1 = 600;         % compressional wave speed [m/s]&#60;br /&#62;
cs1 = 0;            % shear wave speed [m/s]&#60;br /&#62;
rho1 = 200;        % density [kg/m^3]&#60;br /&#62;
alpha0_p1 = 5.0;    % compressional wave absorption [dB/(MHz^2 cm)]&#60;br /&#62;
alpha0_s1 = 5.0;    % shear wave absorption [dB/(MHz^2 cm)]&#60;/p&#62;
&#60;p&#62;cp2 = 2656;         % compressional wave speed [m/s]&#60;br /&#62;
cs2 = 1078;         % shear wave speed [m/s]&#60;br /&#62;
rho2 = 1140;        % density [kg/m^3]&#60;br /&#62;
alpha0_p2 = 0.5;      % compressional wave absorption [dB/(MHz^2 cm)]&#60;br /&#62;
alpha0_s2 = 0.5;      % shear wave absorption [dB/(MHz^2 cm)]&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
cfl   = 0.1;&#60;br /&#62;
t_end = 200e-6;&#60;br /&#62;
kgrid.t_array= makeTime(kgrid, cp1, cfl, t_end);&#60;br /&#62;
fs=1/kgrid.dt;&#60;/p&#62;
&#60;p&#62;% define position of heterogeneous slab&#60;br /&#62;
% slab = ones(Nx, Ny, Nz);&#60;br /&#62;
% slab (1,:,:)=0 ;&#60;br /&#62;
% slab (19,:,:)=0 ;&#60;br /&#62;
slab = ones(Nx, Ny);&#60;br /&#62;
slab (1,:)=0 ;&#60;br /&#62;
slab (19,:)=0 ;&#60;/p&#62;
&#60;p&#62;% define the source properties&#60;br /&#62;
source_freq = 0.05e6;              % [Hz]&#60;br /&#62;
source_strength = 2e6;          % [Pa]&#60;br /&#62;
source_cycles = 2;              % number of tone burst cycles&#60;br /&#62;
%3D&#60;br /&#62;
% source_mask=zeros(Nx,Ny,Nz);&#60;br /&#62;
% source_mask(2,30,6)=1;&#60;br /&#62;
% source_mask(18,30,6)=1;&#60;br /&#62;
%2D&#60;br /&#62;
source_mask=zeros(Nx,Ny);&#60;br /&#62;
source_mask(2,6)=1;&#60;br /&#62;
source_mask(18,6)=1;&#60;/p&#62;
&#60;p&#62;% assign the source&#60;br /&#62;
source.s_mask = source_mask;&#60;br /&#62;
source.sxx(1,:) = source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);&#60;br /&#62;
source.sxx(2,:) = -source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);&#60;/p&#62;
&#60;p&#62;% define the sensor mask&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
for k=171:1:221&#60;br /&#62;
   sensor.mask(2,k:k+10) = 1; %2D&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;sensor.record = {'p','u'};&#60;br /&#62;
% set the input arguments&#60;br /&#62;
input_args = {'PMLSize', PML_size, 'PMLAlpha', 2, 'PlotPML', false, ...&#60;br /&#62;
    'PMLInside', false, 'PlotScale', [-1, 1]*source_strength/2, ...&#60;br /&#62;
    'DisplayMask', 'off', 'DataCast', 'single'};&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% ELASTIC SIMULATION&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% define the medium properties&#60;br /&#62;
medium.sound_speed_compression            = cp1*ones(Nx, Ny);&#60;br /&#62;
medium.sound_speed_compression(slab == 1) = cp2;&#60;br /&#62;
medium.sound_speed_shear                  = cs1*ones(Nx, Ny);&#60;br /&#62;
medium.sound_speed_shear(slab == 1)       = cs2;&#60;br /&#62;
medium.density                            = rho1*ones(Nx, Ny);&#60;br /&#62;
medium.density(slab == 1)                 = rho2;&#60;br /&#62;
medium.alpha_coeff_compression            = alpha0_p1*ones(Nx, Ny);&#60;br /&#62;
medium.alpha_coeff_compression(slab == 1) = alpha0_p2;&#60;br /&#62;
medium.alpha_coeff_shear                  = alpha0_s1*ones(Nx, Ny);&#60;br /&#62;
medium.alpha_coeff_shear(slab == 1)       = alpha0_s2;&#60;/p&#62;
&#60;p&#62;% run the elastic simulation&#60;br /&#62;
sensor_data_elastic = pstdElastic2D(kgrid, medium, source, sensor, input_args{:});&#60;br /&#62;
p=sensor_data_elastic.p;&#60;br /&#62;
subplot(2,2,1),imagesc(p),title('Preassure')&#60;br /&#62;
ux=sensor_data_elastic.ux;&#60;br /&#62;
subplot(2,2,2),imagesc(ux),title('Ux')&#60;br /&#62;
uy=sensor_data_elastic.uy;&#60;br /&#62;
subplot(2,2,3),imagesc(uy),title('Uy')&#60;br /&#62;
save('SIM_Results2D.mat','p','ux','uy','fs','source_freq')&#60;/p&#62;
&#60;p&#62;2. 3D code - BAD&#60;br /&#62;
clear all;&#60;br /&#62;
clc&#60;br /&#62;
close all&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% SIMULATION PARAMETERS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;scale = 1;&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
PML_size = 20;               % size of the PML in grid points&#60;/p&#62;
&#60;p&#62;Nx = 59*scale - 2*PML_size; % number of grid points in the x direction&#60;br /&#62;
Ny = 100*scale - 2*PML_size; % number of grid points in the y direction&#60;br /&#62;
Nz = 300*scale - 2*PML_size; % number of grid points in the y direction&#60;br /&#62;
dx = 0.5e-3/scale;           % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.5e-3/scale;           % grid point spacing in the y direction [m]&#60;br /&#62;
dz=dx;&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;br /&#62;
% define the medium properties&#60;br /&#62;
cp1 = 600;         % compressional wave speed [m/s]&#60;br /&#62;
cs1 = 0;            % shear wave speed [m/s]&#60;br /&#62;
rho1 = 200;        % density [kg/m^3]&#60;br /&#62;
alpha0_p1 = 5.0;    % compressional wave absorption [dB/(MHz^2 cm)]&#60;br /&#62;
alpha0_s1 = 5.0;    % shear wave absorption [dB/(MHz^2 cm)]&#60;/p&#62;
&#60;p&#62;cp2 = 2656;         % compressional wave speed [m/s]&#60;br /&#62;
cs2 = 1078;         % shear wave speed [m/s]&#60;br /&#62;
rho2 = 1140;        % density [kg/m^3]&#60;br /&#62;
alpha0_p2 = 0.5;      % compressional wave absorption [dB/(MHz^2 cm)]&#60;br /&#62;
alpha0_s2 = 0.5;      % shear wave absorption [dB/(MHz^2 cm)]&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
cfl   = 0.1;&#60;br /&#62;
t_end = 100e-6;&#60;br /&#62;
kgrid.t_array= makeTime(kgrid, cp1, cfl, t_end);&#60;br /&#62;
fs=1/kgrid.dt;&#60;/p&#62;
&#60;p&#62;% define position of heterogeneous slab&#60;br /&#62;
slab = ones(Nx, Ny, Nz);&#60;br /&#62;
slab (1,:,:)=0 ;&#60;br /&#62;
slab (19,:,:)=0 ;&#60;/p&#62;
&#60;p&#62;% define the source properties&#60;br /&#62;
source_freq = 0.05e6;              % [Hz]&#60;br /&#62;
source_strength = 2e6;          % [Pa]&#60;br /&#62;
source_cycles = 2;              % number of tone burst cycles&#60;br /&#62;
source_mask=zeros(Nx,Ny,Nz);&#60;br /&#62;
source_mask(2,30,6)=1;&#60;br /&#62;
source_mask(18,30,6)=1;&#60;br /&#62;
% assign the source&#60;br /&#62;
source.s_mask = source_mask;&#60;br /&#62;
source.sxx(1,:) = source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);&#60;br /&#62;
source.sxx(2,:) = -source_strength*toneBurst(1/kgrid.dt, source_freq, source_cycles);&#60;/p&#62;
&#60;p&#62;% define the sensor mask&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
for k=171:1:221&#60;br /&#62;
   sensor.mask(2,30,k:k+10) = 1;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;sensor.record = {'p','u'};&#60;br /&#62;
% set the input arguments&#60;br /&#62;
input_args = {'PMLSize', PML_size, 'PMLAlpha', 2, 'PlotPML', false, ...&#60;br /&#62;
    'PMLInside', false, 'PlotScale', [-1, 1]*source_strength/2, ...&#60;br /&#62;
    'DisplayMask', 'off', 'DataCast', 'single'};&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% ELASTIC SIMULATION&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% define the medium properties&#60;br /&#62;
clear medium&#60;br /&#62;
medium.sound_speed_compression            = cp1*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.sound_speed_compression(slab == 1) = cp2;&#60;br /&#62;
medium.sound_speed_shear                  = cs1*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.sound_speed_shear(slab == 1)       = cs2;&#60;br /&#62;
medium.density                            = rho1*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.density(slab == 1)                 = rho2;&#60;br /&#62;
medium.alpha_coeff_compression            = alpha0_p1*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.alpha_coeff_compression(slab == 1) = alpha0_p2;&#60;br /&#62;
medium.alpha_coeff_shear                  = alpha0_s1*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.alpha_coeff_shear(slab == 1)       = alpha0_s2;&#60;/p&#62;
&#60;p&#62;% run the elastic simulation&#60;br /&#62;
sensor_data_elastic = pstdElastic3D(kgrid, medium, source, sensor, input_args{:});&#60;br /&#62;
p=sensor_data_elastic.p;&#60;br /&#62;
subplot(2,2,1),imagesc(p),title('Preassure')&#60;br /&#62;
ux=sensor_data_elastic.ux;&#60;br /&#62;
subplot(2,2,2),imagesc(ux),title('Ux')&#60;br /&#62;
uy=sensor_data_elastic.uy;&#60;br /&#62;
subplot(2,2,3),imagesc(uy),title('Uy')&#60;/p&#62;
&#60;p&#62;save('SIM_Results3D.mat','p','ux','uy','fs','source_freq')
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
