# Numerically evaluate 1D inhomogeneous wave equation solution

I am trying to solve the following 1D inhomogeneous wave equation. Forgive me if I a miss any rigorous mathematical concept.

$$\frac{\partial^2 u}{\partial x^2} - \frac{1}{c^2}\frac{\partial^2 u}{\partial t^2} = \delta(x)f(t)$$

where $c$ is the wave velocity, $f(t)$ any force function and $\delta (x)$ is the dirac delta function. The $\delta(x)$ is used to simulate a point source at $x=0$. I used the Fourier Transform $\mathcal{F}$ first to get to:

$$\frac{\partial^2 U_{\omega}(\omega,x)}{\partial x^2} + \frac{\omega^2}{c^2} U_{\omega}(\omega,x) = \delta(x)F(\omega)$$

$$\frac{\partial^2 U_{\omega}(\omega,x)}{\partial x^2} + k^2 U_{\omega}(\omega,x) = \delta(x)F(\omega)$$ (A)

with $k^2 = \frac{\omega^2}{c^2}$ and the subscript $U_{\omega}(\omega,x) = \mathcal{F_t}(u(t,x))$ meaning Fourier Transformed from $t$.

Since this is the Helmholtz equation I used the already known Green's function solution:

$$u(t,x) = \mathcal{F}^{-1}\{ G(x) \ast \left[ F_{\omega} \delta(x) \right] \}$$

$$u(t,x) = \mathcal{F}^{-1}\{F_{\omega} \frac{j e^{jkx}}{2k}\}$$ (B)

Where $j = \sqrt{-1}$ imaginary unit and $G(x) = \frac{j e^{jkx}}{2k}$ is the Green's function for the inhomogeneous Helmoltz equation.

Forgive-me for the simple question, but what would be the best way to evaluate B numerically, for any discrete source f(t) in a discrete grid?

I was using FFT and IFFT but I was getting weird results, your guidance will help a lot.

Edit:

Another condition I want the energy vanishes at infinity $x^+_-$ .

• There's no reason to use numerical methods or Fourier analysis here. The exact solution is easily obtained by characteristics. Oct 3 '13 at 3:25
• @DavidKetcheson I need that the energy vanishes at infinity. Can I apply that with the method of characteristics? I don't see how. Oct 3 '13 at 14:24
• You don't need to apply that condition. It holds automatically since the initial data and forcing term have compact support. Oct 3 '13 at 14:51
• I'm voting to close this question as off-topic because it doesn't require computational science. May 21 '16 at 4:57