Hi William,
Have you tried setting source.p_mode
to 'dirichlet'
? That will force the pressure at that point to be what you have input. The default option is 'additive'
, which adds the source to the current value of the acoustic pressure at the source point. In this latter case, the acoustic pressure amplitude at the source will grow up to a time dx / sound_speed when using a time-varying source.
The reason it grows goes to the fundamentals of k-Wave. When you define a 'point' source, ie. a value at one grid point and zeros at all other grid points, then what k-Wave sees is not a single point source but rather a source function of the form sinc(\pi x / dx) sinc (\pi y / dy) centred at the 'source point'. (It is the band-limited interpolant which matches all the values defined on the grid but it varies in between the grid points. This arises because of the Fourier basis that underlies k-Wave.) It takes a time of dx / sound_speed for the main lobe of this sinc function to propagate away from the source point.
If you are interested in the difference in the source pressure and the pressure at some other point in the field and want to use an additive source type, then one option is to record the pressure at the source point (ie. set one of the sensor points to be the source point).
Hope that helps,
Ben