generate the coefficient Matrix from equations - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Solvers : LinearAlgebra/GenerateMatrix

LinearAlgebra[GenerateMatrix] - generate the coefficient Matrix from equations

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) BooleanOpt(augmented); 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:

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

var:=x1,x2,x3,x4:

A,b:=GenerateMatrixsys,var

A,b:=323211101211,130

(1)

A.Vectorvar=b

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

(2)

M:=GenerateMatrixsys,var,augmented=true

M:=323211110312110

(3)

LinearSolveM

73_t323_t3113

(4)

eqns:=18xt2yt=ⅆⅆtxt,12xt+7yt=ⅆⅆtyt

eqns:=18xt2yt=ⅆⅆtxt,12xt+7yt=ⅆⅆtyt

(5)

GenerateMatrixeqns,xt,yt

182127,ⅆⅆtxtⅆⅆtyt

(6)

See Also

LinearAlgebra[GenerateEquations], LinearAlgebra[LinearSolve], Matrix, Vector


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam