1. Theory
1.1. The pseudospectral method
In the pseudospectral method a function \(f(x)\) is approximated as a linear combination
of cardinal functions \(g_j(x)\) where the expansion coefficients are values of \(f(x)\) at the grid points \(x_j\). For Lobatto-type grids, the interior grid points \(\{ x_j \}_{j=1}^{N-1}\) are defined as the zeros of \(P_N^\prime(x)\), where \(P_N(x)\) is a \(N\)-th order polynomial [1],
while the end (boundary) points \(x_0\) and \(x_N\) are given.
The cardinal functions \(g_j(x)\) have the property that
and can be written as
The integral of a function is approximated by quadrature
where \(w_j\) are the quadrature weights.
Footnotes
1.2. Gauss-Legendre-Lobatto
In the Gauss-Legendre-Lobatto pseudospectral method, \(P_N(x)\) is taken as the \(N\)-th order Legendre polynomial. The end points are \(x_0 = -1\) and \(x_N=1\), while the interior grid points must be found as the roots
and the quadrature weights are given by
The grid points and weights can be determined using numpy functions (REF). Furthermore,
and for \(i,j = 1,\cdots,N-1\)