SmallBASIC GuideThe language | Programming Tips | Commands | System | Graphics & Sound | Miscellaneous | File system | Mathematics | 2D Algebra | Strings | Console | Glossary |
Equations
Function:
LINEQN
(a, b [, toler])
Returns an array with the values of the unknowns.
This function solves equations by using the Gauss-Jordan method.
- b
equations
- b
results
- toler
tolerance number.
(the absolute value of the lowest acceptable number)
default = 0 = none...
|x| <= toler : x = 0
*, The result is a matrix Nx1. For the SB that array is
two-dimension array.}
Function:
INVERSE
(A)
returns the inverse matrix of A.
Function:
DETERM
(A[, toler])
Determinant of A
toler = tolerance number
(the absolute value of the lowest acceptable number)
default = 0 = none
|x| <= toler : x = 0
Command:
ROOT
low, high, segs, maxerr, BYREF result, BYREF errcode USE expr
Roots of F(x)
- low
the lower limit
- high
the upper limit
- segs
the number of segments (spaces)
- maxerr
tolerance (IF ABS(F(x)) < maxerr THEN OK)
- errcode
0 for success; otherwise calculation error
- result
the result
FUNC F(x)
F = SIN(x)
END
...
ROOT 1, 5, 500, 0.00001, result, errcode USE F(x)
Command:
DERIV
x, maxtries, maxerr, BYREF result, BYREF errcode USE expr
Calculation of derivative
- x
value of x
- maxtries
maximum number of retries
- maxerr
tolerance
- errcode
0 for success; otherwise calculation error
- result
the result
Command:
DIFFEQN
x0, y0, xf, maxseg, maxerr, BYREF yf, BYREF errcode USE expr
Differential equation - Runge-Kutta method
- x0
- y0
initial x,y
- xf
x final
- maxseg
maximum number of segments on x
- maxerr
tolerance (acceptable error between the last 2 times)
- errcode
0 for success; otherwise calculation error
- yf
the result
[Prev] [Next]