linalg(deprecated)
backsub
back substitution on a matrix
Calling Sequence
Parameters
Description
Examples
backsub(U)
backsub(U, b, v)
U
-
row reduced matrix
b
vector or matrix
v
(optional) name
Important: The linalg package has been deprecated. Use the superseding packages, LinearAlgebra and VectorCalculus, instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
backsub generates a solution vector x to the equation U⁢x=b.
If b is omitted, or b is 'false' then U is assumed to be an augmented matrix and the last column of U 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 U is the result of applying forward Gaussian elimination to the augmented matrix of a system of linear equations, as might be obtained from gausselim or gaussjord, backsub completes the solution by back 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 bottom. Such a matrix is produced by applying gausselim or gaussjord to the augmented matrix of a system of linear equations or by obtaining the LU decomposition.
The command with(linalg,backsub) allows the use of the abbreviated form of this command.
with⁡linalg:
A≔randmatrix⁡3,4:
F≔gausselim⁡A
F≔−722−55−94015227−47857−8612700−566331522−56043761
backsub⁡F
−1980256633319375663311208656633
H≔matrix⁡1,2,3,2,1,3,1,−1,0:
v≔vector⁡1,2,1:
A≔augment⁡H,v
A≔123121321−101
F≔gaussjord⁡A
F≔101101100000
1−_t1−_t1_t1
backsub⁡F,false,x
1−x1−x1x1
u≔LUdecomp⁡H,L=l
u≔1230−3−3000
e≔forwardsub⁡l,v
e≔100
f≔backsub⁡u,e,s
f≔1−s1−s1s1
evalm⁡l&*u&*f−v
000
See Also
linalg(deprecated)[forwardsub]
linalg(deprecated)[gausselim]
linalg(deprecated)[gaussjord]
linalg(deprecated)[linsolve]
linalg(deprecated)[LUdecomp]
LinearAlgebra
Download Help Document