AcousticWaveProblem#

Formulation of the acoustic wave problem.

class AcousticWaveProblem(c=2.0)[source]#

Bases: TimeDependentProblem, SpatialProblem

Implementation of the one-dimensional acoustic wave problem on the space-time domain \(\Omega\times T = [0, 1] \times [0, 1]\).

The problem is governed by the acoustic wave equation

\[\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2},\]

where \(u = u(x, t)\) is the solution field and \(c > 0\) is the wave propagation speed.

Homogeneous Dirichlet boundary conditions are imposed at the spatial boundaries:

\[u(0, t) = u(1, t) = 0, \qquad t \in [0, 1].\]

The initial displacement is prescribed as

\[u(x, 0) = \sin(\pi x) + \frac{1}{2}\sin(4\pi x), \qquad x \in [0, 1],\]

together with zero initial velocity:

\[\frac{\partial u}{\partial t}(x, 0) = 0, \qquad x \in [0, 1].\]

The analytical solution is given by

\[u(x, t) = \sin(\pi x)\cos(c\pi t) + \frac{1}{2}\sin(4\pi x)\cos(4c\pi t).\]

See also

Original reference: Wang, Sifan, Xinling Yu, and Paris Perdikaris. When and why PINNs fail to train: A neural tangent kernel perspective. Journal of Computational Physics 449 (2022): 110768. DOI: 10.1016.

Example:
>>> problem = AcousticWaveProblem(c=2.0)

Initialization of the AcousticWaveProblem class.

Parameters:

c (float | int) – The wave propagation speed. Default is 2.0.

solution(pts)[source]#

Implementation of the analytical solution of the acoustic wave problem.

Parameters:

pts (LabelTensor) – Points where the solution is evaluated.

Returns:

The analytical solution of the acoustic wave problem.

Return type:

LabelTensor