Download presentation
Presentation is loading. Please wait.
Published byLiliana Harriet May Modified over 9 years ago
1
p1 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Solving Linear Equations Given the equations 3x + 4y = 10 2x + z = 7 y + 2z = 7 Solve by removing x and y, to find z, and thence find x and y. First equation * 2 - second equation * 3 gives 8y - 3z = -1 That equation - third equation * 8 gives -19z = -57, so z = 3. So y = 7 - 2z = 1 2x = 7 - z = 4 So x = 2 We now present a matrix method for doing that.
2
p2 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Linear Equations and Gaussian Elimination A linear system, described by n equations in n unknowns, a 11 x 1 + a 12 x 2 +.. a 1n x n = b 1 a 21 x 1 + a 22 x 2 +.. a 2n x n = b 2 : : : : a n1 x 1 + a n2 x 2 +.. a nn x n = b n can be expressed in matrix terms: A x = b; where Can use inverses to find x. Better method - Gaussian elimination. Reduce A to a triangular matrix (echelon form) then find each x.
3
p3 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Form Augmented Matrix then process Augmented Matrix is A and b combined Make A part triangular Hence x n found easily, then x n-1, x n-2, etc. This means
4
p4 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Demonstrate this by example The equations describing the above are:
5
p5 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Call the first row the pivot row, and the first element the pivot. Use the pivot row to eliminate the value in the pivot column in all the rows below the pivot, i.e. to make these elements 0. Second row: subtract 2rd row from 3 * the pivot row. Get [3*1 -3 3*-1-5 3*-1-0 0-14] = [0 -8 -3 -14]. Third row - element is already 0 - don’t need to do anything.
6
p6 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Next eliminate the 5 in row 3. Pivot row is row 2, pivot is -8 Then add 5 * pivot row to 8 * third row, so row 3 becomes [0 -8*5 + 5*8 -3*5 + -2*8 -14*5 + 8 * 1] = [ 0 0 -31 -62] Last row represents: -31*i 3 = -62;i 3 = 2A. Second row represents: -8*i 2 - 3*i 3 = -14; i 2 = (14-3*2)/8 = 1A. First row represents i 1 = i 2 + i 3 ;i 1 = 3A. As a check: 5i 2 - 2 i 3 = 5-4 = 1 and 3i 1 + 5 i 2 = 9+5 = 14 Good! Comment - At start of process, if a diagonal has a zero value, swap its row with one which has a non-zero value. Note, when doing by hand good idea to multiply rows by integers.
7
p7 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Exercise A cantilever beam bends due to its own weight and an applied force. The relative heights at points along the beam are given by: -3 y 1 + y 2 = -2; y 1 - 3 y 2 + y 3 = -5; 2 y 2 - 3 y 3 = -7 Use Gaussian elimination to find values y 1, y 2 and y 3. Put equations in form: A y = b
8
p8 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Make first element in row2 zero; do row2 := row1 + 3 * row2: [ ] = [ ] Make second element in row3 zero; do row3 := row2 + 4 * row3: [ ] = [ ] Row3 means: * y 3 = so y 3 = Row2 means: * y 2 + * y 3 = so y 2 = Row1 means: * y 1 + * y 2 + * y 3 = so y 1 =
9
p9 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Comments on Method Matrices are processed by ‘elementary row operations’: each row processed by: rowX := p*rowY + q*rowZ (p,q <> 0) Equivalent to processing equations in this way. If the equations represent a linear system, then this is valid. To verify, consider equations: 3x + 2y = 5 and 4x - y = 3. The solution to this is x = y = 1. Form p*first equation + q*second? Is x = y = 1 still a solution? 3px +2py + 4qx-qy = 5p+3q. That is p (3x+2y) + q (4x - y) = 5p+3q Clearly x = y = 1 is still a solution to this equation. Thus the method seems to be valid. This method can in fact be extended - for finding inverses
10
p10 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Gauss Jordan Method for Matrix Inverse The adjoint inverse method is computationally poor - particularly for large matrices. Consider instead the Gauss-Jordan method. First write a matrix comprising A and I as one. For a 3*3 matrix: Process this so left half is unit matrix. Then right half is inverse. Do by processing rows: Row X = p * Row Y + q * Row Z, so that a suitable element in the row becomes 0 or 1. First ensure bottom two rows have 0 in their first column: Row 2 = Row 1 + 3 * Row 2 & Row3 = Row 1 + 3 * Row 3:
11
p11 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Next do Row 3 = Row 2 – 4 * Row 3, so 2 nd column in row 3 is 0: Next process top two rows so their entries in column 3 are 0. Row 1 = Row 3 + 15 * Row 1; Row 2 = 13 * Row 3 + 15 * Row 2
12
p12 RJM 07/08/02EG1C2 Engineering Maths: Matrix Algebra 5 Now set diagonals of the left half of the matrix to 1: Row 1 = Row 1 / 360; Row 2 = Row 2 / 120; Row 3 = Row 3 / -15. Then, make Row 1 column 2 = 0: Row 1 = Row 2 + 8 * Row 1
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.