Content deleted Content added
Fgnievinski (talk | contribs) No edit summary |
StephanSp3 (talk | contribs) Add section "Applications" with example about discretization of heat equation |
||
Line 133:
A tridiagonal matrix can also be stored more efficiently than a general matrix by using a special [[matrix representation|storage scheme]]. For instance, the [[LAPACK]] [[Fortran]] package stores an unsymmetric tridiagonal matrix of order ''n'' in three one-dimensional arrays, one of length ''n'' containing the diagonal elements, and two of length ''n'' − 1 containing the [[subdiagonal]] and [[superdiagonal]] elements.
==Applications==
The discretization in space of the one-dimensional diffusion or [[heat equation]]
:<math>\frac{\partial u(t,x)}{\partial t} = \alpha \frac{\partial^2 u(t,x)}{\partial x^2}</math>
using second order central [[finite differences]] results in
:<math>
\begin{pmatrix}
\frac{\partial u_{1}(t)}{\partial t} \\
\frac{\partial u_{2}(t)}{\partial t} \\
\vdots \\
\frac{\partial u_{N}(t)}{\partial t}
\end{pmatrix}
= \frac{\alpha}{\Delta x} \begin{pmatrix}
-2 & 1 & 0 & \ldots & 0 \\
1 & -2 & 1 & \ddots & \vdots \\
0 & \ddots & \ddots & \ddots & 0 \\
\vdots & & 1 & -2 & 1 \\
0 & \ldots & 0 & 1 & -2
\end{pmatrix}
\begin{pmatrix}
u_{1}(t) \\
u_{2}(t) \\
\vdots \\
u_{1}(t) \\
\end{pmatrix}
</math>
with discretization constant <math>\Delta x</math>. The matrix is tridiagonal with <math>a_{i}=-2</math> and <math>b_{i}=c_{i}=1</math>. Note: no boundary conditions are used here.
==See also==
|