GG313 Lecture 12 Matrix Operations Sept 29, 2005.

Slides:



Advertisements
Similar presentations
Slide deck by Dr. Greg Reese Miami University MATLAB An Introduction With Applications, 5 th Edition Dr. Amos Gilat The Ohio State University Chapter 3.
Advertisements

Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
Matrix Algebra Matrix algebra is a means of expressing large numbers of calculations made upon ordered sets of numbers. Often referred to as Linear Algebra.
© 2005 Baylor University Slide 1 Fundamentals of Engineering Analysis EGR 1302 Unit 1, Lecture B Approximate Running Time - 24 minutes Distance Learning.
SOLVING SYSTEMS OF LINEAR EQUATIONS. Overview A matrix consists of a rectangular array of elements represented by a single symbol (example: [A]). An individual.
Refresher: Vector and Matrix Algebra Mike Kirkpatrick Department of Chemical Engineering FAMU-FSU College of Engineering.
Chapter 9 Gauss Elimination The Islamic University of Gaza
3_3 An Useful Overview of Matrix Algebra
Linear Algebraic Equations
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 12 System of Linear Equations.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Review of Matrix Algebra
Chapter 2 Matrices Definition of a matrix.
1 Neural Nets Applications Vectors and Matrices. 2/27 Outline 1. Definition of Vectors 2. Operations on Vectors 3. Linear Dependence of Vectors 4. Definition.
ECIV 520 Structural Analysis II Review of Matrix Algebra.
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Finding the Inverse of a Matrix
Lecture 7: Matrix-Vector Product; Matrix of a Linear Transformation; Matrix-Matrix Product Sections 2.1, 2.2.1,
Intro to Matrices Don’t be scared….
Modified Gary Larson Far Side cartoon
1 Operations with Matrice 2 Properties of Matrix Operations
1 Chapter 3 Matrix Algebra with MATLAB Basic matrix definitions and operations were covered in Chapter 2. We will now consider how these operations are.
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 10 Review: Matrix Algebra
Compiled By Raj G. Tiwari
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Chapter 4.1 Mathematical Concepts
Matrix Algebra. Quick Review Quick Review Solutions.
Matrices. Given below is a record of all the types of books kept in a class library. TypeFictionGeneral Malay2547 Chinese4072 English8085.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
CSE123 Lecture 5 Arrays and Array Operations. Definitions Scalars: Variables that represent single numbers. Note that complex numbers are also scalars,
Learner’s Guide to MATLAB® Chapter 2 : Working with Arrays.
Statistics and Linear Algebra (the real thing). Vector A vector is a rectangular arrangement of number in several rows and one column. A vector is denoted.
CMPS 1371 Introduction to Computing for Engineers MATRICES.
Overview Definitions Basic matrix operations (+, -, x) Determinants and inverses.
Lecture 28: Mathematical Insight and Engineering.
Unit 6 : Matrices.
Matrix Algebra and Regression a matrix is a rectangular array of elements m=#rows, n=#columns  m x n a single value is called a ‘scalar’ a single row.
Linear algebra: matrix Eigen-value Problems Eng. Hassan S. Migdadi Part 1.
Fundamentals of Engineering Analysis
ES 240: Scientific and Engineering Computation. Chapter 8 Chapter 8: Linear Algebraic Equations and Matrices Uchechukwu Ofoegbu Temple University.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
Chapter 9 Gauss Elimination The Islamic University of Gaza
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
Linear System of Simultaneous Equations Warm UP First precinct: 6 arrests last week equally divided between felonies and misdemeanors. Second precinct:
Unit 3: Matrices. Matrix: A rectangular arrangement of data into rows and columns, identified by capital letters. Matrix Dimensions: Number of rows, m,
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
Matrix Algebra Basics Chapter 3 Section 5. Algebra.
1 Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors. Review Matrices.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Lecture 1 Linear algebra Vectors, matrices. Linear algebra Encyclopedia Britannica:“a branch of mathematics that is concerned with mathematical structures.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Matrices Introduction.
MTH108 Business Math I Lecture 20.
MAT 322: LINEAR ALGEBRA.
Matrices and Vector Concepts
Linear Algebraic Equations and Matrices
Linear Algebra Lecture 2.
Chapter 7 Matrix Mathematics
Finding the Inverse of a Matrix
Linear Algebraic Equations and Matrices
Lecture 11 Matrices and Linear Algebra with MATLAB
Dr Huw Owens Room B44 Sackville Street Building Telephone Number 65891
Chapter 3 Linear Algebra
Math review - scalars, vectors, and matrices
Presentation transcript:

GG313 Lecture 12 Matrix Operations Sept 29, 2005

Matrix Addition Requirement: same order Characteristic: element-by-element addition Notation: A+B=C 1 1 A = B = C=A+B = Eqn 3.20

You can add a scalar to a matrix: 1 1 A = 1 1 B = A + 4 = Commutative: A+B=B+A Associative: A+B+C= A+(B+C) You can also multiply a scalar by a matrix: 2 4 A = 4 6 B = A * 2 =

Dot Product Also known as: scalar product or inner product Requirements: row vector and column vector of the same order (dimensions) Characteristics: Result is a scalar Uses: Big in physics. The dot product between a force and a velocity yields the power being given to a body Notation: a b = d Eqn. 3.25

In physics, we multiply the projection of one vector onto the other vector by the length of the second vector: ab=u a u b +v a v b +w a w b =|a||b|cos(  ) |a|=sqrt(u a 2 +v a 2 +w a 2 )=length of a If a and b are orthogonal to eachother, then cos(  ) =0 and ab=0 If a and b are parallel to eachother, then cos(  ) =1 and ab= |a||b|= product of the lengths of the vectors

Squaring a vector is simply taking the dot product of the vector and its transpose: For a row vector: a 2 = a a T For a column vector: a 2 = a T a Matrix Multiplication We can extend the idea of the dot product to matrices: Requirement: There must be the same number of columns in the first matrix as rows in the second. Characteristics: The resulting matrix has the same number of rows as the first matrix and same number of columns as the second.

Notation: C (m,n) =A (m,p) B (p,n) elements of C are: In Matlab, matrix multiplication is: C = A*B

The order of multiplication is important: On the previous page, we have an order A (5,3) matrix times a B (3,4) matrix. BA is not even possible. If the matrices are square, or if A T has the same order as B, or B T the same order as A, then both products, AB and BA can be formed. The transpose of a matrix product is equal to the product of the transpose of the matrices in reverse order: A B C = C T B T A T NOT Commutative: A B ≠ B A Associative: (A B) C= A (B C)

Multiplication by the identity matrix (Matlab: eye(p,p) ) leaves the original matrix unchanged - just as multiplying any regular number by “1” leaves that number unchanged. A(n,p) I(p,p) = I A = A For example:

Scaling: We can scale a coordinate system by multiplying by a diagonal matrix of scale weights:

On the previous slide we pre-multiplied by the scaling matrix. If we post-multiply instead,then each column gets multiplied by the same scaling factor: Note that we had to use a diagonal order 5x5 matrix.

Efficiency considerations: When dealing with large matrices, it is possible to save a considerable amount of calculating by being careful how multiplies are arranged. While there may be no difference in the result mathematically, if the number of calculations can be significantly reduced, time can be reduced and precision can be improved.

Note that while (AB)C = A(BC), these two expressions can have very different numbers of multiplications. D (m,n) = A (m,p) B (p,n) has m*n*p multiplications E (m,q) = D (m,n) C (n,q) has m*n*q multiplications So E=(AB)C requires m*n(p+q) multiplications Similarly, F (p,q) =B (p,n) C (n,q) has n*p*q multiplications E (m,q) = A (m,p) F (p,q) has m*p*q multiplications So E=A(BC) requires p*q*(m+n) multiplications. If p*q >> m*n, then A(BC) will require far more multiplications than (AB)C.

Fore example, say m=5, n=2, p=25, and q=100. Then one way requires 25*100*(5+2)=17,500 multiplications, and the other requires 5*2*(25+100)=1,250. As execution time and “digital noise”, or round off error, increase with every multiplication, it makes sense to perform the calculation in a particular way. In class exercises. 1) We have three vectors A, B, and C with one end at the origin and the other at x i,y i, z i. A(x,y,z)=(22,7,100), B=(-32,1,48), and C=(3,-11,33). Using Matlab matrices, transform the vectors into another coordinate system where r=3x and s=5y, t=2.5z.

We set up a matrix with the x-values in the first row, y in the second, and z in the third: >> A=[ ; ; ] A = Now set up a diagonal matrix containing the transformations: >> D=[3 0 0;0 5 0; ] D =

Now multiply: >> D*A ans = This is a simple transformation; others, like changing from rectangular to spherical coordinates utilize more terms in the transformation matrix.

DETERMINANT: A property of a matrix very useful in the solution of simultaneous equations. Requirement: Square matrices only Notation: det A, |A|, or ||A|| Calculation: As the matrix size grows, Matlab comes in handy, det(A).

Determinant Characteristics: Switching two rows or columns changes the sign. Scalars can be factored out of rows and columns. Multiplication of a row or column by a scalar multiplies the determinant by that scalar. The determinant of a diagonal matrix equals its trace.

Consider the determinant of a 3x3 matrix. It can be re- written: And the determinant can be written: |A|=a 11 (a 22 a 33 -a 23 a 32 )-a 12 (a 21 a 33 -a 23 a 31 )+a 13 (a 21 a 32 -a 22 a 31 ) A singular matrix is a square matrix with determinant equal to 0. This happens when 1)any row or column is equal to zero or 2)Any row or column is a linear combination of any other rows or columns

The degree of clustering about the principal diagonal is a property of a matrix that affects the determinant. If clustering is high, then the determinant is larger. The rank of a matrix is the number of linearly independent vectors (row or column) that it contains. The rank of a product of two matrices must be less than or equal to the smallest rank of the two matrices being multiplied. Linear independence here means that the two vectors being considered are NOT scalar multiples of each other.

Matrix division (Matrix inverse) In normal math, we can easily solve the equation below for c. y= cx, c = y/x = yx -1. Xx -1 =1 We can generate inverse matrices to do the same operation in matrix algebra. In matrix algebra the inverse matrix is A -1, where AA -1 =I, the identity matrix. The inverse of a matrix exists only if its determinant is non-zero.

The inverse of a matrix is easy to calculate for 2x2 matrices, but anything larger is difficult to even explain. For a 2x2 matrix: Eqn For example, To check:

Using matrices to calculate normal scores - as in Chapter 2. We can use matrix notation to calculate the mean and z- values of vectors. An important concept is the unit vector that consists of ones in a row (unit row vector) or column (unit column vector). Consider the data matrix A consisting of three columns of data samples: We can calculate the mean of each column in A simply by multiplying A by J 3 T and dividing by 3:

In our example: We now have the mean values, but we want the normal scores (z-values),

We do the subtraction in the numerator by: D= - (1/n) JA where J is the nxm unit matrix (all entries=1). The standard deviation is not linear, and needs to be calculated separately, then entered into a diagonal matrix: The normal scores are then: