LinearAlgebra
BackwardSubstitute
solve A . X = B where A is in upper row echelon form
ForwardSubstitute
solve A . X = B where A is in lower row echelon form
Calling Sequence
Parameters
Description
Examples
BackwardSubstitute(A, B, t, ip, options)
ForwardSubstitute(A, B, t, ip, options)
A
-
row echelon form Matrix
B
(optional) Matrix or Vector
t
(optional) equation of the form free=symbol; variable for parametrization of infinite solution sets
ip
(optional) equation of the form inplace=true or false; specifies if output overwrites parameter B when A is square
options
(optional); constructor options for the transformation Matrix C
The BackwardSubstitute(A, B) function, where A is an upper row echelon Matrix, returns a solution to the equation A·X=B.
The ForwardSubstitute(A, B) function, where A is a lower row echelon Matrix, returns a solution to the equation A·X=B.
For each column b of B, this routine performs backwards (or forwards) substitution to obtain a solution x of A·x=b. These solution Vectors form a Matrix (or, singly, a Vector) solution which is returned. If no such solution Vector x exists for any column b (e.g., both A is not upper (or lower) triangular and the substitution is inconsistent), then an error is returned.
If the substitution does not result in a unique solution, then the infinite family of possible solutions will be parametrized as follows:
If B is a Vector, then the solution is parametrized by t[1], t[2], etc, as needed.
If B is a Matrix, then the jth column of the solution Matrix is parametrized by t[1,j], t[2,j], etc, as needed.
If the parameter t is not provided, then an unassigned name _t<#> is generated. For example, if _t0, _t1.._t<i> are all assigned, but _t<i+1> is not assigned, then _t<i+1> is the generated name.
If B is not included in the calling sequence, A is assumed to be an augmented Matrix.
The inplace option (ip) determines where the result is returned. If given as inplace=true and A is a square Matrix, the result overwrites the second argument B. If given as inplace=false, or if this option is not included in the calling sequence, the result is returned in a new Matrix or Vector.
The condition inplace=true can be abbreviated to inplace.
The inplace option must be used with caution since, if the operation fails, the original Matrix argument may be corrupted.
The constructor options provide additional information (readonly, shape, storage, order,datatype, and attributes) to the Matrix or Vector constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list. If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).
The inplace and constructor options are mutually exclusive.
This function is part of the LinearAlgebra package, and so it can be used in the form BackwardSubstitute(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[BackwardSubstitute](..).
with⁡LinearAlgebra:
A≔1,0,0,0|0,1,0,0|2,−1,0,0|0,0,1,0|−2,1,−2,0|3,1,2,0
A≔1020−2301−10110001−22000000
M≔BackwardSubstitute⁡A
M≔3−2⁢_t2+2⁢_t11+_t2−_t1_t22+2⁢_t1_t1
A1..−1,1..−2·M
3120
B≔1,0|0,1|0,1|0,1:
X≔1,−1|0,3:
ForwardSubstitute⁡B,X,free=x
10x1,1x1,2x2,1x2,2−1−x1,1−x2,13−x1,2−x2,2
C≔1,0,0|0,1,0|1,1,1:
Y≔3,2,4:
BackwardSubstitute⁡C,Y,inplace
−1−24
Y
See Also
Matrix
Download Help Document