124 views

Uploaded by Ricardo Vale

c++

- Stiff Reaction Diffusion
- J .Weickert - Efficient and Reliable Schemes for Nonlinear Diffusion Filtering
- Numrical Methods or Finding Complex Roots
- Computer Based Numerical and Statistical Techniques
- selva_wec_sarawak
- jeyavel
- A Theory of Latticed Plates and Shells.pdf
- F2L Feliks Zemdegs
- Choosing a Solver(1)
- luis 59
- A Short Review of Fuzzy Linear Equation Systems
- 777_1
- fem_notes
- Problem Page 199 New
- Stellenausschreibung InuTech INSIST Nov2011
- General Info
- New
- 2.Transportation Method
- fomsyllabus
- 14 Interpolation I.pdf

You are on page 1of 3

Page 1 of 3

TridiagonalHelpmatrix

algorithm

The tridiagonal matrix algorithm (TDMA), also known as the Thomas algorithm, is a simplified

form of Gaussian elimination that can be used to solve tridiagonal systems of equations. A

tridiagonal system may be written as

where

and

For such systems, the solution can be obtained in O(n) operations instead of O(n3) required by

Gaussian elimination. A first sweep eliminates the ai's, and then an (abbreviated) backward

substitution produces the solution. Example of such matrices commonly arise from the discretization

of 1D problems (e.g. the 1D Poisson problem).

Contents

1 Method

1.1 Implementation in C

2 Variants

3 References

4 External links

Method

See the derivation.

The first step consists of modifying the coefficients as follows, denoting the new modified

coefficients with primes:

http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm

10/6/2007

Page 2 of 3

This is the forward sweep. The solution is then obtained by back substitution:

Implementation in C

The following C function will solve a general tridiagonal system. Note that the index i here is zero

based, in other words

where n is the number of unknowns.

//Fills solution into x. Warning: will modify c and d!

void TridiagonalSolve(const double *a, const double *b, double *c, double *d, double *x, unsigned int

int i;

//Modify the coefficients.

c[0] = c[0]/b[0];

d[0] = d[0]/b[0];

double id;

for(i = 1; i != n; i++){

id = 1.0/(b[i] - c[i - 1]*a[i]);

c[i] = c[i]*id;

d[i] = (d[i] - a[i]*d[i - 1])*id;

}

//Last value calculated is redundant.

x[n - 1] = d[n - 1];

for(i = n - 2; i != -1; i--)

x[i] = d[i] - c[i]*x[i + 1];

}

Variants

In some situations, particularly those involving periodic boundary conditions, a slightly perturbed

form of the tridiagonal system may need to be solved:

In this case, we can make use of the Sherman-Morrison formula to avoid the additional operations of

Gaussian elimination and still use the Thomas algorithm.

In other situations, the system of equations may be block tridiagonal (see block matrix), with

smaller submatrices arranged as the individual elements in the above matrix system(e.g. the 2D

Poisson problem). Simplified forms of Gaussian elimination have been developed for these

situations.

References

http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm

10/6/2007

Page 3 of 3

Conte, S.D., and deBoor, C. (1972). Elementary Numerical Analysis. McGraw-Hill, New

York..

This article incorporates text from the article matrix algorithm - TDMA (Thomas algorithm)

Tridiagonal matrix algorithm - TDMA (Thomas algorithm) (http://www.cfdonline.com/Wiki/Tridiagonal) on CFD-Wiki (http://www.cfd-online.com/Wiki/Main_Page)

that is under the GFDL license.

External links

IDCategorie=AlgoScilab&IDTitre=182)

(http://www.arbredeslemuriens.com/Categorie.php?IDCategorie=AlgoScilab&IDTitre=185)

Retrieved from "http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm"

Category: Numerical linear algebra

All text is available under the terms of the GNU Free

Documentation License. (See Copyrights for details.)

Wikipedia is a registered trademark of the Wikimedia

Foundation, Inc., a U.S. registered 501(c)(3) tax-deductible

nonprofit charity.

http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm

10/6/2007

- Stiff Reaction DiffusionUploaded byDnl Ganesh
- J .Weickert - Efficient and Reliable Schemes for Nonlinear Diffusion FilteringUploaded bySamuSan86
- Numrical Methods or Finding Complex RootsUploaded byyugandhar_yadam
- Computer Based Numerical and Statistical TechniquesUploaded bymohdafaq
- selva_wec_sarawakUploaded byasifiqbal84
- jeyavelUploaded byssankaralakshmi
- A Theory of Latticed Plates and Shells.pdfUploaded byAnonymous 9IbJK5jhVN
- F2L Feliks ZemdegsUploaded byNik Quaqua Quaresima
- Choosing a Solver(1)Uploaded bysnthej
- luis 59Uploaded byJosé santana
- A Short Review of Fuzzy Linear Equation SystemsUploaded byfisnunes4447
- 777_1Uploaded byAKHIL PASULA
- fem_notesUploaded byRusmir Kopić
- Problem Page 199 NewUploaded byWildatus Sholichah
- Stellenausschreibung InuTech INSIST Nov2011Uploaded byHelal Uddin Chowdhury
- General InfoUploaded byjames
- NewUploaded byVaibhav Agrawal
- 2.Transportation MethodUploaded byPrashanth Shetty
- fomsyllabusUploaded byKaran Jain
- 14 Interpolation I.pdfUploaded byTharun Raj Rockzz
- PDS Kelompok 1 (1server)Uploaded bysyifa
- Error#Lect2Uploaded byIbrahim
- SC Lecture 0 2014Uploaded byphsieh007
- Hojabri Et AlUploaded byssivakumars
- LabUploaded byHeenaAggarwal
- 4.3 Bounded algorithmUploaded byDuaa Raja
- Class DemonstrationUploaded byKushagra Manik
- c_fileUploaded byAnkit Goel
- Id SolveUploaded byRoman Kulishenko
- FelsenUploaded byasg_rus

- 2013-03-24 - Passion Sunday Year CUploaded byCatholic Parish of Forster-Tuncurry
- 1. PEER EVALUATION_MODIFIED (Mohammed Musah's Conflicted Copy 2016-02-18) (1)Uploaded byHanif Malek
- The World English Bible (WEB): Isaiah by AnonymousUploaded byGutenberg.org
- PEOL Fiori Case StudyUploaded byPeol Solutions
- Etruscan Basic Lexicon a SynopsisUploaded byalexandreq
- 26 February-4 March 2011Uploaded bypratidin
- Primary Programme for Best IB Results International School China GuangzhouUploaded byUtahloy
- ManagingUploaded byksbanwar
- Neurological DysfunctionUploaded byjoycechicago
- 123BW032017Uploaded byVara Lakshmi
- Mutual Funds in Nepal.pptxUploaded byRupesh Nyaupane
- Evidence Part 6Uploaded byChedeng Kuma
- Principles of Vascular and Intravascular Ultrasound [PDF][tahir99] VRG.pdfUploaded byabidalik123
- Day 2 WebquestUploaded byMarkJLanza
- Oral Health TutorialUploaded byKelley
- Building the Dynamic Reservoir Model (2)Uploaded by조호범
- bulletin november 10 2018Uploaded byapi-242081048
- New York NY Sun 1905 Jan-Dec Grayscale - 0439 (Aso-neith Cryptogram)Uploaded bypgeronazzo8450
- letter of def susp - l g re 12finalUploaded byapi-287826317
- Embedded Server Seminar Prague IntroUploaded byJesus Lopez
- History of Ecological Sciences Part 1Uploaded bySusana Peluc
- Goodbye Helter Skelter PDFUploaded bySylvia
- Settlement Analyses of Grade Supported Tanks Constructed With ThUploaded byvirat_dave
- WHAM TheoryUploaded byAffNeg.Com
- Quality ManagementUploaded byTifarie Luesas
- DR RAU Pleomorphic On_the_NatureUploaded byEleoura
- Final Assignment International BusinessUploaded byKishin Sham Mahtani
- Sample Chapter11Uploaded byCosimo Accoto
- Liber A'ash vel Capricorni.pdfUploaded byibarzabal
- Concept of Hiba Under Muslim LawUploaded byHARSHIT MAHALWAL