linalg(deprecated)
geneqns
generate equations from the coefficient matrix
genmatrix
generate the coefficient matrix from equations
Calling Sequence
Parameters
Description
Examples
geneqns(A, x)
geneqns(A, x, b)
genmatrix(eqns, vars)
genmatrix(eqns, vars, flag)
genmatrix(eqns, vars, b)
A
-
coefficient matrix
x
name or list of names for the unknowns
b
(optional) right hand side vector
eqns
set or list of equations
vars
set or list of variables
flag
(optional) the name ``flag''
Important: The linalg package has been deprecated. Use the superseding commands, LinearAlgebra[GenerateMatrix] and LinearAlgebra[GenerateEquations], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The function geneqns generates a set of linear equations from a coefficient matrix A in the variables xi. If an optional third argument the ``right-hand side'' vector b is present, it will be included in the equations. Otherwise the equations will be equated to zero.
The function genmatrix generates the coefficient matrix from the linear system of equations eqns in the unknowns vars. If the optional third argument ``flag'' is present, the ``right-hand side'' vector will be included as the last column of the matrix. Otherwise an optional third argument will be assigned the ``right-hand side'' vector.
These functions are part of the linalg package, and so can be used in the form geneqns(..) and genmatrix(..) only after performing the command with(linalg) or with(linalg,geneqns) and with(linalg,genmatrix). These functions can always be accessed in the long form linalg[geneqns](..) or linalg[genmatrix](..).
with⁡linalg:
eqns≔x+2⁢y=0,3⁢x−5⁢y=0
A≔genmatrix⁡eqns,x,y
A≔123−5
geneqns⁡A,x,y
x+2⁢y=0,3⁢x−5⁢y=0
geneqns⁡A,x
x1+2⁢x2=0,3⁢x1−5⁢x2=0
eqns≔x+2⁢z=a,3⁢x−5⁢y=6−z
A≔genmatrix⁡eqns,x,y,z,flag
A≔102a3−516
A≔genmatrix⁡eqns,x,y,z,b
A≔1023−51
print⁡b
a6
geneqns⁡A,x,y,z,b
x+2⁢z=a,−5⁢y+z+3⁢x=6
See Also
linalg(deprecated)[linsolve]
LinearAlgebra
Download Help Document