GenerateMatrix - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


LinearAlgebra

  

GenerateMatrix

  

generate the coefficient Matrix from equations

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

GenerateMatrix(eqns, vars, aug, options)

Parameters

eqns

-

list or set of (linear) equations or expressions

vars

-

list or set of variables in which the equations occur

aug

-

(optional) equation of the form augmented=true or false; specifies how result is returned

options

-

(optional); constructor options for the result object

Description

• 

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](..).

Examples

withLinearAlgebra:

sys3x1+2x2+3x32x4=1,x1+x2+x3=3,x1+2x2+x3x4:

varx1,x2,x3,x4:

A,bGenerateMatrixsys,var

A,b323−21110121−1,130

(1)

A·Vectorvar=b

3x1+2x2+3x32x4x1+x2+x3x1+2x2+x3x4=130

(2)

MGenerateMatrixsys,var,augmented=true

M323−2111103121−10

(3)

LinearSolveM

73_t323_t3113

(4)

eqns18xt2yt=diffxt,t,12xt+7yt=diffyt,t

eqns18xt2yt=ⅆⅆtxt,12xt+7yt=ⅆⅆtyt

(5)

GenerateMatrixeqns,xt,yt

18−2127,ⅆⅆtxtⅆⅆtyt

(6)

See Also

LinearAlgebra[GenerateEquations]

LinearAlgebra[LinearSolve]

Matrix

Vector