Contents Previous Next Subchapters Current Chapters-> kron inv trace det logdet rank cond null orth pinv cholesky lu svd qr qred eigen geneig eigsym symeig schur levinson tridiag BlockTriDiag Parent Chapters-> Omatrix6 linear tridiag Search Tools-> contents reference index search

Solving A Tridiagonal System Of Linear Equations
 Syntax `tridiag(`a`, `b`, `c`, `d`)` See Also BlockTriDiag , levinson , matrix division

Description
Returns a column vector `x`, with the same type and dimension as a, that solves the tridiagonal system of linear equations ```      a  x    +  b  x   +  c  x     = d    (i = 1, ... , n)       i  i-1     i  i      i  i+1     i ```where `n` is the number of rows in a. The column vector a is real, double-precision, or complex. The vector b, c, and d have the same type and dimension as a. ``` ```For `i = 1` the term involving `a` is not included in the equation above. Similarly, for `i = n` the term involving `c` is not included in the equation above. Thus the values of `a(1)` and `c(n)` have no effect. ``` ```Warning: This method may result in division by 0 unless ```      |b | > |a   | + |c   |.        i      i-1      i+1 ```
Example ```      a = {0., .2, .5}      b = {1., 1., 1.}      c = {.5, .2, .0}      d = {2., 3., 5.}      x = tridiag(a, b, c, d)      print x ``` returns ```      {      1      2      4      } ``` If you continue by entering ```      i = 2      a(i) * x(i - 1) + b(i) * x(i) + c(i) * x(i + 1) ``` O-Matrix will respond ```      3 ```