Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Gramschmidt Calculator

Gramschmidt

Function: gramschmidt (<x>)

load (eigen);
 x: matrix ([0,1,0], [1,0,1], [1,1,1]);
 y: gramschmidt (x);

Function: gramschmidt (<x>, <F>) Carries out the Gram-Schmidt orthogonalization algorithm on <x>, which is either a matrix or a list of lists. <x> is not modified by gramschmidt. The inner product employed by gramschmidt is <F>, if present, otherwise the inner product is the function innerproduct.

If <x> is a matrix, the algorithm is applied to the rows of <x>. If <x> is a list of lists, the algorithm is applied to the sublists, which must have equal numbers of elements. In either case, the return value is a list of lists, the sublists of which are orthogonal and span the same space as <x>. If the dimension of the span of <x> is less than the number of rows or sublists, some sublists of the return value are zero.

factor is called at each stage of the algorithm to simplify intermediate results. As a consequence, the return value may contain factored integers.

load(eigen) loads this function.

Example:

Gram-Schmidt algorithm using default inner product function.

          (%i1) load (eigen)$
          (%i2) x: matrix ([1, 2, 3], [9, 18, 30], [12, 48, 60]);
                                   [ 1   2   3  ]
                                   [            ]
          (%o2)                    [ 9   18  30 ]
                                   [            ]
                                   [ 12  48  60 ]
          (%i3) y: gramschmidt (x);
                                 2      2            4     3
                                3      3   3 5      2  3  2  3
          (%o3)  [[1, 2, 3], [- ---, - --, ---], [- ----, ----, 0]]
                                2 7    7   2 7       5     5
          (%i4) map (innerproduct, [y[1], y[2], y[3]], [y[2], y[3], y[1]]);
          (%o4)                       [0, 0, 0]

Gram-Schmidt algorithm using a specified inner product function.

          (%i1) load (eigen)$
          (%i2) ip (f, g) := integrate (f * g, u, a, b);
          (%o2)          ip(f, g) := integrate(f g, u, a, b)
          (%i3) y : gramschmidt ([1, sin(u), cos(u)], ip), a= -%pi/2, b=%pi/2;
                                         %pi cos(u) - 2
          (%o3)              [1, sin(u), --------------]
                                              %pi
          (%i4) map (ip, [y[1], y[2], y[3]], [y[2], y[3], y[1]]), a= -%pi/2, b=%pi/2;
          (%o4)                       [0, 0, 0]

(%o1)                                true
(%i2) 

Gramschmidt Example

Related Examples

gramschmidt-load-matrix

load (eigen);

x: matrix ([0, -1, -...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix-ratsimp

load(eigen);

x: matrix ([1,2,1,3],...

y: gramschmidt (x);

Calculate

gramschmidt-integrate-load-map

load (eigen);

ip (f, g) := integra...

y : gramschmidt ([-3...

Calculate

gramschmidt-load-matrix-ratsimp

load (eigen);

x: matrix ([1, 2, 3],...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix

load (eigen);

x: matrix ([3,4], [1...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix

load (eigen);

x: matrix ([1, 3, 0]...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix-ratsimp-transpose

A:matrix([12,-51,4],[...

load("eigen");

ratsimp(gramschmidt(t...

Calculate

gramschmidt-load-matrix

load (eigen);

x: matrix ([3,4], [1...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix

load (eigen);

x: matrix ([2,0], [1...

y: gramschmidt (x);

Calculate

gramschmidt-load-matrix

A:matrix([1,-1],[1,1]);

B: matrix([-5,-1],[-2...

load("eigen");

Calculate