0% found this document useful (0 votes)
30 views2 pages

Definition. A Matrix Is Upper-Triangular If - 0 0 0 - 0 0 - . - . 0 - . - .

This document describes algorithms for solving systems of linear equations Ax = b. It first defines an upper triangular matrix and provides an algorithm for backward substitution to solve upper triangular systems. It then presents the Gaussian elimination algorithm to convert a general matrix A into upper triangular form. Finally, it notes that the MATLAB command x = A\b can be used to solve Ax = b by performing Gaussian elimination and backward substitution in a single step.

Uploaded by

pinkangel1337
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Definition. A Matrix Is Upper-Triangular If - 0 0 0 - 0 0 - . - . 0 - . - .

This document describes algorithms for solving systems of linear equations Ax = b. It first defines an upper triangular matrix and provides an algorithm for backward substitution to solve upper triangular systems. It then presents the Gaussian elimination algorithm to convert a general matrix A into upper triangular form. Finally, it notes that the MATLAB command x = A\b can be used to solve Ax = b by performing Gaussian elimination and backward substitution in a single step.

Uploaded by

pinkangel1337
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Definition. A matrix A = (aij ) is upper-triangular if aij = 0 i > j .

a11

0
0

Algorithm.

a 22
0
0

a n 1,n

a nn
a1n
a2n
.
.
.


0 0 a n 1,n 1
0 0
0

Backward Substitution.

Given the upper-triangular nxn matrix A with a[i][i] != 0.0 (i = 1,...n)


and the n-vector b. Construct the entries x[n], x[n-1],...,x[1] of the
solution vector x of Ax = b.

for (k = n; k > 0; k--) {


x[k] = b[k];
for (j = k+1; j <= n; j++)
x[k] = x[k] a[k][j]*x[j];
//endfor j
x[k] = x[k] / a[k][k];
}//endfor k

bk
Note: The k-loop body performs x k =

j = k +1

a kk

kj

xj
.

Algorithm.

Gaussian Elimination (with pivoting when necessary)

Start with Ax = b where A is an nxn matrix and b is an n-vector.


On exit, Ax = b will be an equivalent system with A upper-triangular.
for (k = 1; k < n; k++) { // Eliminate column k below the main diagonal.
find the smallest i (i >= k) such that a[i][k] != 0.0;
if no such i exists
return "not invertible";
//endif
exchange rows k and i; // called "pivoting"
for (i = k+1; i <= n; i++) { // Process row i.
m[i][k] = a[i][k] / a[k][k];
for (j = k+1; j <= n; j++) // Alter column j of row i.
a[i][j] = a[i][j] m[i][k]*a[k][j];
//endfor j
b[i] = b[i] m[i][k]*b[k];
}//endfor i
}//endfor k
if (a[n][n] == 0.0)
return "not invertible";
//endif

Notes:
1) Step k eliminates column k below the main diagonal, working on rows
i = k+1, k+2, , n.
a
2) The i-loop performs ROW # i = ROW # i ik ROW # k , modifying columns
a kk
j = k+1, k+2, , n and then the right hand side.
3) smallest i?? This just says to select the very first non-zero column k entry you come
upon, first looking at row k, then row k+1 if necessary, then row k+2, etc.
Summary: To solve Ax = b ,
1) Apply the Gaussian Elimination algorithm to convert to an upper-triangular system.
2) Do the backward substitution algorithm on the upper-triangular part of A .

Solving Ax = b by Gaussian elimination and backward substitution in Matlab requires


only a single simple statement:
x = A\b

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy