Presentation is loading. Please wait.

Presentation is loading. Please wait.

Matrices SSP 2017.

Similar presentations


Presentation on theme: "Matrices SSP 2017."— Presentation transcript:

1 Matrices SSP 2017

2 Matrices A matrix is an array of numbers arranged in rows and columns; below is a generic “i × j” (pronounced “i by j”) matrix, where i represents the number of rows and j is the number of columns. Each entry is identified by its row and column location, as shown.

3 Uses of matrices Though there are many uses of matrices in math, science and engineering, at SSP, we concentrate on only a few of them: • Calculating cross-products • Transforming from one coordinate system to another • Solving systems of equations • Using matrix operations in Python Though most of the SSP calculations will be done with 3 × 3 matrices, what follows can be generalized for n × n matrices (or so-called square matrices).

4 Determinants The first operation with a matrix is to calculate its determinant; by definition, the determinant of a 2 × 2 matrix is (note that the parentheses turned into a straight-sided bracket): The term “determinant” was first used by Augustin-Louis Cauchy in 1812.

5 For a 3 × 3 matrix, evaluating the determinant is more difficult; the algorithm shown below is called “reduction by minors”. Please note the minus sign in the second term.

6 Calculating vector cross-products
Given vectors A and B, which may be expressed as components:

7 Coordinate transformations
Given all the coordinate transformations we do at SSP (alt-az, RA/dec, and others), matrices provide a calculation method. If you have the coordinates (x, y) in some coordinate system, and you want the coordinates (x’, y’) in a different coordinate system, and the two systems are connected by a rotation through angle θ, then… Hey, derive the transformation equations!

8

9

10 Coordinate transformations
x’ = x cos q + y sin q y’ = – x sin q + y cos q which translates, in matrix notation, to: The 2 × 2 matrix is called the rotation matrix R; this equation introduces the notion of matrix multiplication. Note that (x, y) may also specify the components of a vector.

11 Coordinate transformations
What is the determinant of the rotation matrix? What is the significance of this answer?

12 Coordinate transformations
What is the determinant of the rotation matrix? What is the significance of this answer? The determinant is 1, which indicates that the length of any vector undergoing the rotation will not change.

13 Coordinate transformations
That transformation is equivalent to rotating the vector back by an angle q.

14 Systems of equations First published by Gabriel Cramer in 1750, “Cramer’s Rule” uses matrices to solve a system of n equations with n unknowns (a system of n simultaneous equations). For a system of equations: a11 x1 + a12 x2 + … + a1n xn = b1 a21 x1 + a22 x2 + … + a2n xn = b2 : : : : an1 x1 + an2 x2 + … + ann xn = bn where the a’s and b’s are constants and the x’s are the variables

15 Systems of equations Create the following determinants:

16 Systems of equations Then, the solutions to equation are:

17 An example A mechanical engineer, a materials scientist and a physicist worked on a component of the Mars Odyssey mission, and, like many technical staff, made life hard for the project manager. Instead of turning in an orderly timesheet for hours worked, the three staff scientists submitted the following note: "Between us, we worked a total of 20 hours. For this, we should be paid a total of $900." To meet strict accounting requirements, the project manager needed to know how many hours each individual scientist worked. She asked them, politely, for more information, to which they replied, tersely, "The materials scientist worked two fewer hours than the mechanical engineer." The project manager smiled; the problem was solved. She knew that the mechanical engineer's pay rate was $60 per hour, the materials scientist's rate was $40 per hour and the physicist's rate was $20 per hour. Who worked how many hours?

18 Let x = the number of hours the mechanical engineer worked;
y = the number of hours the materials scientist worked and z = the number of hours the physicist worked. Then 1 x + 1 y + 1 z = 20 for the hours and 60 x + 40 y + 20 z = 900 for the pay. In addition y + 2 = x or 1 x – 1 y + 0 z = 2, yielding three equations with three unknowns. So x = B1/A = –540/–60 = 9 hours y = B2/A = –420/–60 = 7 hours z = B3/A = –240/–60 = 4 hours

19 Properties of matrices
I is the identity matrix; there are “1”s along the diagonal, and there are “0”s off-diagonal. Any matrix multiplied by this matrix will yield the same matrix. For example,

20 Properties of matrices
In matrix multiplication, an n × m matrix may be multiplied by a m × p matrix, which will result in an n × p matrix. The number of columns in the first matrix must match the number of rows in the second matrix for a meaningful matrix to result.

21 Properties of matrices
A matrix may have a multiplicative inverse; that is, if A is matrix then there may exist a matrix A–1 such that A–1 A = I The inverse of a matrix may be calculated using any number of algorithms (e.g., Gauss-Jordan elimination), but generally, there is a function in most computer languages that performs the inversion. A rotation matrix’s inverse leads to rotation in the opposite direction; what’s the inverse of R?

22 Properties of matrices
A matrix may have a multiplicative inverse; that is, if A is matrix then there may exist a matrix A–1 such that A–1 A = I The inverse of a matrix may be calculated using any number of algorithms (e.g., Gauss-Jordan elimination), but generally, there is a function in most computer languages that performs the inversion.

23 Properties of matrices
A rotation matrix’s inverse leads to rotation in the opposite direction; what’s the inverse of R?

24 Properties of matrices
A rotation matrix’s inverse leads to rotation in the opposite direction; what’s the inverse of R? The inverse of the rotation matrix is also its transpose (all its off-diagonal elements have switched places across the diagonal)


Download ppt "Matrices SSP 2017."

Similar presentations


Ads by Google