 linalg(deprecated)/genmatrix - Maple Help

Home : Support : Online Help : linalg(deprecated)/genmatrix

linalg(deprecated)

 geneqns
 generate equations from the coefficient matrix
 genmatrix
 generate the coefficient matrix from equations Calling Sequence geneqns(A, x) geneqns(A, x, b) genmatrix(eqns, vars) genmatrix(eqns, vars, flag) genmatrix(eqns, vars, b) Parameters

 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'' Description

 • 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 ${x}_{i}$. 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](..). Examples

Important: The linalg package has been deprecated. Use the superseding commands, LinearAlgebra[GenerateMatrix] and LinearAlgebra[GenerateEquations], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $\mathrm{eqns}≔\left\{x+2y=0,3x-5y=0\right\}$
 ${\mathrm{eqns}}{≔}\left\{{x}{+}{2}{}{y}{=}{0}{,}{3}{}{x}{-}{5}{}{y}{=}{0}\right\}$ (1)
 > $A≔\mathrm{genmatrix}\left(\mathrm{eqns},\left[x,y\right]\right)$
 ${A}{≔}\left[\begin{array}{cc}{1}& {2}\\ {3}& {-5}\end{array}\right]$ (2)
 > $\mathrm{geneqns}\left(A,\left[x,y\right]\right)$
 $\left\{{x}{+}{2}{}{y}{=}{0}{,}{3}{}{x}{-}{5}{}{y}{=}{0}\right\}$ (3)
 > $\mathrm{geneqns}\left(A,x\right)$
 $\left\{{{x}}_{{1}}{+}{2}{}{{x}}_{{2}}{=}{0}{,}{3}{}{{x}}_{{1}}{-}{5}{}{{x}}_{{2}}{=}{0}\right\}$ (4)
 > $\mathrm{eqns}≔\left\{x+2z=a,3x-5y=6-z\right\}$
 ${\mathrm{eqns}}{≔}\left\{{x}{+}{2}{}{z}{=}{a}{,}{3}{}{x}{-}{5}{}{y}{=}{6}{-}{z}\right\}$ (5)
 > $A≔\mathrm{genmatrix}\left(\mathrm{eqns},\left[x,y,z\right],\mathrm{flag}\right)$
 ${A}{≔}\left[\begin{array}{cccc}{1}& {0}& {2}& {a}\\ {3}& {-5}& {1}& {6}\end{array}\right]$ (6)
 > $A≔\mathrm{genmatrix}\left(\mathrm{eqns},\left[x,y,z\right],'b'\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {0}& {2}\\ {3}& {-5}& {1}\end{array}\right]$ (7)
 > $\mathrm{print}\left(b\right)$
 $\left[\begin{array}{cc}{a}& {6}\end{array}\right]$ (8)
 > $\mathrm{geneqns}\left(A,\left[x,y,z\right],b\right)$
 $\left\{{x}{+}{2}{}{z}{=}{a}{,}{-}{5}{}{y}{+}{z}{+}{3}{}{x}{=}{6}\right\}$ (9)