Baixe o app para aproveitar ainda mais
Prévia do material em texto
Review of Linear Algebra & Introduction to Mathcad 1 Basic Definitions Matrix size is determined from the number of rows and columns: m Rows × n Columns [A] = a11 a12 . . . a1n a21 a22 . . . a2n ... ... ... ... am1 am2 . . . amn [A] is a m x n matrix Terms • Matrix: capital letters in brackets, Ex: [A] • Elements within matrix: lower case letters, Ex: a12 • Column Matrix: in { }, Ex: {A} = a11 a21 a31 • Row Matrix: in [ ], Ex: [A] = [ a11 a12 a13 ] • Diagonal Matrix: elements only along the principal diagonal, all others zero (aij = 0 when i 6= j ), Ex.: [A] = a11 0 0 0 0 a22 0 0 0 0 a33 0 0 0 0 a44 • Identity or Unit Matrix: elements equal 1 on the principal diagonal, all others equal zero, Ex.: [I] = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 2 Matrix Addition and Subtraction Each matrix must have the same number of rows and columns. Ex.: [A]m×n and [B]m×n [A] and [B] must both have dimensions m× n [A] + [B] = [ a11 a12 a13 a21 a22 a23 ] + [ b11 b12 b13 b21 b22 b23 ] [A] + [B] = [ a11 + b11 a12 + b12 a13 + b13 a21 + b21 a22 + b22 a23 + b23 ] [A]− [B] = [ a11 − b11 a12 − b12 a13 − b13 a21 − b21 a22 − b22 a23 − b23 ] For: [A] + [B] = [C] cij = aij + bij where i = 1, 2, . . . ,m and j = 1, 2, . . . , n 1 3 Matrix Multiplication 3.1 Scalar To multiply a matrix by a scalar, each element is multiplied by the scalar. b[A] = b a11 a12 a13a21 a22 a23 a31 a32 a33 = ba11 ba12 ba13ba21 ba22 ba23 ba31 ba32 ba33 3.2 Multiplying Two Matrices If: [A] [B] Then: [A] ≡ Pre-multiplier Matrix, [B] ≡ Post-multiplier Matrix The number of columns in the pre-multiplier MUST equal the number of rows in the post-multiplier matrix! [A]m×n[B]n×p = [C]m×p If: [A] = a11 a12 a13 a21 a22 a23 a31 a32 a33 a41 a42 a43 a51 a52 a53 [B] = b11 b12 b13 b14b21 b22 b23 b24 b31 b32 b33 b34 [A]5×3 and [B]3×4 Then: [A][B] = [C]5×4, where the solution for each element in [C] is: cmp = n∑ k=1 amkbkp 3.3 Matrix Multipication: Example a11 a12 a13 a21 a22 a23 a31 a32 a33 a41 a42 a43 a51 a52 a53 b11 b12 b13 b14b21 b22 b23 b24 b31 b32 b33 b34 = c11 c12 c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 c51 c52 c53 c54 For example, c23 equals Row 2 of [A] times Column 3 of [B] c23 = a21b13 + a22b23 + a23b33 For example, c54 equals Row 5 of [A] times Column 4 of [B] c54 = a51b14 + a52b24 + a53b34 For example, c22 equals Row 2 of [A] times Column 2 of [B] c22 = a21b12 + a22b22 + a23b32 2 3.4 Multiplying More than One Matrix Commutative: No! [A][B] 6= [B][A] Associative: Yes! [A]([B][C]) = ([A][B])[C] Distributive: Yes! ([A] + [B])[C] = [A][C] + [B][C] [A]([B] + [C]) = [A][B] + [A][C] For a Square Matrix: [A]n = n times︷ ︸︸ ︷ [A][A] . . . [A] [I][A] = [A][I] = [A], where [I] = Identity matrix 4 Partitioning a Matrix Partitioned matrices require less computer memory to perform operations: [A] = a11 a12 a13 a14 a15 a16 a21 a22 a23 a24 a25 a26 a31 a32 a33 a34 a35 a36 a41 a42 a43 a44 a45 a46 a51 a52 a53 a54 a55 a56 = [ A11 A12 A21 A22 ] where [A11] = [ a11 a12 a13 a21 a22 a23 ] [A12] = [ a14 a15 a16 a24 a25 a26 ] [A21] = a31 a32 a33a41 a42 a43 a51 a52 a53 [A22] = a34 a35 a36a44 a45 a46 a54 a55 a56 4.1 Add & Subtract If: [B] is 5x6 and is partitioned the same as [A] Then: [A] + [B] = [ A11 +B11 A12 +B12 A21 +B21 A22 +B22 ] 4.2 Multiplying Matrix multiplication can be performed only when the number of Columns in the Pre-multiplier matrix is equal to the number of Rows in the Post-multiplier matrix. [C] = c11 c12 c13 c21 c22 c23 c31 c32 c33 c41 c42 c43 c51 c52 c53 c61 c62 c63 = [ C11 C12 C21 C22 ] [C11] = c11 c12c21 c22 c31 c32 {C12} = c13 c23 c33 [C21] = c41 c42c51 c52 c61 c62 {C22} = c43 c53 c63 3 Multiplying [C] by [A] from above: [D] = [A][C] = [ A11 A12 A21 A22 ] [ C11 C12 C21 C22 ] [D] = [A][C] = [ A11C11 +A12C21 A11C12 +A12C22 A21C11 +A22C21 A21C12 +A22C22 ] [D] = [ D11 D12 D21 D22 ] Therefore, we get... [D11] = [A11][C11] + [A12][C21] [D12] = [A11]{C12}+ [A12]{C22} [D21] = [A21][C11] + [A22][C21] [D22] = [A21]{C12}+ [A22]{C22} 5 Transposing Matrices Finite Element formulations frequently can be solved more efficiently through transposing matrices. Transposing a matrix creates a new matrix with Columns created from Rows of the original matrix. Ex.: [K](1) = [ k1 −k1 −k1 k1 ] ︸ ︷︷ ︸ Element Stiffness Matrix [K](1G) = k1 −k1 0 0 0 −k1 k1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ︸ ︷︷ ︸ Its position in the Global Stiffness Matrix 5.1 Transpose Example If [A1] = [ 1 0 0 0 0 0 1 0 0 0 ] And [A1] T = 1 0 0 1 0 0 0 0 0 0 Then [K](1G) = [A1] T [K](1)[A1] [K](1G) = 1 0 0 1 0 0 0 0 0 0 [ k1 −k1 −k1 k1 ] [ 1 0 0 0 0 0 1 0 0 0 ] = k1 −k1 0 0 0 −k1 k1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Note that [A1] T is the Transpose of [A1] 4 5.2 Transpose Example 2 This can be repeated for each Element Matrix [K](2G) = [A2] T [K](2)[A2] Where [A2] = [ 0 1 0 0 0 0 0 1 0 0 ] and [A2] T = 0 0 1 0 0 1 0 0 0 0 [K](2G) = 0 0 0 0 0 0 k2 −k2 0 0 0 −k2 k2 0 0 0 0 0 0 0 0 0 0 0 0 5.3 Transpose Summary In general, to obtain the Transpose of a matrix [X] of size m× n, the first row of [X] becomes the first column of [X]T . The second row of [X] becomes the second column of [X]T . The third row of [X] becomes the third column of [X]T and so on. [X]T will be of size n×m. Transpose Operations: ([A] + [B] + . . .+ [X])T = [A]T + [B]T + . . .+ [X]T ([A][B] . . . [X])T = [X]T . . . [B]T [A]T 6 Symmetric Matrix A symmetric matrix must be a Square Matrix where the Elements are amn = anm. Therefore, [A] = [A]T . Ex.: 2 3 6 10 3 3 5 4 2 1 6 4 9 3 6 10 2 3 10 2 3 1 6 2 5 7 Determinant of a Matrix Determinants are only defined for a Square Matrices and will result in a single number. The Determinant of a matrix is used for: 1. Solving a set of Simultaneous Equations 2. Determining the Inverse of a Matrix 3. Forming the Characteristic equations for a dynamic problem (Eigenvalue Problem) Notation: Det[A], det[A], |A|, ∣∣∣∣a11 a12a21 a22 ∣∣∣∣ 5 7.1 Definition For . . . [A] = a11 a12 a13a21 a22 a23 a31 a32 a33 . . . the determinant is: |A| = ∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ = a11a22a33 + a12a23a31 + a13a21a32 − a13a22a31 − a11a23a32 − a12a21a33 7.2 Solution Procedures: Minor Lower Elements Method∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ = a11 ∣∣∣∣a22 a23a32 a33 ∣∣∣∣− a12 ∣∣∣∣a21 a23a31 a33 ∣∣∣∣+ a13 ∣∣∣∣a21 a22a31 a32 ∣∣∣∣ Where: ∣∣∣∣a22 a23a32 a33 ∣∣∣∣ = a22a33 − a23a32∣∣∣∣a21 a23a31 a33 ∣∣∣∣ = a21a33 − a23a31∣∣∣∣a21 a22a31 a32 ∣∣∣∣ = a21a32 − a22a31 7.3 Solution Procedures: Direct Expansion Method (Note this cannot be used for Higher-Order determinants!!) 2 x 2 case: Add Solid Arrows, Subtract Dashed Arrows∣∣∣∣b11 b12b21 b22 ∣∣∣∣ = b11b22 − b12b21 3 x 3 case: ∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ = a11 a12 a13 a11 a12 a21 a22 a23 a21 a22 a31 a32 a33 a31 a32∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ = a11a22a33 + a12a23a31 + a13a21a32 − a13a22a31 − a11a23a32 − a12a21a33 7.4 Example of Solution: Option 1 Method 1 is more versatile, Ex.: Det[C] = ∣∣∣∣∣∣∣∣ c11 c12 c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 ∣∣∣∣∣∣∣∣ c11 c12c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 c11 c12 c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 c11 c12 c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 c11 c12 c13 c14 c21 c22 c23 c24 c31 c32 c33 c34 c41 c42 c43 c44 Det[C] = c11 ∣∣∣∣∣∣ c22 c23 c24 c32 c33 c34 c42 c43 c44 ∣∣∣∣∣∣− c12 ∣∣∣∣∣∣ c21 c23 c24 c31 c33 c34 c41 c43 c44 ∣∣∣∣∣∣+ c13 ∣∣∣∣∣∣ c21 c22 c24 c31 c32 c34 c41 c42 c44 ∣∣∣∣∣∣− c14 ∣∣∣∣∣∣ c21 c22 c23 c31 c32 c33 c41 c42 c43 ∣∣∣∣∣∣ 6 Minors of Minors ∣∣∣∣∣∣ c22 c23 c24 c32 c33 c34 c42 c43 c44 ∣∣∣∣∣∣ c22 c23 c24 c32 c33 c34 c42 c43 c44 c22 c23 c24 c32 c33 c34 c42 c43 c44 c22 c23 c24 c32 c33 c34 c42 c43 c44∣∣∣∣∣∣ c22 c23 c24 c32 c33 c34 c42 c43 c44 ∣∣∣∣∣∣ = c22 ∣∣∣∣c33 c34c43 c44 ∣∣∣∣− c23 ∣∣∣∣c32 c34c42 c44 ∣∣∣∣+ c24 ∣∣∣∣c32 c33c42 c43 ∣∣∣∣ 8 Solution of Simultaneous Equations: Cramer’s Rule General form of linear algebraic equations: a11x1 + a12x2 + a13x3 = b1 a21x1 + a22x2 + a23x3 = b2 a31x1 + a32x2 + a33x3 = b3 In matrix form: ∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ x1 x2 x3 = b1 b2 b3 Final solution: x1 = ∣∣∣∣∣∣ b1 a12 a13 b2 a22 a23 b3 a32 a33 ∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ x2 = ∣∣∣∣∣∣ a11 b1 a13 a21 b2 a23 a31 b3 a33 ∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ x3 = ∣∣∣∣∣∣ a11 a12 b1 a21 a22 b2 a31 a32 b3 ∣∣∣∣∣∣∣∣∣∣∣∣ a11 a12 a13 a21 a22 a23 a31 a32 a33 ∣∣∣∣∣∣ OR we can write it as... {B} in column 1 {B} in column 2 {B} in column 3 ↓ ↓ ↓ x1 = Det[A] Det[A] x2 = Det[A] Det[A] x3 = Det[A] Det[A] 9 Gauss Elimination Method Ex.: Linear Algebraic Equations: 2x2 +x4 = 0 2x1 +2x2 +3x3 +2x4 = −2 4x1 −3x2 +x4 = −7 6x1 +x2 −6x3 −5x4 = 6 Matrix form: [A]{X} = {B} 7 0 2 0 1 2 2 3 2 4 −3 0 1 6 1 −6 −5 x1 x2 x3 x4 = 0 −2 −7 6 Augmented Coefficient Matrix: ([A] & {B} Combined) 0 2 0 1 0 2 2 3 2 −2 4 −3 0 1 −7 6 1 −6 −5 6 9.1 Swap Row 1 with the row containing the largest value in Column 1 (i.e. Row 4) 6 1 −6 −5 6 2 2 3 2 −2 4 −3 0 1 −7 0 2 0 1 0 9.2 Make all Elements in first Column (except Row 1) = 0 Start by dividing Row 1 by Column 1 term (i.e. 6): 1 1/6 −1 −5/6 1 2 2 3 2 −2 4 −3 0 1 −7 0 2 0 1 0 Multiply Row 1 by Column 1 term in Row 2 (i.e. 2) and subtract it from Row 2: 1 1/6 −1 −5/6 1 (2− 2) (2− 2/6) (3−−2) (2− −10/6) (−2− 2) 4 −3 0 1 −7 0 2 0 1 0 Multiply Row 1 by Column 1 term in Row 3 (i.e. 4) and subtract it from Row 3 1 1/6 −1 −5/6 1 0 5/3 5 11/3 −4 (4− 4) (−3− 4/6) (0−−4) (1− −20/6) (−7− 4) 0 2 0 1 0 Multiply Row 1 by Column 1 term in Row 4 (i.e. 0) and subtract it from Row 4 1 1/6 −1 −5/6 1 0 5/3 5 11/3 −4 0 −22/6 4 13/3 −11 0 2 0 1 0 9.3 Swap Row 2 with the row containing the largest value in Column 2, Except Row 1 (i.e. Row 3) 1 1/6 −1 −5/6 1 0 −22/6 4 13/3 −11 0 5/3 5 11/3 −4 0 2 0 1 0 8 9.4 Make all elements in Column 2 (Except Rows 1 & 2) = 0 Start by dividing Row 2 by Column 2 term (i.e. -22/6) 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 5/3 5 11/3 −4 0 2 0 1 0 Multiply Row 2 by Column 2 term in Row 3 (i.e. 5/3) and subtract it from Row 3 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 (0) (5/3 − 5/3) (5− −60/33) (11/3 − −65/33) (−4− 15/3) 0 2 0 1 0 Multiply Row 2 by Column 2 term in Row 4 (i.e. 2) and subtract it from Row 4 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 0 225/33 186/33 −9 0 0 24/11 37/11 −6 9.5 Make elements in Column 3 (except Rows 1, 2, & 3) = 0 Start by dividing Row 3 by Column 3 term (i.e. 225/33) 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 0 1 186/225 −297/225 0 0 24/11 37/11 −6 Multiply Row 3 by Column 3 term in Row 4 (i.e. 24/11) and subtract it from Row 4 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 0 1 186/225 −297/225 0 0 (24/11)− (24/11) 37/11 − (186/225)(24/11) −6− (−297/225)(24/11) 9.6 Resolution 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 0 1 186/225 −297/225 0 0 0 3861/2475 −7722/2475 Divide Row 4 by Column 4 term (i.e. 3861/2475) 1 1/6 −1 −5/6 1 0 1 −12/11 −13/11 3 0 0 1 186/225 −297/225 0 0 0 1 −7722/3861 Returning to Original Matrix form 1 1/6 −1 5/6 0 1 −12/11 −13/11 0 0 1 186/225 0 0 0 1 x1 x2 x3 x4 = 1 3 −297/225 −7722/3861 9 Therefore: x4 = −7722/3861 or x4 = −2.00 Back substituting one-by-one and solving: x3 = 0.333 x2 = 1.00 x1 = −0.500 10 Using MATLAB (pp. 102-105) Enter Matrices as follows: [A] = 1 2 34 5 6 7 8 9 >> A = [1 2 3;4 5 6;7 8 9] 10 11 12 13
Compartilhar