linalg(deprecated)
forwardsub
forward substitution on a matrix
Calling Sequence
Parameters
Description
Examples
forwardsub(L)
forwardsub(L, b, v)
L
-
lower row reduced matrix
b
vector or matrix
v
(optional) name
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[1], v[2], ..., 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.
with⁡linalg:
A≔array⁡1..3,1..4,1,−2,3,1,2,k,6,6,−1,3,k−3,0:
LUdecomp⁡A,L=l,U=u
1−2310k+40400kkk+4
b≔vector⁡1,2,3:
v1≔forwardsub⁡l,b
v1≔104
v2≔backsub⁡u,v1
v2≔−k2⁢_t1−k2+9⁢k⁢_t1+8⁢k+48k+4⁢k−4⁢_t1k+4−k⁢_t1−4⁢k−16k+4⁢k_t1
map⁡normal,evalm⁡b−A&*v2
000
See Also
linalg(deprecated)[backsub]
linalg(deprecated)[gausselim]
linalg(deprecated)[gaussjord]
linalg(deprecated)[linsolve]
linalg(deprecated)[LUdecomp]
LinearAlgebra
Download Help Document