Setting linear algebra questions in STACK
Linear algebra, next to calculus, is one of the pillars of modern mathematics and an important application in STACK is supporting questions which test understanding of linear algebra.
Core functionality.
- General matrix manipulations in Maxima.
- Core vector/matrix functions defined by STACK in the core code.
- Using vectors.
- Assessment of matrices with answer tests.
Reference documentation for contributed libraries.
- Creating random matrices in contributed
rand_matrix.mac
. - Matrix functions in contributed
matrix.mac
. - Vector and vector space functions in contributed
vectorspaces.mac
. - Vector geometry functions in contributed
vectorgeometry.mac
. - Eigenvalue/vector functions in contributed
eigenlib.mac
. - Matrix factorisations in contributed
matrixfactorizations.mac
If using an earlier version of STACK than 4.9.0, 2. through 6. above require an extra inclusion (see here).
Solving systems of linear equations
Using solve can throw errors, so use linsolve
instead. For example.
/* Decide if a vector is in W */
point_in_space(W, wx):= linsolve(flatten(args(W))-first(args(transpose(wx))), listofvars(W));
If the above is the empty list, there is no solution. Otherwise a solution is returned.
/* Calculate the canonical form of a column space of a system. */
cspace(ex):= block([M],
M: coefmatrix(flatten(args(ex)), listofvars(ex)),
ev(transpose(rref(transpose(M))), simp)
);