 linalg(deprecated)/forwardsub - Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : linalg(deprecated)/forwardsub

linalg(deprecated)

 forwardsub
 forward substitution on a matrix

 Calling Sequence forwardsub(L) forwardsub(L, b, v)

Parameters

 L - lower row reduced matrix b - vector or matrix v - (optional) name

Description

 • 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 $Lx=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.

Examples

Important: The linalg package has been deprecated. Use the superseding packages LinearAlgebra[ForwardSubstitute], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(1..3,1..4,\left[\left[1,-2,3,1\right],\left[2,k,6,6\right],\left[-1,3,k-3,0\right]\right]\right):$
 > $\mathrm{LUdecomp}\left(A,L='l',U='u'\right)$
 $\left[\begin{array}{cccc}{1}& {-2}& {3}& {1}\\ {0}& {k}{+}{4}& {0}& {4}\\ {0}& {0}& {k}& \frac{{k}}{{k}{+}{4}}\end{array}\right]$ (1)
 > $b≔\mathrm{vector}\left(\left[1,2,3\right]\right):$
 > $\mathrm{v1}≔\mathrm{forwardsub}\left(l,b\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{ccc}{1}& {0}& {4}\end{array}\right]$ (2)
 > $\mathrm{v2}≔\mathrm{backsub}\left(u,\mathrm{v1}\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{cccc}{-}\frac{{{k}}^{{2}}{}{{\mathrm{_t}}}_{{1}}{-}{{k}}^{{2}}{+}{9}{}{k}{}{{\mathrm{_t}}}_{{1}}{+}{8}{}{k}{+}{48}}{\left({k}{+}{4}\right){}{k}}& {-}\frac{{4}{}{{\mathrm{_t}}}_{{1}}}{{k}{+}{4}}& {-}\frac{{k}{}{{\mathrm{_t}}}_{{1}}{-}{4}{}{k}{-}{16}}{\left({k}{+}{4}\right){}{k}}& {{\mathrm{_t}}}_{{1}}\end{array}\right]$ (3)
 > $\mathrm{map}\left(\mathrm{normal},\mathrm{evalm}\left(b-A\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{v2}\right)\right)$
 $\left[\begin{array}{ccc}{0}& {0}& {0}\end{array}\right]$ (4)