factor a matrix - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : Student Package : Numerical Analysis : Computation : Student/NumericalAnalysis/MatrixDecomposition

Student[NumericalAnalysis][MatrixDecomposition] - factor a matrix

Calling Sequence

MatrixDecomposition(A, opts)

Parameters

A

-

Matrix; a square nxn matrix

opts

-

(optional) equation(s) of the form keyword=value, where keyword is one of digits, method, output, showsteps; the options for factoring the matrix A

Description

• 

Matrix decomposition is used to reduce the general linear system A.x=b to more manageable triangular systems.

• 

The MatrixDecomposition command can perform the following decompositions: LU, PLU, LU Tridiagonal, PLU Scaled, LDU, LDLt and Cholesky.

Notes

• 

Matrix decomposition is also sometimes referred to as matrix factorization. The terms are interchangeable.

• 

When the method is set to either LU or LDU, this procedure operates symbolically; that is, the inputs are not automatically evaluated to floating-point quantities, and computations proceed symbolically and exactly whenever possible. To obtain floating-point results, it is necessary to supply floating-point inputs.

• 

Otherwise, this procedure operates numerically; that is, if the inputs are not already numeric, they are first evaluated to floating-point quantities before computations proceed. The outputs will be numeric as well. Note that exact rationals are considered numeric and are preserved whenever possible throughout the computation; therefore, one must specify floating-point inputs instead of exact rationals to obtain floating-point outputs.

Examples

withStudent:-NumericalAnalysis:

A:=Matrix1.3,4.5,7.2,4.3,5.6,8.7,7.0,8.4,10.1

A:=1.34.57.24.35.68.77.08.410.1

(1)

Try an LU decomposition

L,U:=MatrixDecompositionA,method=LU,output=L,U

L,U:=1003.307692308105.3846153851.7050538511,1.34.57.209.2846153915.11538462002.89668601

(2)

M:=MatrixDecompositionA,method=LU,output=Mmatrices

M:=1003.307692308105.38461538501,10001001.7050538511

(3)

Check that M2.M1.A=U

M2.M1.AU

0.0.0.4.0000003309614810-104.0000003309614810-92.4000001985768910-91.8202150897650410-101.3546847199563710-81.0414957785087610-8

(4)

A:=Matrix3.32,1.43,2.02,9.93,2.43,1.54,2.54,1.53,6.54,1.21,1.04,8.54,3.44,0.43,2.43,1.99

A:=3.321.432.029.932.431.542.541.536.541.211.048.543.440.432.431.99

(5)

Try a PLU decomposition

P,L,U:=MatrixDecompositionA,method=PLU

P,L,U:=0010010000011000,10000.37155963301000.52599388380.9780264465100.50764525990.74811044270.13673442321,6.541.211.048.5401.0904128442.1535779821.643119266000.8707774188.0890018650007.929989165

(6)

P

0010010000011000

(7)

L

10000.37155963301000.52599388380.9780264465100.50764525990.74811044270.13673442321

(8)

U

6.541.211.048.5401.0904128442.1535779821.643119266000.8707774188.0890018650007.929989165

(9)

Perform a Cholesky decomposition

A:=Matrix2,1,0,1,2,1,0,1,2

A:=210121012

(10)

First check that A is positive definite

IsMatrixShapeA,positivedefinite

true

(11)

G,Gt:=MatrixDecompositionA,method=Cholesky

G,Gt:=20012212600136233,21220012613600233

(12)

See Also

Student[LinearAlgebra], Student[NumericalAnalysis], Student[NumericalAnalysis][ComputationOverview], Student[NumericalAnalysis][MatrixDecompositionTutor]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam