LINEQN
C = LINEQN (A, B [, toler])
Solves linear equations using the Gauss-Jordan method.
A
equation coefficience as a matrixB
results of the equations as a column-vectorC
result as a Nx1 matrix with the values of the unknownstoler
tolerance number (the absolute value of the lowest acceptable number). Default value is0
(tolerance not applied).
One possible problem is numerical instability, caused by the possibility of dividing by very small numbers. If, for example, the leading coefficient of one of the rows is very close to zero, […] one would need to divide by that number. This means that any error existed for the number that was close to zero would be amplified. Wikipedia
The tolerance number can be used to ensure, that no division by
numbers smaller than toler
will be performed.
Example
' Solve:
' x - y + 2z = 6
' 2x + 3y + 2z = 11
' 3x + 2y + z = 8
1,-1,2; 2,3,2; 3,2,1]
A = [6; 11; 8]
B = [
LINEQN(A, B)
C =
print "x = "; C(0,0)
print "y = "; C(0,1)
print "z = "; C(0,2)
' Output: x = 1; y = 1; z = 3
Code samples using LINEQN
Math
ABS
ABSMAX
ABSMIN
ACOS
ACOSH
ACOT
ACOTH
ACSC
ACSCH
ASEC
ASECH
ASIN
ASINH
ATAN
ATAN2
ATANH
ATN
CEIL
COS
COSH
COT
COTH
CSC
CSCH
DEG
DERIV
DETERM
DIFFEQN
EXP
EXPRSEQ
FIX
FLOOR
FRAC
INT
INTERSECT
INVERSE
LINEQN
LOG
LOG10
M3APPLY
M3IDENT
M3ROTATE
M3SCALE
M3TRANS
MAX
MIN
POLYAREA
POLYCENT
POLYEXT
POW
PTDISTLN
PTDISTSEG
PTSIGN
RAD
RND
ROOT
ROUND
SEC
SECH
SEGCOS
SEGLEN
SEGSIN
SEQ
SGN
SIN
SINH
SQR
STATMEAN
STATMEANDEV
STATMEDIAN
STATSPREADP
STATSPREADS
STATSTD
SUM
SUMSQ
TAN
TANH
TRANSPOSE
If there is insufficient information on this page and you wish learn more about LINEQN,
please send an email to smallbasic@gmail.com. You can help to improve information about
LINEQN by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.