[Link]-methods.
com
M-files Numerical Methods Library
Matlab, Freemat, Octave and Scilab
Module
LUfbsub_tests.m LUfbsub_tests.sci
Title
Tests on LUfbsub.m [Link] that carry out forward and back
substitution for real or complex systems.
Description
This file contains several test problems that demonstrate the m-file
LUfbsub.m and [Link] that carries out the forward and back
substitution to solve problems of the form
L U x = P b (1)
to find the solution vector x, where L is a lower-triangular matrix, U
is an upper triangular matrix and P is a permutation matrix, b is a
known vector and x is the vector that is sought.
The matrices L, U and P normally arise as the result of an LU
factorisation of a matrix A; A=LU. If this is the case then the
solution of the equation above is also the solution of
A x = P b. (2)
A number of standard test problems of various dimensions which
are also used on the spreadsheet of examples [Link], and with
A and b real, in which the solution is known are included in thus
set of tests
The solution of an equation like (2) can be solved straightforwardly
in Matlab, Freemat, Octave and Scilab using the command
x = A \ b (3)
Hence comparing the solution of [L,U,P]=lu(A) followed by
x=LUfbsubs(L, U, n, P, b) with (3) also provides a method for
devising test problems. Some of the test problems are based on
this and complex matrices and vectors are included.
Interface
LUfbsub_tests()
[Link]
Web source of
code.
[Link]
[Link]
Web source of
this guide
[Link]
Web source of
the algorithm
[Link] [Link]
Dependent
routines
NONE
Test file
or file being
tested
This file tests the code in the LUfbsub function
[Link]
Licence
This is open source; the software may be used and applied within other
systems or re-published as long as its provenance is appropriately
acknowledged.
See the GNU Licence for more information or contact
webmaster@[Link]
Similar codes
that may be of
interest
CLUTESTS, [Link]-
[Link]/fortran/CLUTESTS_FOR.htm , for complex-valued
systems
LUTESTS, [Link]/fortran/LUTESTS_FOR.htm ,
for real-valued systems
[Link], [Link]/Excel_VBA/[Link]
For the method in visual basic / VBA (Excel)
Bibilography
Solution of Linear Systems of Equations (Matlab/Freemat/Scilab/Octave)
Linear Systems and 2x2 Matrices
Tutorials on Matlab/Freemat
Numerical Methods