 LinearAlgebra - Maple Programming Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Queries : LinearAlgebra/Rank

LinearAlgebra

 Rank
 compute the rank of a Matrix

 Calling Sequence Rank(A)

Parameters

 A - Matrix

Description

 • If A does not have a floating-point datatype, then the Rank(A) function computes the rank of A by performing Gaussian elimination on the rows of A.
 The rank of Matrix A is the number of non-zero rows in the resulting Matrix.
 • In the case that the Matrix A has a floating-point datatype, a singular value decomposition and analysis is performed.
 • This function is part of the LinearAlgebra package, and so it can be used in the form Rank(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[Rank](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $A≔\mathrm{ScalarMatrix}\left(n,3\right)$
 ${A}{≔}\left[\begin{array}{ccc}{n}& {0}& {0}\\ {0}& {n}& {0}\\ {0}& {0}& {n}\end{array}\right]$ (1)
 > $\mathrm{Rank}\left(A\right)$
 ${3}$ (2)
 > $B≔⟨⟨-7,1,2⟩|⟨2,1,-1⟩|⟨3,0,-1⟩|⟨2,7,-3⟩⟩$
 ${B}{≔}\left[\begin{array}{cccc}{-7}& {2}& {3}& {2}\\ {1}& {1}& {0}& {7}\\ {2}& {-1}& {-1}& {-3}\end{array}\right]$ (3)
 > $\mathrm{Rank}\left(B\right)$
 ${2}$ (4)
 > $\mathrm{numelems}\left(\mathrm{RowSpace}\left(B\right)\right)$
 ${2}$ (5)
 > $F≔\mathrm{Matrix}\left(\left[\left[\frac{1}{5},\frac{1}{3},\frac{8}{25}\right],\left[\frac{2}{5},\frac{1}{3},\frac{11}{25}\right],\left[\frac{4}{5},-\frac{1}{3},\frac{7}{25}\right]\right],\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 ${F}{≔}\left[\begin{array}{ccc}{0.200000000000000}& {0.333333333333333}& {0.320000000000000}\\ {0.400000000000000}& {0.333333333333333}& {0.440000000000000}\\ {0.800000000000000}& {-0.333333333333333}& {0.280000000000000}\end{array}\right]$ (6)
 > $\mathrm{Rank}\left(F\right)$
 ${2}$ (7)
 > $\mathrm{eqs}≔\left[\mathrm{u3}-\mathrm{cos}\left(\mathrm{q5}\right)\mathrm{u5}=0,\mathrm{cos}\left(\mathrm{q4}\right)\mathrm{u1}+\mathrm{sin}\left(\mathrm{q4}\right)\mathrm{u2}+\mathrm{u6}+\mathrm{cos}\left(\mathrm{q5}\right)\mathrm{u4}=0,-\mathrm{cos}\left(\mathrm{q5}\right)\mathrm{sin}\left(\mathrm{q4}\right)\mathrm{u1}+\mathrm{cos}\left(\mathrm{q5}\right)\mathrm{cos}\left(\mathrm{q4}\right)\mathrm{u2}+\mathrm{sin}\left(\mathrm{q5}\right)\mathrm{u3}=0,\mathrm{sin}\left(\mathrm{q5}\right)\mathrm{sin}\left(\mathrm{q4}\right)\mathrm{u1}-\mathrm{sin}\left(\mathrm{q5}\right)\mathrm{cos}\left(\mathrm{q4}\right)\mathrm{u2}+\mathrm{cos}\left(\mathrm{q5}\right)\mathrm{u3}-\mathrm{u5}=0\right]:$
 > $A,v≔\mathrm{GenerateMatrix}\left(\mathrm{eqs},\left[\mathrm{u1},\mathrm{u2},\mathrm{u3},\mathrm{u4},\mathrm{u5},\mathrm{u6}\right]\right)$
 ${A}{,}{v}{≔}\left[\begin{array}{cccccc}{0}& {0}& {1}& {0}& {-}{\mathrm{cos}}{}\left({\mathrm{q5}}\right)& {0}\\ {\mathrm{cos}}{}\left({\mathrm{q4}}\right)& {\mathrm{sin}}{}\left({\mathrm{q4}}\right)& {0}& {\mathrm{cos}}{}\left({\mathrm{q5}}\right)& {0}& {1}\\ {-}{\mathrm{cos}}{}\left({\mathrm{q5}}\right){}{\mathrm{sin}}{}\left({\mathrm{q4}}\right)& {\mathrm{cos}}{}\left({\mathrm{q5}}\right){}{\mathrm{cos}}{}\left({\mathrm{q4}}\right)& {\mathrm{sin}}{}\left({\mathrm{q5}}\right)& {0}& {0}& {0}\\ {\mathrm{sin}}{}\left({\mathrm{q4}}\right){}{\mathrm{sin}}{}\left({\mathrm{q5}}\right)& {-}{\mathrm{cos}}{}\left({\mathrm{q4}}\right){}{\mathrm{sin}}{}\left({\mathrm{q5}}\right)& {\mathrm{cos}}{}\left({\mathrm{q5}}\right)& {0}& {-1}& {0}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {0}\\ {0}\\ {0}\end{array}\right]$ (8)
 > $\mathrm{Normalizer}≔e↦\mathrm{simplify}\left(e,'\mathrm{trig}'\right)$
 ${\mathrm{Normalizer}}{≔}{e}{↦}{\mathrm{simplify}}{}\left({e}{,}'{\mathrm{trig}}'\right)$ (9)
 > $\mathrm{Rank}\left(A\right)$
 ${3}$ (10)