LU Decomposition to factor a square matrix A
Dr. K. G. TeBeest
Load the linalg library package:
> | with( linalg ) : |
Define square matrix A:
> | A := matrix( [ [ 2, 4, 6, 8 ] , [ 4, 12, 36, 32 ] , [ -8, 4, 93, 63 ] , [ 12, 12, -42, 32 ] ] ) ; |
Use Maple's LUdecomp command to factor A. This example also stores L and U:
> | LUdecomp( A, L = 'L', U = 'U' ) ; |
Display matrix L:
> | evalm( L ) ; |
Display matrix U:
> | evalm( U ) ; |
Let's multiply L times U to verify that the product equals A:
> | multiply( L, U ) ; |
Created byDr. Kevin G. TeBeest |