{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Function $\\omega_N(x)$ arising in interpolation error"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For a given set of points $x_0, x_1, \\ldots, x_N \\in [-1,+1]$ we plot the function\n",
"$$\n",
"\\omega_N(x) = (x-x_0)(x-x_1) \\ldots (x-x_N), \\qquad x \\in [-1,+1]\n",
"$$\n",
"for uniform and chebyshev points."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"%config InlineBackend.figure_format = 'svg'\n",
"from numpy import linspace,pi,cos\n",
"from matplotlib.pyplot import plot,legend,grid,title"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def omega(x,xp):\n",
" f = 1.0\n",
" for z in xp:\n",
" f = f * (x-z)\n",
" return f"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"