{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# p16: Poisson equation in 2-D"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We solve the following Poisson problem\n",
"\n",
"$$\n",
"u_{xx} + u_{yy} = 10\\sin(8x(y-1)), \\qquad -1 < x,y < 1, \\qquad u=0 \\quad \\mbox{on boundary}\n",
"$$"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%config InlineBackend.figure_format='svg'\n",
"from chebPy import cheb\n",
"from numpy import meshgrid,sin,dot,eye,kron,zeros,reshape,linspace\n",
"from matplotlib.pyplot import figure,subplot,plot,title,axis,xlabel,ylabel,spy\n",
"from matplotlib import cm\n",
"from scipy.linalg import solve\n",
"from scipy.interpolate import RegularGridInterpolator"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n"
],
"text/plain": [
"