# software request for solving acoustic wave equation

I am searching some libraries or toolboxes (preferred MATLAB) for solving acoustic wave equation in heterogeneous media with time varying source term, i.e. $$\nabla^2 \psi(\vec{r},t) - \frac{1}{c(\vec{r})^2} \frac{\partial^2}{\partial t^2}\psi(\vec{r},t) = s(\vec{r},t)$$

Actually I want to verify the k-Wave toolbox I modified, which solves another version of the above equation, by using some other softwares, so are there any other recommendations other than k-Wave? Thanks!

• It's hard to recommend something without knowing more about the geometry (1D? 2D? 3D? Unit square or arbitrary domain?), the data (smooth? discontinuous? rapidly varying?), and the desired accuracy. As a starting point, Program 6 in Nick Trefethen's Spectral Methods in Matlab solves the wave equation for variable coefficients. – Christian Clason Jan 14 '13 at 21:21
• @ChristianClason it's can be either 2D or 3D in arbitrary domain. To compare with k-wave, which uses the k-space pseudo-spectral method, the media heterogeneity should be weak (c(r) should be smooth), but I guess the tool that can be applied in discontinuous media can also be used in media with small variation. So any recommendation is welcome. – chaohuang Jan 14 '13 at 21:39
• Then why not just use a five-point stencil and Newmark on the unit square (you can adapt the code in Quarteroni's Scientific Computing with MATLAB and Octave, Program 8.4)? I don't think there's any general purpose wave equation solver in Matlab. – Christian Clason Jan 14 '13 at 22:35
• Very humble contribution: from a seismic point of view you could use Madagascar Api.It has 2D/3D implementations finite differences (enough accuracy for simple seismic modeling, don't know if was your objective though). – eusoubrasileiro Jul 23 '13 at 17:25