I am a bit confused with nodal basis functions $h_i$ and the corresponding lagrange polynomials $l_i$. For linear functions, it's quite clear, on $[x_0,x_1]$ the nodal basis is $h_0 = l_0 = 1-x$.But with quadratic basis functions, there are $l_0^1 = 1-x^2$ and $l_0^2=\frac{(x-1)(x-2)}{2}$ associated with the node and the interval $[x_0,x_1]$. Further, the function $l_{-1}^3 = \frac{(x-0)(x-1)}{2}$ still has support from the left side as well.In this graphic this seems to be resolved by taking an interval $[x_0,x_2]$ for quadratic elements.I am currently trying to build some matrix $\langle h_i,h_j\rangle = \int h_i h_j$ and try to figure out, which functions need to be integrated together on an interval $[x_i, x_{i+1}]$. My current example is just a periodic 1D-Interval with edges $e_i = [x_i, x_{i+1}]$.Now i am confused, if i want to use the $h_i$ functions for this, or $l_i$ functions, and if i need to have distinctions if i am using the corresponding function to the left or right side or how i match the overlapping intervals when using functions, which have a support bigger than one interval.This is how my functions are overlapping on $[0,1]$ (so for example $1-x^2$ has support on two elements). So there are six functions on each interval and three on each node, just as the graphic linked above. But there the interval $[0,2]$ is used, so that the $1-x^2$ function is $0$ outside with some inner node not belonging to other elements, while i have only nodes on the limits of the elements, so the function has support on two elements as well.
Nodal basis functions and lagrange polynomials
finite element
By using basis functions, you are stating how a variable changes between nodes by knowing only information at the nodes. These nodes are used to 'fit' a set of polynomial basis functions, and then the field variable you are interested in is then a summation of each basis function with the corresponding value of your field variable at each node. Mathematically, you would write that as:$$ \phi = \sum_{i=1}^N H_i\hat{\phi}_i, \forall i$$where $N$ is the number of basis functions, and $H$ is the basis function itself, and $\hat{\phi}$ is the value of your field variable at the nodes. This is equivalent to the dot product of the vector of basis functions and the vector of nodal values, respectively:$$ \phi = \underline{H} \cdot \underline{\hat{\phi}} $$For every set of basis functions, the required number of points is dependent on the order of the basis function you want to use. For a set of linear basis functions (order = 1), you need 2 points. For quadratic (order = 2), you need 3 points, and so forth. Basically, you need the lowest number of points to fully define the polynomial.A quadratic basis function has the form:$$ H_i = \alpha_i + \beta_i x + \gamma_i x^2 $$Since it is quadratic, you need three points. Let's say we have $x = [x_1, x_2, x_3]$, then you could set up the following three equations for your first basis function to determine the polynomial coefficients, where it equals 1 at $x_1$ and 0 at the other nodes:$$\begin{array}{r c  l}H_1 = \alpha_1 + \beta_1 x_1 + \gamma_1 x_1^2 = 1 \\H_1 = \alpha_1 + \beta_1 x_2 + \gamma_1 x_2^2 = 0 \\H_1 = \alpha_1 + \beta_1 x_3 + \gamma_1 x_3^2 = 0 \\\end{array}$$NOTE: It's important to state that at a basis node $x_i$, only the corresponding basis function $H_i$ has a non-zero value of 1, all the others are 0. In other words $H_i(x_j) = \delta_{ij}$.You could solve this anyway you like, but I prefer putting it all together and solving for the coefficients using linear algebra:$$\left[ \begin{matrix}1 & x_1 & x_1^2 \\1 & x_2 & x_2^2 \\1 & x_3 & x_3^2 \\\end{matrix} \right] \left[\begin{matrix}\alpha_1 & \alpha_2 & \alpha_3 \\\beta_1 & \beta_2 & \beta_3 \\\gamma_1 & \gamma_2 & \gamma_3 \\\end{matrix}\right] = \left[\begin{matrix}1 & 0 & 0 \\0 & 1 & 0 \\0 & 0 & 1 \\\end{matrix}\right]$$Plugging in your solution for $\alpha_i, \beta_i, $ and $\gamma_i, \forall i$ back into the basis equations gives you your set of fitting polynomials, which combine together using our original equation of:$$ \phi = \sum_{i=1}^N H_i\hat{\phi}_i, \forall i$$I used a sample set of values (y = [2 3 1.5]) at x = [-1, 0, 1], and this was the end result. You see how a quadratic function fits through the three original points, and that the three basis functions themselves are the 'weights' of the sample points showing how the field variable changes between the basis nodes.