I have just started looking into finite element methods.
Suppose we have an equation for the strong $$L(u) = s$$
Then the integral form of the equation is given by $$\int_0^1 L(u)w(x) dx = \int_0^1 sw(x)dx$$ and "the choice of the weight function $w(x)$ defines the type of the scheme."
Questions
- Why do we need a weight function in the first place.
- How does it define the type of the scheme?
- What would be two examples of such weight functions that could help illustrate how they define the type of the scheme?
You usually require that the integral equation is satisfied for a whole class of weight functions $w \in W$, where $W$ is a vector space. Conceptually the transformation into an integral equation is a projection of the equation with respect to the $L^2$ inner product onto $W$.
The Galerkin method, of which the finite element method is a special case, is searching for an approximate solution using this projected equation alone. Therefore the amount of information loss, i.e. the smallness of $W$, is crucial for the approximation quality. (Formally the approximate solution is simply a function $v \in V$ which satisfies the integral equation, where $V$ is another vector space and one hopes that $v \approx u$ in some sense.)
If $W$ is large enough no information is lost and the integral equation equivalent to the original equation. If $W$ is small, e.g. $W$ consists of constant functions only, there is no hope that the approximate solution has anything to do with the real solution in general.
For computational purposes $W$ (and $V$) must be finite-dimensional, as this yields a system of algebraic equations which can be solved on the computer. In the finite element method those spaces are chosen such that this system has nice computational properties — in practice spaces of piece-wise polynomial functions.
Two different schemes could use piece-wise linear and piece-wise quadratic polynomials, for example. But it's hard to get an intuitive understanding how exactly the projected equations change if higher order polynomials are used. In practice the choice of $W$ is often driven by the choice of $V$, such that the system is non-singular and convergence is guaranteed (often $V=W$). $V$ on the other hand is driven by the requirements on the approximate solution $v$.