二维声波方程为
任何人都可以对上述问题给出分析解决方案,而不用担心边界条件(假设无限边界)?
- 是标量场(压力)
- 是速度(一个标量值),在域中的任何地方都相同。
- 或源函数仅在域中的一个点(在 2D / 3D 域的中心)。
此代码的有限差分 IPython 片段是
# it is the time step number.
# dt is the time step size.
# src is the source
f0 = 100.0 # dominant frequency of source (Hz)
T = 1.0 / f0 # dominant period
ist = 100 # shifting of source time function
src[it] = exp(-1.0 / T ** 2 * ((it - ist) * dt) ** 2) # This is a Gaussian source
# Take the first derivative to finally define the source function.
src = np.diff(src) / dt
绿色的功能对我来说有点复杂。
鉴于此,如何重新定义/适应我们的有限差分情况: https ://en.wikipedia.org/wiki/Acoustic_wave_equation#Cartesian_coordinates