Monomial interpolation

In [3]:
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as pt
In [5]:
x = np.linspace(0, 1, 200)

Now plot the monomial basis on the interval [0,1] up to $x^9$.

In [6]:
for i in range(10):
    pt.plot(mesh, mesh**i)
  • How do the entries of the Vandermonde matrix relate to this plot?

    Hint: pt.vlines(np.linspace(0, 1, 10), 0, 1)


  • Guess the condition number of the Vandermonde matrix for $n=5,10,20$:
In [19]:
n = 5
V = np.array([mesh**i for i in range(n)]).T
la.cond(V)
Out[19]:
677.44361211971705