![]() % create the time array, with the time step just below the stability limit % find the time step at the stability limitĭt_limit = 2 / (c_ref * k_max) * asin(c_ref / c_max) % assign the reference sound speed to the background medium A more in-depth discussion of this issue is given in the k-Wave manual. Here, the sound speed is set to be 5% less than the maximum stable time step. However, when the reference sound speed is less than the maximum, the simulation is no longer unconditionally stable, and the time step must be chosen to be less than the stability criterion. To counteract this, it is possible to explicitly specify the value for the reference sound speed (assigned to medium.sound_speed_ref). In this example, the maximum sound speed is much greater than the sound speed in the background medium, and thus numerical dispersion can arise. This means the simulation will be unconditionally stable (it won't "blow up"), but won't prevent numerical dispersion in other parts of the domain where the sound speed is lower. By default, k-Wave sets the reference sound speed to the maximum sound speed anywhere in the domain. When the medium is heterogeneous, the calculation is only exact in regions of the domain where the sound speed matches a scalar reference sound speed used in the model. nsity(slit_mask = 1) = barrier_scale * rho0 įor a homogeneous medium, the simulations in k-Wave are unconditionally stable and free from numerical dispersion (this is a type of numerical error where the sound speed incorrectly depends on frequency which distorts the shape of the propagating waves). Medium.sound_speed(slit_mask = 1) = barrier_scale * c0 Source_wavelength = slit_width * dx % % assign the slit to the properties of the propagation medium % define the source wavelength to be the same as the slit size Slit_mask(slit_x_pos:slit_x_pos + slit_thickness, end - slit_offset:end) = 1 Slit_mask(slit_x_pos:slit_x_pos + slit_thickness, 1:1 + slit_offset) = 1 These can be reduced by increasing the barrier scale.) % define the ratio between the barrier and background sound speed and density (Note, using barrier_scale = 20, some of the incident wave will still be transmitted through the barrier causing additional interference fringes. Here, a diffraction slit is created by defining a thin layer with a significantly different sound speed and density to the background medium such that most of the incident wave is reflected. As this impedance difference is increased, the behaviour of the interface will approach that of a rigid boundary. However, rigid boundaries can still be modelled by assigning a boundary with a large sound speed and density compared to the rest of the propagation medium. The current version of k-Wave cannot explicitly enforce impedance boundary conditions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |