170 likes | 689 Views
Matrix Algebra - Introduction Continued. Special Matrices. If S scalar, A * S = S * A . A * I = A To convert a scalar, k, to a matrix, multiply scalar by I. Comments on Diagonal/Triangular Matrices. It is easy to evaluate - clearly x = 4, y = 5 and z = 9.
E N D
Matrix Algebra - Introduction Continued Special Matrices If S scalar, A * S = S * A. A* I = A To convert a scalar, k, to a matrix, multiply scalar by I EG1C2 Engineering Maths: Matrix Algebra 2
Comments on Diagonal/Triangular Matrices It is easy to evaluate - clearly x = 4, y = 5 and z = 9 It is quite easy to evaluate: Clearly z = 2 from the 3rd row. Then, row 2 gives 2y + 4*2 = 18; But z known, so y = 5. Then, row 1 gives x + 3*5 + 2*2 = 21; x = 2 EG1C2 Engineering Maths: Matrix Algebra 2
What if matrix not triangular/diagonal? It turns out that there is a rather useful matrix, such that So pre-multiply both sides of equation by the arbitrary matrix EG1C2 Engineering Maths: Matrix Algebra 2
Multiplying out the matrices we get a simplified equation This, of course, is an equation we solved earlier. Thus the solution to the equation is x = 2, y = 5 and z = 2. If pre-multiply one side of eqn, must do same to other side. EG1C2 Engineering Maths: Matrix Algebra 2
Application Stochastic Matrix + Markov Process • In 1995 30% of graduates become researchers (R), 20% get jobs in commercial sector (C) and 50% join industry (I). • Over 5 years this changes according to the following table: each element is the probability of transition. • To R C I • From R 0.7 0.1 0.2 (e.g. 0.2 prob of R to I) • C 0.1 0.6 0.3 (e.g. 0.6 prob of stay C) • I 0.1 0.1 0.8 (NB Rows add up to 1) This can be put in matrix form, a so-called Stochastic Matrix Let vector for numbers doing jobs in 1995 be EG1C2 Engineering Maths: Matrix Algebra 2
Then the job situation in year 2000 is found by: If the same transition matrix applies, the jobs in 2005 are EG1C2 Engineering Maths: Matrix Algebra 2
We can find situation back in 1990 Post-multiplying by another ‘magic’ matrix: Hence 200 = 6R, so R = 33.33 140 = 2.4R + 3C so C = (140-80)/3 = 20 100 = R + C + I so I = 46.67 EG1C2 Engineering Maths: Matrix Algebra 2
Remember, (A*B)T=BT*AT By transposing the matrices (note order), the equation becomes: This will be used later. Note, to find situation in 1990, equation is And we then pre-multiply to get EG1C2 Engineering Maths: Matrix Algebra 2
Application : 2D CAD package Draw logic circuits - first define gates, then have circuit with them • AND gate: size 100,100 bottom left corner at 0,0. • On drawing, AND gate is size 25*25 at 25,25: must transform • 0,0 on gate = 25,25 on drawing; 0,100 25,50; 50,0 37.5, 25 EG1C2 Engineering Maths: Matrix Algebra 2
This is achieved by scaling and translating each point: scaling x’ = x / 4; y’ = y / 4; translating x’ = x + 25; y’ = y + 25; overall x’ = x / 4 + 25 y’ = y / 4 + 25; In general want: x’ = x * Sx; y’ = y * Sy x’ = x + Dx; y’ = y + Dy In matrix form, point x,y defined by [x y 1] 1 is dummy element: so have square matrices for multiplication. Scaling matrix - to scale x by Sx and y by Sy Translation matrix - to translate in x by Dx and in y by Dy EG1C2 Engineering Maths: Matrix Algebra 2
To draw AND gate, transformation matrix scaling*translation Then any point x,y on the AND gate is transformed to x',y', by: For drawing the NOT gate, we need a rotation matrix also Rotation matrix - by angle A anticlockwise EG1C2 Engineering Maths: Matrix Algebra 2
To draw the NOT gate: scale by 0.25,0.25, rotate by 90o, translate by 100,50; thus Then any point x,y on the NOT gate is transformed to x',y', by: Exercise: To draw NAND gate, half size, rotated by 180O at 50,100: EG1C2 Engineering Maths: Matrix Algebra 2