Hi Brad,
I recently ran a simulation using "kspaceFirstOrder3DG" with multiple media as shown below. However, the simulation seems unstable as the result of "sensor_data" is a matrix full of "NaN (Not-a-Number)" in Matlab. I understand the differences of the "speed of sound" and "absorption" among different media are quite large which may be the reason causing simulation instability. I wonder if there is a way to tweak the values of "speed of sound" or "absorption" so that the simulation becomes stable while still maintaining certain amount of accuracy. Thanks a million!
Best wishes,
Toni
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
np2db=0.2*log10(exp(1));
ppts=zeros(5,5); % Velocity, Density, Absorption Coefficient, Power Law Exponent, Non-linearity (m/s, kg/m3, Np/cm/MHz, y, B/A)
ppts(1,:)=[1561 1081 3.917*np2db 1.2598 6.756]; % heart muscle
ppts(2,:)=[1482 994 0.025*np2db 1 4.96]; % water
ppts(3,:)=[1578 1050 2.3676*np2db 1.05 6.1125]; % blood
ppts(4,:)=[3515 1908 54.553*np2db 1 1]; % sternum
ppts(5,:)=[1500 1050 161.88*np2db 1 1]; % lung
% Please note that the 4th column "power law exponent" of matrix "ppts" has been disabled.
% Instead the "medium.alpha_power" is set to 1.05 for all media as recommended in the k-Wave manual.