MaplePortal/MatrixMath - Maple Help

 Matrix Computation

 Introduction

Maple has many tools for linear algebra. Its capabilities include

 • symbolic and numeric computations, and hybrid matrices
 • eigenvalues and eigenvectors, both classical and generalized.
 • linear algebra over finite fields.
 • matrix factorizations and system solvers
 • numerical methods for dense and sparse systems with a high degree of user control
 • hardware float and arbitrary precision software float data
 • numeric routines from CLAPACK and optimized vendor BLAS (ATLAS and MKL) libraries, called automatically when appropriate.
 • automatically parallelized numeric computation, when appropriate

 Symbolic Matrix Computation

Here, we derive the Denavit-Hartenberg matrix for a robotic serial manipulator. These matrices were entered using the Matrix palette (other methods are described here) and a period is used for matrix multiplication.

 > $\mathrm{B1}≔\left[\begin{array}{cccc}1& 0& 0& 0\\ 0& 1& 0& 0\\ 0& 0& 1& \mathrm{d__i}\\ 0& 0& 0& 1\end{array}\right].\left[\begin{array}{cccc}\mathrm{cos}{}\left(\mathrm{θ__i}\right)& -\mathrm{sin}{}\left(\mathrm{θ__i}\right)& 0& 0\\ \mathrm{sin}{}\left(\mathrm{θ__i}\right)& \mathrm{cos}{}\left(\mathrm{θ__i}\right)& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{array}\right]:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}$
 > $\mathrm{B2}≔\left[\begin{array}{cccc}1& 0& 0& 0\\ 0& \mathrm{cos}{}\left(\mathrm{α__i}\right)& -\mathrm{sin}{}\left(\mathrm{α__i}\right)& 0\\ 0& \mathrm{sin}{}\left(\mathrm{α__i}\right)& \mathrm{cos}{}\left(\mathrm{α__i}\right)& 0\\ 0& 0& 0& 1\end{array}\right].\left[\begin{array}{cccc}1& 0& 0& \mathrm{a__i}\\ 0& 1& 0& 0\\ 0& 0& 1& 0\\ 0& 0& 0& 1\end{array}\right]:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}$
 > $\mathrm{H}≔\mathrm{B1}.\mathrm{B2}$
 $\left[\begin{array}{cccc}\mathrm{cos}{}\left(\mathrm{θ__i}\right)& -\mathrm{sin}{}\left(\mathrm{θ__i}\right){}\mathrm{cos}{}\left(\mathrm{α__i}\right)& \mathrm{sin}{}\left(\mathrm{θ__i}\right){}\mathrm{sin}{}\left(\mathrm{α__i}\right)& \mathrm{cos}{}\left(\mathrm{θ__i}\right){}\mathrm{a__i}\\ \mathrm{sin}{}\left(\mathrm{θ__i}\right)& \mathrm{cos}{}\left(\mathrm{θ__i}\right){}\mathrm{cos}{}\left(\mathrm{α__i}\right)& -\mathrm{cos}{}\left(\mathrm{θ__i}\right){}\mathrm{sin}{}\left(\mathrm{α__i}\right)& \mathrm{sin}{}\left(\mathrm{θ__i}\right){}\mathrm{a__i}\\ 0& \mathrm{sin}{}\left(\mathrm{α__i}\right)& \mathrm{cos}{}\left(\mathrm{α__i}\right)& \mathrm{d__i}\\ 0& 0& 0& 1\end{array}\right]$ (1)

Maple will handle arbitrarily large symbolic matrices.

 Numeric Matrix Computation

Here we solve the linear system M.x = v for a sparse system. Numerical data is randomly generated

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $M≔\mathrm{RandomMatrix}\left(1000,1000,\mathrm{density}=0.001,\mathrm{datatype}=\mathrm{float}\left[8\right]\right);$
 > $v≔\mathrm{RandomVector}\left(1000,\mathrm{density}=0.001,\mathrm{datatype}=\mathrm{float}\left[8\right]\right)$
 >
 > $x≔\mathrm{LinearSolve}\left(M,v\right)$

To test the accuracy of the numeric solution, the following quantity must be zero or a very small number

 > $\mathrm{Norm}\left(M.x-v\right)$
 ${0.}$ (2)

 Applications