Tridiagonal matrix algorithm/Derivation: Difference between revisions
Appearance
Content deleted Content added
Jitse Niesen (talk | contribs) remove {{db-pagemove}} - does not seem vandalism to me; see Wikipedia talk:WikiProject Mathematics/Proofs |
Jitse Niesen (talk | contribs) replace by #REDIRECT tridiagonal matrix algorithm since this page was merged there |
||
Line 1: | Line 1: | ||
#REDIRECT [[tridiagonal matrix algorithm]] |
|||
Suppose that the unknowns are <math>x_1,\ldots, x_n</math>, and that the equations to be solved are: |
|||
:<math>\begin{array}{lcl} |
|||
b_1 x_1 + c_1 x_2 = d_1 \qquad &;& \ i = 1 \\ |
|||
a_i x_{i - 1} + b_i x_i + c_i x_{i + 1} = d_i \qquad &;& \ i = 2, \ldots, n - 1 \\ |
|||
a_n x_{n - 1} + b_n x_n = d_n \qquad &;& \ i = n \\ |
|||
\end{array} |
|||
\,</math> |
|||
Consider modifying the second (<math>i = 2</math>) equation with the first equation as follows: |
|||
:<math> |
|||
(\mbox{equation 2}) \cdot b_1 - (\mbox{equation 1}) \cdot a_2 |
|||
</math> |
|||
which would give: |
|||
:<math> |
|||
(a_2 x_1 + b_2 x_2 + c_2 x_3) b_1 - (b_1 x_1 + c_1 x_2) a_2 = d_2 b_1 - d_1 a_2 |
|||
\,</math> |
|||
:<math> |
|||
(b_2 b_1 - c_1 a_2) x_2 + c_2 b_1 x_3 = d_2 b_1 - d_1 a_2 |
|||
\,</math> |
|||
and the effect is that <math>x_1</math> has been eliminated from the second equation. Using a similar tactic with the '''modified''' second equation on the third equation yields: |
|||
:<math> |
|||
(a_3 x_2 + b_3 x_3 + c_3 x_4) (b_2 b_1 - c_1 a_2) - |
|||
((b_2 b_1 - c_1 a_2) x_2 + c_2 b_1 x_3) a_3 |
|||
= d_3 (b_2 b_1 - c_1 a_2) - (d_2 b_1 - d_1 a_2) a_3 |
|||
\,</math> |
|||
:<math> |
|||
(b_3 (b_2 b_1 - c_1 a_2) - c_2 b_1 a_3 )x_3 + c_3 (b_2 b_1 - c_1 a_2) x_4 |
|||
= d_3 (b_2 b_1 - c_1 a_2) - (d_2 b_1 - d_1 a_2) a_3 |
|||
\,</math> |
|||
This time <math>x_2</math> was eliminated. If this procedure is repeated until the <math>n^{th}</math> row; the (modified) <math>n^{th}</math> equation will involve only one unknown, <math>x_n</math>. This may be solved for and then used to solve the <math>(n - 1)^{th}</math> equation, and so on until all of the unknowns are solved for. |
|||
Clearly, the coefficients on the modified equations get more and more complicated if stated explicitly. By examining the procedure, the modified coefficients (notated with tildes) may instead be defined recursively: |
|||
:<math>\tilde a_i = 0\,</math> |
|||
:<math>\tilde b_1 = b_1\,</math> |
|||
:<math>\tilde b_i = b_i \tilde b_{i - 1} - \tilde c_{i - 1} a_i\,</math> |
|||
:<math>\tilde c_1 = c_1\,</math> |
|||
:<math>\tilde c_i = c_i \tilde b_{i - 1}\,</math> |
|||
:<math>\tilde d_1 = d_1\,</math> |
|||
:<math>\tilde d_i = d_i \tilde b_{i - 1} - \tilde d_{i - 1} a_i\,</math> |
|||
To further hasten the solution process, <math>\tilde b_i</math> may be divided out (if there's no division by zero risk), the newer modified coefficients notated with an asterisk will be: |
|||
:<math>a'_i = 0\,</math> |
|||
:<math>b'_i = 1\,</math> |
|||
:<math>c'_1 = \frac{c_1}{b_1}\,</math> |
|||
:<math>c'_i = \frac{c_i}{b_i - c'_{i - 1} a_i}\,</math> |
|||
:<math>d'_1 = \frac{d_1}{b_1}\,</math> |
|||
:<math>d'_i = \frac{d_i - d'_{i - 1} a_i}{b_i - c'_{i - 1} a_i}\,</math> |
|||
This gives the following system with the same unknowns and coefficients defined in terms of the original ones above: |
|||
:<math>\begin{array}{lcl} |
|||
x_i + c'_i x_{i + 1} = d'_i \qquad &;& \ i = 1, \ldots, n - 1 \\ |
|||
x_n = d'_n \qquad &;& \ i = n \\ |
|||
\end{array} |
|||
\,</math> |
|||
The last equation involves only one unknown. Solving it in turn reduces the next last equation to one unknown, so that this backward substitution can be used to find all of the unknowns: |
|||
:<math>x_n = d'_n\,</math> |
|||
:<math>x_i = d'_i - c'_i x_{i + 1} \qquad ; \ i = n - 1, n - 2, \ldots, 1</math> |
|||
[[Category:Numerical linear algebra]] |
Latest revision as of 01:51, 9 September 2008
Redirect to: