diff --git a/mechanical/images/Matrix_transpose.gif b/mechanical/images/Matrix_transpose.gif new file mode 100644 index 0000000..d1a034a Binary files /dev/null and b/mechanical/images/Matrix_transpose.gif differ diff --git a/mechanical/images/vimscrot-2021-11-02T16:19:40,013146580+00:00.png b/mechanical/images/vimscrot-2021-11-02T16:19:40,013146580+00:00.png new file mode 100644 index 0000000..b8c2925 Binary files /dev/null and b/mechanical/images/vimscrot-2021-11-02T16:19:40,013146580+00:00.png differ diff --git a/mechanical/mmme1026_maths_for_engineering.md b/mechanical/mmme1026_maths_for_engineering.md index 06a5e82..ca00755 100755 --- a/mechanical/mmme1026_maths_for_engineering.md +++ b/mechanical/mmme1026_maths_for_engineering.md @@ -781,3 +781,349 @@ $$ but $B \ne C$ + +## Special Matrices + +### Square Matrix + +Where $m = n$ + +
+ + +#### Example 1 + +A $3\times3$ matrix. + + + +$$\begin{pmatrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{pmatrix}$$ + +
+ +
+ + +#### Example 2 + +A $2\times2$ matrix. + + + +$$\begin{pmatrix}1 & 2 \\ 4 & 5 \end{pmatrix}$$ + +
+ +### Identity Matrix + +The identity matrix is a square matrix whose eleements are all 0, except the leading diagonal which +is 1s. +The leading diagonal is the top left to bottom right corner. + +It is usually denoted by $I$ or $I_n$. + +The identity matrix has the properties that + +$$AI = IA = A$$ + +for any square matrix $A$ of the same order as I, and + +$$Ix = x$$ + +for any vector $x$. + +
+ + +#### Example 1 + +The $3\times3$ identity matrix. + + + +$$\begin{pmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{pmatrix}$$ + +
+ +
+ + +#### Example 2 + +The $2\times2$ identity matrix. + + + +$$\begin{pmatrix}1 & 0 \\ 0 & 1 \end{pmatrix}$$ + +
+ +### Transposed Matrix + +The transpose of matrix $A$ of order $m\times n$ is matrix $A^T$ which has the order $n\times m$. +It is found by reflecting it along the leading diagonal, or interchanging the rows and columns of +$A$. + +![by [Lucas Vieira](https://commons.wikimedia.org/wiki/File:Matrix_transpose.gif)](./images/Matrix_transpose.gif) + +Let matrix $D = EF$, then $D^T = (EF)^T = E^TF^T$ + +#### Example 1 + +$$ +A = \begin{pmatrix}3 & 2 & 1 \\ 4 & 5 & 6 \end{pmatrix},\, +A^T = \begin{pmatrix}3 & 4 \\ 2 & 5 \\ 1 & 6\end{pmatrix} +$$ + +#### Example 2 + +$$ +B = \begin{pmatrix}1 \\ 4\end{pmatrix},\, +B^T = \begin{pmatrix}1 & 4\end{pmatrix} +$$ + +#### Example 3 + +$$ +C = \begin{pmatrix}1 & 2 & 3 \\ 0 & 5 & 1 \\ 2 & 3 & 7\end{pmatrix},\, +C^T = \begin{pmatrix}1 & 0 & 2 \\ 2 & 5 & 4 \\ 3 & 1 & 7\end{pmatrix} +$$ + +### Orthogonal Matrices + +A matrix, $A$, such that + +$$A^{-1} = A^T$$ + +is said to be orthogonal. + +Another way to say this is + +$$AA^T = A^TA = I$$ + +### Symmetric Matrices + +A square matrix which is symmetric about its leading diagonal: + +$$A = A^T$$ + +You can also express this as the matrix $A$, where + +$$a_{ij} = a_{ji}$$ + +is satisfied to all elements. + +
+ + +#### Example 1 + + + +$$\begin{pmatrix} +1 & 0 & -1 & 3 \\ +0 & 3 & 4 & -1 \\ +-2 & 4 & -1 & 6 \\ +3 & -7 & 6 & 2 +\end{pmatrix}$$ + +
+ +### Anti-Symmetric + +A square matrix is anti-symmetric if + +$$A = -A^T$$ + +This can also be expressed as + +$$a_{ij} = -a_{ji}$$ + +This means that all elements on the leading diagonal must be 0. + +
+ + +#### Example 1 + + + +$$\begin{pmatrix} +0 & -1 & 5 \\ +1 & 0 & 1 \\ +-5 & -1 & 0 +\end{pmatrix}$$ + +
+ +## The Determinant + +### Determinant of a 2x2 System + +The determinant of a $2x2$ system is + +$$D = a_{11}a_{22} - a_{12}a_{21}$$ + +It is denoted by + +$$ +\begin{vmatrix} +a_{11} & a_{12} \\ +a_{21} & a_{22} +\end{vmatrix} +\text{ or } +\det +\begin{pmatrix} +a_{11} & a_{12} \\ +a_{21} & a_{22} +\end{pmatrix} +$$ + +- A system of equations has a unique solution if $D \ne 0$ +- If $D = 0$, then there are either + + - no solutions (the equations are inconsistent) + - intinitely many solutions + +### Determinant of a 3x3 System + +Let + +$$ +A = \begin{pmatrix} +a_{11} & a_{12} & a_{13} \\ +a_{21} & a_{22} & a_{23} \\ +a_{31} & a_{32} & a_{33} +\end{pmatrix} +$$ + +\begin{align*} +\det A = &a_{11} \times \det \begin{pmatrix}a_{22} & a_{23} \\ a_{32} & a_{33} \end{pmatrix} \\ + &-a_{12} \times \det \begin{pmatrix}a_{21} & a_{23} \\ a_{31} & a_{33} \end{pmatrix} \\ + &+a_{13} \times \det \begin{pmatrix}a_{21} & a_{22} \\ a_{31} & a_{32} \end{pmatrix} +\end{align*} + +The $2x2$ matrices above are created by removing any elements on the same row or column as its corresponding +coefficient: + +![](./images/vimscrot-2021-11-02T16:19:40,013146580+00:00.png) + +### Chessboard Determinant + +$\det A$ may be obtained by expanding out any row or column. +To figure out which coefficients should be subtracted and which ones added use the chessboard +pattern of signs: + +$$\begin{pmatrix} + & - & + \\ - & + & - \\ + & - & + \end{pmatrix}$$ + +### Properties of Determinants + +- $$\det A = \det A^T$$ +- If all elements of one row of a matrix are multiplied by a constant $z$, the determinant of the + new matrix is $z$ times the determinant of the original matrix: + + \begin{align*} + \begin{vmatrix} za & zb \\ c & d \end{vmatrix} &= zad - zbc \\ + &= z(ad-bc) \\ + &= z\begin{vmatrix} a & b \\ c & d \end{vmatrix} + \end{align*} + + This is also true if a column of a matrix is mutiplied by a constant. + + **Application** if the fator $z$ appears in each elements of a row or column of a determinant it + can be factored out + + $$\begin{vmatrix}2 & 12 \\ 1 & 3 \end{vmatrix} = 2\begin{vmatrix}1 & 6 \\ 1 & 3 \end{vmatrix} = 2 \times 3 + \begin{vmatrix} 1 & 2 \\ 1 & 1 \end{vmatrix}$$ + + **Application** if all elements in one row or column of a matrix are zero, the value of the + determinant is 0. + + $$\begin{vmatrix} 0 & 0 \\ c & d \end{vmatrix} = 0\times d - 0\times c = 0$$ + + + **Application** if $A$ is an $n\times n$ matrix, + + $$\det(zA) = z^n\det A$$ + +- Swapping any two rows or columns of a matrix changes the sign of the determinant + + \begin{align*} + \begin{vmatrix} c & d \\ a & b \end{vmatrix} &= cb - ad \\ + &= -(ad - bc) \\ + &= -\begin{vmatrix} a & b \\ c & d \end{vmatrix} + \end{align*} + + **Application** If any two rows or two columns are identical, the determinant is zero. + + **Application** If any row is a mutiple of another, or a column a multiple of another column, the + determinant is zero. + +- The value of a determinant is unchanged by adding to any row a constant multiple of another row, + or adding to any column a constant multiple of another column + +- If $A$ and $B$ are square matrices of the same order then + + $$\det(AB) = \det A \times \det B $$ + +## Inverse of a Matrix + +If $A$ is a square matrix, then its inverse matrix is $A^{-1}$ and is defined by the property that: + +$$A^{-1}A = AA^{-1} = I$$ + +- Not every matrix has an inverse +- If the inverse exists, then it is very useful for solving systems of equations: + + \begin{align*} + A\pmb{x} = \pmb b \rightarrow A^{-1}A\pmb x &= A^{-1}\pmb b \\ + I\pmb x &= A^{-1}\pmb b \\ + \pmb x &= A^{-1}\pmb b + \end{align*} + + Therefore there must be a unique solution to $A\pmb x = \pmb b$: $\pmb x = A^{-1}\pmb b$. + +- If $D = EF$ then + + $$D^-1 = (EF)^{-1} = F^{-1}E^{-1}$$ + +### Inverse of a 2x2 Matrix + +If $A$ is the $2x2$ matrix + +$$ +A = \begin{pmatrix} +a_{11} & a_{12} \\ +a_{21} & a_{22} +\end{pmatrix} +$$ + +and its determinant, $D$, satisfies $D \ne 0$, $A$ has the inverse $A^{-1}$ given by + +$$ +A^{-1} = \frac 1 D \begin{pmatrix} +a_{22} & -a_{12} \\ +-a_{21} & a_{11} +\end{pmatrix} +$$ + +If $D = 0$, then matrix $A$ has no inverse. + +
+ + +#### Example 1 + +Find the inverse of matrix $A = \begin{pmatrix} -1 & 5 \\ 2 & 3 \end{pmatrix}$. + + + +1. Calculate the determinant + + $$\det A = -1 \times 3 - 5 \times 2 = -13$$ + + Since $\det A \ne 0$, the inverse exists. + +2. Calculate $A^{-1}$ + + $$ A^{-1} = \frac 1 {-13} \begin{pmatrix} 3 & -5 \\ -2 & -1\end{pmatrix}$$