{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# p23a: Eigenvalues of perturbed Laplacian in 2-D"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We solve the following eigenvalue problem\n",
"\n",
"$$\n",
"-(u_{xx} + u_{yy}) + f(x,y) u = \\lambda u, \\qquad -1 < x,y < 1, \\qquad u=0 \\quad \\mbox{on boundary}\n",
"$$\n",
"\n",
"where\n",
"\n",
"$$\n",
"f(x,y) = \\exp(20(y-x-1))\n",
"$$\n",
"\n",
"The code is almost same as p23, with only one extra line."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%config InlineBackend.figure_format='svg'\n",
"from chebPy import cheb\n",
"from numpy import meshgrid,dot,eye,kron,zeros,reshape,pi,real,imag\n",
"from numpy import diag,exp,argsort,linspace,inf\n",
"from matplotlib.pyplot import figure,subplot,plot,title,contour\n",
"from scipy.linalg import eig,norm\n",
"from scipy.interpolate import RegularGridInterpolator"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n"
],
"text/plain": [
"