GRAM SCHMIDT for TI-85,86

The following is a stripped down program for the TI-85,86 for implementing the Gram-Schmidt process. It is short enough that you can enter it your self rather than attempting to download it. You may wish to add whistles and bells to this program, for example this program will not check to see if the rows of M are independent, if not it may return an error message or nonsense.

PROGRAM:GMSMT
:M->Q
:dim Q->NR
:NR(1)->NR
:For(I,1,NR)
:multR(1/norm Q(I),Q,I)->Q
:For(J,I+1,NR)
:mRAdd(-dot(Q(I),Q(J)),Q,I,J)->Q
:End
:End

Note that in the above program -> means STO. The funtions dim, multR,mRAdd come from the MATRX, OPS menu, the functions norm and dot come from the VECTR, MATH menu. For and End come from the PRGM, CTL menu.

This program takes the matrix entered as M, performs Gram Schmidt on the rows of M, and places the orthonormal basis in the matrix called Q. Note that both the original and orthonormal basis are given by the rows of the matrices M and Q respectively.

Rows are used because the TI-85 implements row operations rather than column operations. The resulting matrix is the transpose of the matrix usually called Q. Thus to find the coefficients of a vector v in the orthonormal basis simply multiply Q*v. (Note: the TI-85 displays and stores a vector as a row but treats it as a column in the context of matrix multiplication.) To find the projection of the vector v on the row space of M, use QT*Q*v where QT denotes the transpose of Q.