generate the coefficient Matrix from equations
GenerateMatrix(eqns, vars, aug, options)
list or set of (linear) equations or expressions
list or set of variables in which the equations occur
(optional) equation of the form augmented=true or false; specifies how result is returned
(optional); constructor options for the result object
The GenerateMatrix(eqns, vars) function generates the coefficient Matrix and right-hand-side Vector from the system of equations or expressions eqns in the unknowns vars. Any of the expressions in eqns that are not equations are treated as equations having right-hand side equal to 0.
Each equation or expression in eqns is split into the part that is homogeneous (degree 1) in the specified variables (vars) and the non-homogeneous part. The coefficient Matrix is constructed from the homogeneous part. The non-homogeneous part is placed in the right-hand-side Vector, or last column of the coefficient Matrix if the augmented form is requested.
The augmented option (aug) determines whether the result is returned as a Matrix-Vector pair or as an augmented system. If given as augmented or augmented=true, the right hand sides of the equations are returned as the last column of the result Matrix. If given as augmented=false or if this option is not included in the calling sequence, then the returned Matrix is the coefficient Matrix and the returned Vector is the right-hand side non-homogeneous part of the linear system.
In the non-augmented case, if the original variables in vars are substituted as the corresponding entries of a Vector x, then the original linear system is equivalent to the Matrix equation:
A . x = b
where A is the coefficient Matrix and b is the right-hand-side Vector.
The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Matrix 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).
This function is part of the LinearAlgebra package, and so it can be used in the form GenerateMatrix(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[GenerateMatrix](..).
sys ≔ 3⁢x1+2⁢x2+3⁢x3−2⁢x4=1,x1+x2+x3=3,x1+2⁢x2+x3−x4:
var ≔ x1,x2,x3,x4:
A,b ≔ GenerateMatrix⁡sys,var
M ≔ GenerateMatrix⁡sys,var,augmented=true
eqns ≔ 18⁢x⁡t−2⁢y⁡t=ⅆⅆt⁢x⁡t,12⁢x⁡t+7⁢y⁡t=ⅆⅆt⁢y⁡t
Download Help Document