You can use external function as standard functions by its file name without extension, e.g. abs(x), not abs.txt. You can add your own file to the library.
It is loaded auto when it needs.
These functions compute eigenvalues and eigenvectors numerically.
Matrix m must be both numerical and symmetric.
The eigenval function returns a matrix with the eigenvalues along
the diagonal.
The eigenvec function returns a matrix with the eigenvectors arranged as row
vectors.
The eigen function does not return anything but stores the eigenvalue matrix
in D and the eigenvector matrix in Q.
Example 1. Check the relation AX = lambda X where lambda is an eigenvalue and
X is the associated eigenvector.
Enter
A = hilbert(3)
eigen(A)
lambda = D[1,1]
X = Q[1]
dot(A,X) - lambda X
Result
-1.16435e-14
-6.46705e-15
-4.55191e-15
Example 2: Check the relation A = QTDQ.
Enter
A - dot(transpose(Q),D,Q)
Result
6.27365e-12 -1.58236e-11 1.81902e-11
-1.58236e-11 -1.95365e-11 2.56514e-12
1.81902e-11 2.56514e-12 1.32627e-11
Factors polynomial p of x.
The x can be omitted for polynomials in x.
The polynomial should be factorable over integers.
The argument list can be extended for multivariate polynomials.
For example, factor(p,x,y) factors p over x and then over y.
For i starting from the integer j through to the integer k (inclusive of both ends if they are different, see examples): evaluate a, then evaluate b, etc.
j and k must either be integers or evaluate to integers. Either of them can be negative, and they can be equal, e.g.
...if j < k e.g. j = -1 and k = 1 then i goes through the values -1,0,1
...if j > k e.g. j = 1 and k = -1 then i goes through the values 1,0,-1
...if j = k e.g. j = 3 and k = 3 (or j = -3 and k = -3) then i goes through the only value 3 (or -3, respectively)
The index variable is not clobbered i.e. the original value of the index variable is restored after "for" completes.
The following script uses "for" to compute pi to six digits using Viete's formula ( see http://www.pi314.net/eng/viete.php ).
Returns the definite integral of f with respect to x
evaluated from "a" to b.
The argument list can be extended for multiple integrals (or "iterated integrals"), for example,
a double integral (which can represent for example a volume under a surface), or a triple integral, etc.
For example, integrate(f,x,2,a,b).
Returns all of the roots, both real and complex,
of polynomial p in x.
The roots are computed numerically.
The coefficients of p can be real or complex.
Returns the values of x such that p(x)=0.
The polynomial p should be factorable over integers.
Returns a vector for multiple roots.
Individual roots can be obtained using component notation, i.e.,
poly(1,1,x).
Returns the values of x such that p(x)=0.
The polynomial p should be factorable over integers.
Returns a vector for multiple roots.
Individual roots can be obtained using component notation, i.e.,
r1=polyroot(p,x).
Returns all of the roots, both real and complex,
of polynomial p in x.
The roots are computed numerically.
The coefficients of p can be real or complex.
Returns the quotient of polynomial p(x) over q(x).
The last argument can be omitted for polynomials in x.
The remainder can be calculated by p-q*quotient(p,q).
Returns a vector with the "shape" of the input tensor, i.e. a vector with an integer for each dimension (representing the size of each dimension). For example vectors are tensors of one dimension, so a vector with one integer (the length of the vector) is returned. Matrixes are 2-dimensional tensors, so a vector with two integers is returned (rows, columns), etc.
Returns the transpose of "a" with respect to indices i and j.
If i and j are omitted then 1 and 2 are used.
Hence a matrix can be transposed with a single argument,
i.e., transpose(a).