forward substitution on a matrix
forwardsub(L, b, v)
lower row reduced matrix
vector or matrix
Important: The linalg package has been deprecated. Use the superseding packages LinearAlgebra[ForwardSubstitute], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
forwardsub generates a solution vector x to the equation L⁢x=b.
If b is omitted, or b is 'false' then L is assumed to be an augmented matrix and the last column of L is used in place of b.
If b is a matrix, then x (the solution) will also be a matrix with the same number of columns.
If L is the result of applying Gaussian elimination to the augmented matrix of a system of linear equations, as might be obtained from LUdecomp, forwardsub completes the solution by forward substitution. If a solution exists, it is returned as a vector. If no solution exists, an error will be generated.
If the solution is not unique, it will be parameterized in terms of the symbols v, v, ..., etc. or v[1,k], v[2,k], ... as in the case where b is a matrix. If the third argument v is not specified, the global variable _t will be used.
The input matrix must be in row-echelon form with all zero rows grouped at the top. Such a matrix is produced by obtaining the LU decomposition.
The command with(linalg,forwardsub) allows the use of the abbreviated form of this command.
A ≔ array⁡1..3,1..4,1,−2,3,1,2,k,6,6,−1,3,k−3,0:
b ≔ 123:
v1 ≔ forwardsub⁡l,b
v2 ≔ backsub⁡u,v1
map⁡normal,evalm⁡b−A &* v2
Download Help Document