Copyright (C) 2010-2020 Luke Olson
Copyright (C) 2020 Andreas Kloeckner
import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as pt
x = np.linspace(0, 1, 200)
Now plot the monomial basis on the interval [0,1] up to $x^9$.
n = 10
for i in range(n):
pt.plot(x, x**i)
pt.vlines(np.linspace(0, 1, n), 0, 1, alpha=0.5, linestyle="--")
<matplotlib.collections.LineCollection at 0x7f6d60f82c88>
n = 5
V = np.array([np.linspace(0, 1, n)**i for i in range(n)]).T
la.cond(V)
686.43494181859546