Prerequisite Gauss-Lobatto
FEDVR base
1Now take the one-dimensional FEDVR as an example, divide the entire interval into $N_e$ finite elements, the interval of the $i$th finite element is $[x_i,x_{i+1}]$. Each finite element is further added with grid points, so that $x_{ij}\ (j = 1\dots N)$ is the $N$ order of the $i$ finite element. Gauss-Lobatto numerical integrationOf $N$ sampling points. Thus, $x_{j1}=x_j$, $x_{jN}=x_{j+1}$.
Now let's define the FEDVR base $u_{ij}(x)$. Let $a_i$ be half of the length of the $i$th FE, $b_i$ is the midpoint coordinate of the $i$th FE, and put $f_n(x)$ in eq. 6 ($x$ exceeds $[-1,1]$ seasonal $f_n(x) = 0$) is recorded as $f_n(t)$, and $t \in [-1,1]$ is linearly mapped to the interval $x \in [x_i, x_{i+1}]$ of each finite element in turn, there is
\begin{equation}
x_{ij} = a_i t_j + b_i
\end{equation}
\begin{equation}
x = a_i t + b_i \qquad (x_{i1} \leqslant x \leqslant x_{iN})
\end{equation}
Then the basis is defined as
\begin{equation}
u_{ij}(x) = \left\{\begin{aligned}
&\frac{1}{\sqrt{a_i}} f_j \left(\frac{x-b_i}{a_i} \right) \qquad &&( 1 < j < N) \\
& \frac{1}{\sqrt{a_i+a_{i+1}}} \left[f_N \left(\frac{x-b_i}{a_i} \right) + f_1 \left(\frac{x-b_{i+1}}{a_{i+1}} \right) \right]
\quad &&(j = N)
\end{aligned}\right. \end{equation}
Easy Proof Orthogonal Normalization Relation
\begin{equation}
\int_{x_1}^{x_{N_e+1}} u_{ij}(x) u_{i'j'}(x) \,\mathrm{d}{x} = \delta_{ii'} \delta_{jj'}
\end{equation}
At both ends of the total interval, we generally use the boundary condition with the function value of zero, so $u_{11}(x)$ and $u_{N_e, N}(x)$ are not defined. In this way, we finally have a total of $N_e(N-1)-1$ nodes $x_{ij}$ and the corresponding base $u_{ij}(x)$. Let $w_{0i}$ be the $w_i$ in
eq. 6 , then the function value of each base at each node is
\begin{equation}
u_{ij}(x_{i'j'}) = \delta_{ii'}\delta_{jj'}\times \left\{\begin{aligned}
&\frac{1}{\sqrt{a_i w_{0j}}} \qquad &&( 1 < j < N) \\
& \frac{1}{\sqrt{(a_i+a_{i+1}) w_{0N}}} \qquad &&(j = N)
\end{aligned}\right. \end{equation}
It is easy to prove that if you want to integrate the entire interval, the required weight is
\begin{equation}
w_{ij} = \frac{1}{u_{ij}^2(x_{ij})} =
\begin{cases}
a_i w_{0j} &(1 < j < N) \\
(a_i + a_{i+1}) w_{0N} &(j = N)
\end{cases}
\end{equation}
But if you only need to do integration in a certain FE interval, you only need to use $w_{ij} = a_i w_{0j}$.
A function $f(x)$ expands to
\begin{equation}
\left\langle u_{ij}(x) \middle| f(x) \right\rangle = \int_{x_1}^{x_{N_e+1}} u_{ij}(x) f(x) \,\mathrm{d}{x} \approx \sqrt{w_{ij}} f(x_{ij})
\end{equation}
Sort all bases according to the corresponding $x_{ij}$ from smallest to largest. The expansion coefficient of $f(x)$ can be recorded as a column vector.
Kinetic Energy Operator
Using partial integrals, the kinetic energy matrix element can be expressed as the inner product of the derivative functions of the two bases2
\begin{equation} \begin{aligned}
K_{ij} &= -\frac12 \left\langle u_i \middle| \frac{\mathrm{d}^{2}}{\mathrm{d}{x}^{2}} \middle| u_j \right\rangle = -\frac12 \int u_i(x) u_j''(x) \,\mathrm{d}{x} \\
&= -\frac12 \left. u_i(x) u'_j(x) \right\rvert _{x_1}^{x_2} + \frac12 \int u'_i(x) u_j'(x) \,\mathrm{d}{x} \\
&= \frac12 \left\langle u'_i(x) \middle| u_j'(x) \right\rangle
\end{aligned} \end{equation}
It can be seen that $ \boldsymbol{\mathbf{K}} $ is a real symmetric matrix. This integral can be accurately represented by summation, and only $u_i(x), u_j(x)$ in the same FE can make the integral non-zero (bridge function belongs to two FEs), so we get almost a block diagonalized matrix, but each block is at the top left A matrix element in the corner and the lower right corner overlaps with other blocks.
How to calculate the derivative of the basis function? It can be obtained by calculating the derivative of Legendre interpolation polynomial
\begin{equation} \begin{aligned}
&f_i'(t_j) =\frac{1}{\sqrt{w_{0i}}} \times\\
& \left\{\begin{aligned}
&\frac{t_j-t_1}{t_i-t_1} \frac{t_j-t_2}{t_i-t_2} \dots \frac{1}{t_i-t_j} \dots \frac{t_j-t_{i-1}}{t_i-t_{i-1}}\frac{t_j-t_{i+1}}{t_i-t_{i+1}} \dots \frac{t_j-t_N}{t_i-t_N} \qquad &&(i \ne j) \\
& \frac{1}{t_i-t_1} + \dots + \frac{1}{t_i-t_{i-1}} + \frac{1}{t_i-t_{i+1}} + \dots \frac{1}{t_i-t_N} \quad &&(i = j)
\end{aligned}\right. \end{aligned} \end{equation}
Substitute
\begin{equation}
u'_{ij}(x_{ij'}) = \frac{1}{a_i^{3/2}} f'_j \left(t_{j'} \right) \qquad ( 1 < j < N)
\end{equation}
\begin{equation}
u'_{iN}(x_{i j'}) = \frac{1}{a_i\sqrt{a_i+a_{i+1}}} f'_N \left(t_{j'} \right)
\end{equation}
\begin{equation}
u'_{iN}(x_{i+1, j'}) = \frac{1}{a_{i+1}\sqrt{a_i+a_{i+1}}} f'_1 \left(t_{j'} \right)
\end{equation}
Note that the left and right derivatives of $u'_{iN}$ at $x_{iN}$ are not equal.
Now you can find the matrix elements of the kinetic energy matrix (because it is a symmetric matrix, we only list half sides), first look at the matrix elements without bridge function
\begin{equation} \begin{aligned}
K_{(im), (in)} &= \frac12 \int_{x_{i1}}^{x_{iN}} u'_{im}(x) u'_{in}(x) \,\mathrm{d}{x} \\
&= \frac12 \sum_k a_i w_{0k} u'_{im}(x_{ik}) u'_{in}(x_{ik}) \\
&= \frac{1}{2a_i^2} \sum_k w_{0k} f'_m(t_k) f'_n(t_k)
\qquad (1 < m \leqslant n < N)
\end{aligned} \end{equation}
Look at the matrix element with bridge function
\begin{equation} \begin{aligned}
K_{(im), (iN)} &= \frac12 \int_{x_{i1}}^{x_{iN}} u'_{im}(x) u'_{iN}(x) \,\mathrm{d}{x} \\
&= \frac{1}{2a_i^{3/2} \sqrt{a_i + a_{i+1}}} \sum_k w_{0k} f'_m(t_k) f'_N(t_k)
\qquad (1 < m < N)
\end{aligned} \end{equation}
\begin{equation} \begin{aligned}
K_{(iN), (iN)} &= \frac12 \int_{x_{i1}}^{x_{iN}} u'_{iN}(x)^2 \,\mathrm{d}{x} + \frac12 \int_{x_{i+1,1}}^{x_{i+1,N}} u'_{i+1,1}(x)^2 \,\mathrm{d}{x} \\
&= \frac{1}{2(a_i + a_{i+1})} \sum_k w_{0k} \left[\frac{1}{a_i} f'_N(t_k)^2 + \frac{1}{a_{i+1}} f'_1(t_k)^2 \right]
\end{aligned} \end{equation}
\begin{equation} \begin{aligned}
K_{(iN), (i+1,n)} &= \frac12 \int_{x_{i+1,1}}^{x_{i+1,N}} u'_{i,N}(x) u'_{i+1,n}(x) \,\mathrm{d}{x} \\
&= \frac{1}{2 a_{i+1}^{3/2} \sqrt{a_i + a_{i+1}}} \sum_k w_{0k} f'_1(t_k) f'_n(t_k)
\qquad (1 < n < N)
\end{aligned} \end{equation}
\begin{equation} \begin{aligned}
K_{(iN), (i+1,N)} &= \frac12 \int_{x_{i+1,1}}^{x_{i+1,N}} u'_{i,N}(x) u'_{i+1,N}(x) \,\mathrm{d}{x} \\
&= \frac{1}{2a_{i+1}\sqrt{(a_i + a_{i+1})(a_{i+1}+a_{i+2})}} \sum_k w_{0k} f'_1(t_k) f'_N(t_k)
\end{aligned} \end{equation}
Potential Energy Matrix
\begin{equation}
V_{\alpha\beta} = \int_{x_1}^{x_{N_e+1}} u_n^j (x) u_{n'}^{j'} (x) V(x) \,\mathrm{d}{x} = \end{equation}
1. ^ Refer to Aihua Liu's Doctoral Dissertation (KSU, 2015).
2. ^ Unfinished: It is not rigorous! Because not all bases are smooth, the constant term of partial integral may not be eliminated.