18 matrix math

Upload: roberto-enrique-sanchez-aleman

Post on 04-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 18 Matrix Math

    1/6

    Page 18-1

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    MATRIX MATHIn the BeginningSolve three equations with three unknowns.

    2x + 3y - 1z = -1 line 1-1x + 5y + 3z = -10 line 23x - 1y - 6z = 5 line 3

    Eliminate one of the unknowns:2x + 3y - 1z = -1 * 1 2x + 3y - 1z = -1 row 20

    -1x + 5y + 3z = -10 * 2 -2x + 10y + 6z = -203x - 1y - 6z = 5

    add to get: 13y +5z = -21

    Get another equation and eliminate x again:

    2x + 3y - 1z = -1-1x + 5y + 3z = -10 * 3 -3x + 15y + 9z = -303x - 1y - 6z = 5 * 1 3x - 1y - 6z = 5

    add to get: 14y + 3z = -25row 30

    Combine the two equations with two unknowns:13y +5z = -21 * 3 39y +15z = -6314y + 3z = -25 * 5 70y + 15z = -125

    subtract to get: 31y = -62and: y = -2

    Solve for z:13y +5z = -21 13 * -2 +5z = -21

    and: z = 1row 40

    To get x:2x + 3y - 1z = -1 2x + 3 * -2 - 1 * 1 = -1to get: x = 3 Figure 18-1 The common point of intersecting planes.

    These equations each create a family of lines. All of the lines lay within a singleplane as determined by that particular equation. The three planes created by theequations intersect at a single, finite point.

    The following calculations are used to plot the equations in AutoCad. row 50

    -1 plane 1 plane 2 plane 3x y z 0.5 x = -0.5 x = -1.5 x = 1.6 x = 10 y = 18 x = -0.67 x = 1.67 y = 4

    -1 -1 y = -1 y = 0 y = 1 y = -1 y = 0 y = 1 y = -1 y = 0 y = 13 -1 -6 5 z = -1 z = 0 z = 1 z = -1 z = 0 z = 1 z = -1 z = 0 z = 1

    1 6-2 x = -1 x = 0 x = 1 x = -1 x = 0 x = 1 x = -1 x = 0 x = 1

    x -0.666667 y = 0 y = -0.33 y = -0.67 y = -1.6 y = -2 y =- 2.4 y = -2 y = -5 y = -8z = -1 z = 0 z = 1 z = -1 z = 0 z = 1 z = -1 z = 0 z = 1

    x y z-1 -1 x = -1 x = 0 x = 1 x = -1 x = 0 x = 1 x = -1 x = 0 x = 13 -1 -6 5 y = -1 y = 0 y = 1 y = -1 y = 0 y = 1 y = -1 y = 0 y = 1

    -3 6 z = -4 z = 1 z = 6 z = -2 z = -3.33 z = -4.67 z = -1.17 z = -0.8 z = -0.52

    y -2

    x y z-1 -13 -1 -6 5

    -3 1 row 707

    z -1.166667

    row 80

    181 23 4

    5 -4.06 4.5=

  • 7/29/2019 18 Matrix Math

    2/6

    Page 18-2

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    181 23 4

    5 -4.06 4.5=

    MATRIX SOLUTIONNote that the equations take the form of:

    matrix constants vector a11 a12 a13 A This matrix is of order 3 x 3.a21 a22 a23 Ba31 a32 a33 C To enter a matrix array: use your cursor to outline an area in

    the shape of the array you want. Enter a formula such asThis matrix is of order 3 x 3. =minverse(B89:D91) and press [Ctrl] [Shift] [Enter] all at the

    2 3 -1 -1 same time to get {=MINVERSE(B89:D97)} in the array of cells.-1 5 3 -10 multiply the invert * constants vector row 903 -1 -6 5

    The quick solution, as explained below, is: invert the matrix constants vector 0.87097 -0.61290 -0.45161 -1 3 x

    -0.09677 0.29032 0.16129 x -10 = -2 y

    0.45161 -0.35484 -0.41935 5 1 z

    A matrix is a rectangular array of numbers which are called elements.Rows are the first number, columns the second number.Brackets are sometimes omitted. row 100

    A single row matrix is refereed to as a "row" or vector matrix. A single column matrix is referred to as a "column" or vector matrix.

    Matrices can be multiplied if matrix A has the same number of rows as matrix B has columns.Note that: AB BA AB = C BA C ABC = (AB)C = A(BC) A(B + C) = AB + AC

    A B AB 1 x 2 + 2 x 2 + 3 x 3 = 151 2 3 2 4 = 15 32 1 x 4 + 2 x 5 + 3 x 6 = 324 5 6 X 2 5 36 77 4 x 4 + 5 x 5 + 6 x 6 = 77

    3 6 4 x 2 + 5 x 2 + 6 x 3 = 36

    B A BA 2 x 1 + 4 x 4 = 182 4 1 2 3 = 18 24 30 2 x 2 + 4 x 5 = 242 5 X 4 5 6 22 29 36 2 x 3 + 4 x 6 = 303 6 27 36 45 2 x 1 + 5 x 4 = 22

    2 x 2 + 5 x 5 = 29 A' the transpose of matrix A 2 x 3 + 5 x 6 = 36

    A A' 3 x 1 + 6 x 4 = 271 2 3 1 4 3 x 2 + 6 x 5 = 364 5 6 2 5 3 x 3 + 6 x 6 = 45

    3 6

    A -1 the invert of matrix A A -1 A = A A -1 = I unitary matrixA A- I

    20 4 6 0.063 -0.023 -0.027 1 0 0

    4 34 -20 X -0.023 0.056 0.041 = 0 1 06 -20 31 -0.027 0.041 0.064 0 0 1

    Square 1 2 3 row 130Matrix 4 5 6

    7 8 9

    Symetrical 5 1 2Matrix 1 4 6

    2 6 3 Note: A' is often denoted as A_ in thismanual because the range name for

    Symetrical 5 1 2 A' appears as A_ in Excel. Another Matrix 4 6 notation for A' is At.also shown symetrical 3 row 140as

    Diagonal 5 0 0Matrix 0 6 0

    0 0 7

    Unit 1 0 0Matrix 0 1 0

    0 0 1row 150

  • 7/29/2019 18 Matrix Math

    3/6

    Page 18-3

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    181 23 4

    5 -4.06 4.5=

    3 x 3 MATRIX -- Circuit Anaylsis, Longhand Matrix SolutionSee the chapter Quadratic and Cubic Equations for the2 x 2 matrix solution of two straight lines.

    This example includes the longhand solution as wellas Excel's minverse and mmult functions. R_2 10 loop 2

    E_2 85 I_2 = 4.69 amp R_5 4Determine the current flow in each of the threeloops.

    R_1 10The typical use for this application is n R_6 20 loop 1 E_1 125equations with n unknowns. I_1 = 3.95 amp

    After designating the loop currents, we set upvoltage equations around each loop. The R_3 5

    current in R_5 is I_1 + I_2 whereas the current E_3 70in R_6 is I_2 - I_3 when referred to loop 2. loop 3 R_4 6I_3 = 4.52 amp

    In this model we'll use Maxwell's Method.row 170

    1. R_1 *I_1 + R_5 *(I_1 + I_2) + R4 *(I_1 + I_2) = E_12. R_2 *I_2 + R_5 *(I_3 + I_2) + R6 *(I_3 + I_2) = E_23. R_3 *I_3 + R_6 *(I_3 + I_2) + R4 *(I_3 + I_1) = E_3

    Figure 18-2 Circuit analysis with a 3 x 3 matrix.

    Note: the underbar _ in R_1 is an easy way to show the symbolCollect the coefficients of unknowns. as a three character variable and makes it easy to create rangeloop 1 (R_1 + R_4 + R_5) *I_1 + R_5 *I_2 + R_4 *I_3 = E_1 names with Insert Name Create. Using the symbols R2 or R2, willloop 2 R_5 *I_1 + (R_2 + R_5 + R_6) *I_2 - R_6 *I_3 = E_2 create range names that are also cell addresses -- not good.loop 3 R_4 *I_1 - R_6 *I_2 + (R_3 + R_4 + R_6) *I_3 = E_3 row 180

    The cells in a matrix array may contain equationswhich reference other inputs or equations.

    The matrix for these equations is: A x X = R(R_1+R_4+R_5) *I_1 + R_5 *I_2 + R_4 *I_3 = E_1R_5 *I_1 + (R_2+R_5+R_6) *I_2 + - R_6 *I_3 = E_2R_4 *I_1 + - R_6 *I_2 + (R_3+R_4+R_6) *I_3 = E_3

    loop 1 20 ohms + 4 ohms + 6 ohms = 125 voltsloop 2 4 + 34 + -20 = 85loop 3 6 + -20 + 31 = 70 row 190

    Laplace 20 34 -20 4 4 -20 6 4 34expansion -20 31 6 31 6 -20

    + 20 654 4 244 + 6 -28413080 976 -1704

    sum 10400 determinant

    Cramer's rule E I_2 I_3 I_1 E I_3 I_1 I_2 E row 200125 4 6 20 125 6 20 4 125

    85 34 -20 4 85 -20 4 34 8570 -20 31 6 70 31 6 -20 70

    10400 determinant 10400 10400

    34 -20 85 -20 34 85-20 31 70 31 -20 70

    + 125 654 = 34 *31 --20 *-20 20 4035 20 4080

    85 -20 4 -20 4 85 row 21070 31 6 31 6 70

    4 4035 125 244 4 -230

    85 34 4 85 4 3470 -20 6 70 6 -20

    + 6 -4080 6 -230 125 -284sum I_1 3.95 amps sum I_2 4.69 amps sum I_3 4.52 amps

    where 3.95 = (125 *654 - 4 *4,035 +6 *-4,080) / 10,400row 220

  • 7/29/2019 18 Matrix Math

    4/6

    Page 18-4

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    181 23 4

    5 -4.06 4.5=

    3 x 3 MATRIX MINVERSE and MMULT Excel Method1. R_1 *I_1 + R_5 *(I_1 + I_2) + R4 *(I_1 + I_2) E_12. R_2 *I_2 + R_5 *(I_3 + I_2) + R6 *(I_3 + I_2) E_23. R_3 *I_3 + R_6 *(I_3 + I_2) + R4 *(I_3 + I_1) E_3

    Collect the coefficients of unknowns.loop 1 (R_1 + R_4 + R_5) *I_1 + R_5 *I_2 + R_4 *I_3 E_1loop 2 R_5 *I_1 + (R_2 + R_5 + R_6) *I_2 - R_6 *I_3 E_2loop 3 R_4 *I_1 - R_6 *I_2 + (R_3 + R_4 + R_6) *I_3 E_3

    row 230matrix constants vector minverse mmult

    20 4 6 125 0.063 -0.023 -0.027 3.95 amps4 34 -20 85 -0.023 0.056 0.041 4.69 amps6 -20 31 70 -0.027 0.041 0.064 4.52 amps

    4 x 4 MATRIX MODEL Longhand Solution -- not the equation abovex1 20 4 6 3 125x2 4 34 -20 14 85x3 6 -20 31 -26 70 row 240x4 3 25 9 18 6Laplace expansion

    20 34 -20 14-20 31 -2625 9 18

    34 31 -26 -20 -20 -26 14 -20 319 18 25 18 25 9

    + 34 792 -20 290 + 14 -955 row 25026928 -5800 -13370

    20 19358 = 387160

    4 4 -20 146 31 -263 9 18

    4 31 -26 -20 6 -26 14 6 319 18 3 18 3 9

    row 260+ 4 792 -20 186 + 14 -39

    3168 -3720 -5464 6342 = 25368

    6 4 34 146 -20 -26

    3 25 18

    4 -20 -26 34 6 -26 14 6 -2025 18 3 18 3 25 row 270

    + 4 290 34 186 + 14 2101160 6324 2940

    6 -2224 = -13344

    3 4 34 -206 -20 313 25 9

    4 -20 31 34 6 31 -20 6 -20 row 28025 9 3 9 3 25

    + 4 -955 34 -39 + -20 210-3820 -1326 -4200

    3 -6694 = -20082

    sum 368530 determinant

    sum 368530 using MDETERM( ) to solve for the determinate of square matricesrow 290

  • 7/29/2019 18 Matrix Math

    5/6

    Page 18-5

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    181 23 4

    5 -4.06 4.5=

    4 x 4 MATRIX MODEL Longhand Solution -- Continued

    Cramer's rule125 4 6 3 20 125 6 3

    85 34 -20 14 4 85 -20 1470 -20 31 -26 6 70 31 -26

    6 25 9 18 3 6 9 18368530 determinant 368530

    row 300

    20 4 125 3 20 4 6 1254 34 85 14 4 34 -20 856 -20 70 -26 6 -20 31 703 25 6 18 3 25 9 6

    368530 368530

    34 -20 14 85 -20 14-20 31 -26 70 31 -26 row 31025 9 18 6 9 18

    + 125 19358 20 101856

    85 -20 14 4 -20 1470 31 -26 6 31 -26

    6 9 18 3 9 184 101856 125 6342

    85 34 14 4 85 1470 -20 -26 6 70 -26 row 320

    6 25 18 3 6 18

    + 6 2686 6 -12582

    85 34 -20 4 85 -2070 -20 31 6 70 31

    6 25 9 3 6 93 -133671 3 8571

    sum x1 6.59 sum x2 3.10row 330

    34 85 14 34 -20 85-20 70 -26 -20 31 7025 6 18 25 9 6

    20 -2686 20 -133671

    4 85 14 4 -20 856 70 -26 6 31 70 row 3403 6 18 3 9 6

    4 -12582 4 -8571

    4 34 14 4 34 856 -20 -26 6 -20 703 25 18 3 25 6

    125 -2224 6 16286

    4 34 85 4 34 -206 -20 70 6 -20 31 row 3503 25 6 3 25 9

    3 16286 125 -6694

    sum x3 -0.90 sum x4 -4.63

    row 360

  • 7/29/2019 18 Matrix Math

    6/6

    Page 18-6

    126992652.xls.ms_office

    MATRIX MATHChristy07:44

    01/31/13

    ENGINEERING with the SPREADSHEETCopyright 2006 American Society of Civil Engineers

    A B C D E F G H I J K L M N

    181 23 4

    5 -4.06 4.5=

    4 x 4 MATRIX MODEL Using MDETERMx1 20 4 6 3 125x2 4 34 -20 14 85x3 6 -20 31 -26 70x4 3 25 9 18 6

    determ 368530

    34 -20 14 85 -20 14 34 85 14 34 -20 85-20 31 -26 70 31 -26 -20 70 -26 -20 31 70 row 37025 9 18 6 9 18 25 6 18 25 9 6

    125 19358 6.57 20 101856 5.53 20 -2686 -0.15 20 -133671 -7.25

    85 -20 14 4 -20 14 4 85 14 4 -20 8570 31 -26 6 31 -26 6 70 -26 6 31 70

    6 9 18 3 9 18 3 6 18 3 9 64 101856 1.11 125 6342 2.15 4 -12582 -0.14 4 -8571 -0.09

    85 34 14 4 85 14 4 34 14 4 34 8570 -20 -26 6 70 -26 6 -20 -26 6 -20 70 row 380

    6 25 18 3 6 18 3 25 18 3 25 66 2686 0.04 6 -12582 -0.20 125 -2224 -0.75 6 16286 0.27

    85 34 -20 4 85 -20 4 34 85 4 34 -2070 -20 31 6 70 31 6 -20 70 6 -20 31

    6 25 9 3 6 9 3 25 6 3 25 93 -133671 -1.09 3 8571 0.07 3 16286 0.13 125 -6694 -2.27

    6.59 3.10 -0.90 -4.63 row 390

    4 x 4 MATRIX MINVERSE and MMULT Excel Method minverse mmult20 4 6 3 125 0.0525 0.0039 -0.0030 -0.0161 6.59

    4 34 -20 14 85 -0.0172 0.0396 0.0261 0.0097 3.106 -20 31 -26 70 -0.0060 -0.0154 0.0139 0.0331 -0.903 25 9 18 6 0.0182 -0.0480 -0.0427 0.0282 -4.63

    20 year old reference books refer to inverting a matrix as computer intensive. row 400Now, on a common personal computer, the inversion process is transparent.

    row 410

    row 420

    row 430