SolveTools
Linear
solve linear system of equations
Calling Sequence
Parameters
Description
Examples
Compatibility
Linear(eqns, vars, meth, notz)
eqns
-
list or set; system of equations
vars
list or set; variables to solve with respect to
meth
(optional) equation of the form method=Method, where Method is one of the following: AlgebraicFunction, AlgebraicNumber, ComplexFloat, ComplexRational, Float, Polynomial, RadicalFunction, RadicalNumber, Rational, RationalDense, or RationalAlgebraicFunction; the algorithm to be used
notz
(optional) expressions that must not equal zero
The Linear command solves system of linear equations.
Optional arguments can contain expressions which must not be zero, notz, and the method for solving the system.
If method is not specified, Linear tries to dispatch to an algorithm according to the type of the system. The possible methods correspond to the following types of equations (the check is performed in this order).
Equation type
Method
1
polynom⁡rational,vars
Rational
2
polynom⁡numeric,vars
Float
3
polynom⁡complex⁡rational,vars
ComplexRational
4
polynom⁡complex⁡numeric,vars
ComplexFloat
5
ratpoly⁡rational
Polynomial
6
polynom⁡algnum,vars
AlgebraicNumber
7
ratpoly⁡radnum,vars
RadicalNumber
8
ratpoly⁡algnum
RationalAlgebraicFunction
9
algfun⁡rational
AlgebraicFunction
10
radfun⁡rational
RadicalFunction
If the method is not specified and the system is not of one of the above types, Linear uses the default universal method, which is a primitive fraction-free algorithm.
Most algorithms are intended to be used on large sparse systems, however, they also perform well on dense systems. The exception is the RationalDense method that is specifically optimized for dense systems of rational numbers, especially overconstrained systems with infinitely many solutions.
The algorithms used are Gaussian elimination with pivoting for stability for the numeric coefficients and primitive fraction-free for the algebraic and radical coefficients.
Many of the methods can also be called directly as exports of the SolveTools:-LinearSolvers module.
with⁡SolveTools:
Linear⁡x+y,x−y−2,x,y
x=1,y=−1
Linear⁡x+y,x−y−2,x,y,y+1
Linear⁡x+y−5.,4⁢x−3⁢y−2,x,y
x=2.428571428,y=2.571428571
Linear⁡x+y−5,4⁢x−3⁢y−2−I,x,y,method=ComplexFloat
x=2.428571428+0.1428571429⁢I,y=2.571428571−0.1428571428⁢I
The following example returns NULL since the system has polynomials of y as coefficients and there is no x such that equations hold for all values of y.
Linear⁡x+y−5,4⁢x−3⁢y−2,x
Linear⁡x+y+z−512,4⁢x−3⁢y−2,x,y,z
x=12+3⁢y4,y=y,z=−12−7⁢y4+5
Linear⁡x+2⁢RootOf⁡v2−w,v⁢w⁢y,5⁢x⁢w−3⁢y+7,x,y
x=−14⁢w⁢10⁢w3−3⁢RootOf⁡_Z2−w100⁢w5−9,y=7⁢10⁢RootOf⁡_Z2−w⁢w2−3100⁢w5−9
The method option was updated in Maple 2023.
See Also
SolveTools:-LinearSolvers:-RationalDense
Download Help Document