{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# p20: Second order wave equation in 2-D via FFT"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We solve the wave equation in 2-d\n",
"\n",
"$$\n",
"u_{tt} = u_{xx}+u_{yy}, \\qquad -1 < x,y < 1, \\qquad t >0\n",
"$$\n",
"\n",
"with $u = 0$ on the boundary and initial condition\n",
"\n",
"$$\n",
"u(x,y,0) = e^{-40((x-0.4)^2 + y^2)}, \\qquad u_{t}(x,y,0) = 0\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"from numpy import meshgrid,cos,pi,round,exp,real,remainder,zeros,fliplr,flipud,array,arange\n",
"from numpy.fft import fft, ifft\n",
"from matplotlib.pyplot import subplot, figure ,title,axis\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"from matplotlib.pyplot import figure,subplot,plot,title,axis,xlabel,ylabel\n",
"from matplotlib import cm\n",
"from scipy.interpolate import RegularGridInterpolator"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n"
],
"text/plain": [
"