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!

  • $\begingroup$ 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. $\endgroup$ Jan 14, 2013 at 21:21
  • $\begingroup$ @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. $\endgroup$
    – chaohuang
    Jan 14, 2013 at 21:39
  • $\begingroup$ 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. $\endgroup$ Jan 14, 2013 at 22:35
  • $\begingroup$ 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). $\endgroup$
    – imbr
    Jul 23, 2013 at 17:25

1 Answer 1


There is a tutorial program for this in deal.II: step-24, at http://www.dealii.org/developer/doxygen/deal.II/step_24.html

(Disclaimer: I'm one of the authors of this library.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.