In the finite element method for the numerical solution of elliptic partial differential equations, the stiffness matrix is a matrix that represents the system of linear equations that must be solved in order to ascertain an approximate solution to the differential equation.
For simplicity, we will first consider the Poisson problem
-\nabla2u=f
on some domain, subject to the boundary condition on the boundary of . To discretize this equation by the finite element method, one chooses a set of basis functions defined on which also vanish on the boundary. One then approximates
u ≈ uh=u1\varphi1+ … +un\varphin.
The coefficients are determined so that the error in the approximation is orthogonal to each basis function :
\intx\varphii ⋅ fdx=-\intx
2u | |
\varphi | |
i\nabla |
hdx=-\sumj\left(\intx
2\varphi | |
\varphi | |
jdx\right) |
uj=\sumj\left(\intx\nabla\varphii ⋅ \nabla\varphijdx\right)uj.
as a consequence of the homogenous Dirichlet boundary conditions. The stiffness matrix is the -element square matrix defined by
Aij=\intx\nabla\varphii ⋅ \nabla\varphijdx.
By defining the vector with components the coefficients are determined by the linear system . The stiffness matrix is symmetric, i.e., so all its eigenvalues are real. Moreover, it is a strictly positive-definite matrix, so that the system always has a unique solution. (For other problems, these nice properties will be lost.)
Note that the stiffness matrix will be different depending on the computational grid used for the domain and what type of finite element is used. For example, the stiffness matrix when piecewise quadratic finite elements are used will have more degrees of freedom than piecewise linear elements.
Determining the stiffness matrix for other PDEs follows essentially the same procedure, but it can be complicated by the choice of boundary conditions. As a more complex example, consider the elliptic equation
-\sumk,l
\partial | |
\partialxk |
\left(akl
\partialu | |
\partialxl |
\right)=f
where is a positive-definite matrix defined for each point in the domain. We impose the Robin boundary condition
-\sumk,l\nukakl
\partialu | |
\partialxl |
=c(u-g),
where is the component of the unit outward normal vector in the -th direction. The system to be solved is
\sumj\left(\sumk,l\int\Omegaakl
\partial\varphii | |
\partialxk |
\partial\varphij | |
\partialxl |
dx+\int\partial\Omegac\varphii\varphijds\right)uj=\int\Omega\varphiifdx+\int\partial\Omegac\varphiigds,
as can be shown using an analogue of Green's identity. The coefficients are still found by solving a system of linear equations, but the matrix representing the system is markedly different from that for the ordinary Poisson problem.
In general, to each scalar elliptic operator of order, there is associated a bilinear form on the Sobolev space, so that the weak formulation of the equation is
B[u,v]=(f,v)
for all functions in . Then the stiffness matrix for this problem is
Aij=B[\varphij,\varphii].
In order to implement the finite element method on a computer, one must first choose a set of basis functions and then compute the integrals defining the stiffness matrix. Usually, the domain is discretized by some form of mesh generation, wherein it is divided into non-overlapping triangles or quadrilaterals, which are generally referred to as elements. The basis functions are then chosen to be polynomials of some order within each element, and continuous across element boundaries. The simplest choices are piecewise linear for triangular elements and piecewise bilinear for rectangular elements.
The element stiffness matrix for element is the matrix
[k] | |
A | |
ij |
=
\int | |
Tk |
\nabla\varphii ⋅ \nabla\varphijdx.
The element stiffness matrix is zero for most values of and, for which the corresponding basis functions are zero within . The full stiffness matrix is the sum of the element stiffness matrices. In particular, for basis functions that are only supported locally, the stiffness matrix is sparse.
For many standard choices of basis functions, i.e. piecewise linear basis functions on triangles, there are simple formulas for the element stiffness matrices. For example, for piecewise linear elements, consider a triangle with vertices,,, and define the 2×3 matrix
D=\left[\begin{matrix}x3-x2&x1-x3&x2-x1\ y3-y2&y1-y3&y2-y1\end{matrix}\right].
Then the element stiffness matrix is
A[k]=
DTD | |
4\operatorname{area |
(T)}.
When the differential equation is more complicated, say by having an inhomogeneous diffusion coefficient, the integral defining the element stiffness matrix can be evaluated by Gaussian quadrature.
The condition number of the stiffness matrix depends strongly on the quality of the numerical grid. In particular, triangles with small angles in the finite element mesh induce large eigenvalues of the stiffness matrix, degrading the solution quality.