PDA

View Full Version : How can you program gaussian elimination using Maxima?


leque
Aug 10, 2008, 01:06 AM
Maxima is like Matlab or Maple.. Im new to it.. I'm having a hard time coding it.

Here's the algorithm:
1. Create an augmented matrix, [A:y] by combining the coefficient matrix A with the right hand side vector y to create an n by n + 1 matrix.
2. Use elementary row operations to eliminate the elements below the main diagonal.
1. Start at the first diagonal element - a11.
2. If necessary, swap the current row with a lower row to maximize the diagonal element
3. Add current row, multiplied by a constant, to each lower row so that the elements below the diagonal element become zero.
4. Repeat steps 2 and 3 for the next diagonal element.
3. Starting from the last row, work backward to solve for variables by using substitution. The symbol (') indicates that the element's value is not the same as in the original matrix.
1. On the last row, xN = y'N/a'NN.
2. Repeat xi = (y'i - ∑a'ijxj)/a'NN for I = (N - 1)... 1.

Thank you.