601 likes | 1.48k Views
Vectors and Matrices. Class 17.1 E: Ch. 5. Objectives. Know what a Cartesian coordinate system is. Know the difference between a scalar and a vector. Review/learn how to interpret, add, subtract, and find the magnitude of vectors Know how to use the right hand rule. Objectives.
E N D
Vectors and Matrices Class 17.1 E: Ch. 5
Objectives • Know what a Cartesian coordinate system is. • Know the difference between a scalar and a vector. • Review/learn how to interpret, add, subtract, and find the magnitude of vectors • Know how to use the right hand rule.
Objectives • Be able to calculate the determinant of a matrix. • Be able to calculate the dot and cross products of vectors • Be able to represent a system of linear equations as matrices and vectors. • Be able to solve systems of linear equations using matrices.
z y x Cartesian Coordinates • The Cartesian coordinate system is a system of orthogonal axes which is the basis for describing body and force systems in mechanics. • The coordinate system is always right handed (obeys the right hand rule. • We will focus on 2D systems.
Scalars and Vectors • A scalar is a physical quantity having magnitude but not direction • Length, mass, time • A vector is a physical quantity having both magnitude and direction • Force, velocity, acceleration
z b a c y x Vectors • Vectors have components along axes of the Cartesian system • x, y, and z axes are denoted by unit vectors • carat often used to imply unit vector • Unit vectors have a magnitude (length) of one.
4 3 2 1 q 0 0 -1 -1 1 2 3 4 5 -2 Vectors • Consider the 2D vector • magnitude (length) • angle w/ horizontal
Dot Product • Dot product is a vector operation. • Dot product of matrices does not exist. • The result is a scalar. • Using tools: • TI-83,86: dot • TI-89: dotp • Maple: dotprod • Matlab: dot
Dot Product: • Consider the 2D case: • Plot these vectors.
4 3 2 1 q 0 0 -1 -1 1 2 3 4 5 -2 Vector Addition & Subtraction • When adding, treat each direction separately • To add, place vectors head to tail • The negative of a vector is simply pointing in the opposite direction • The sum of vectors is called the resultant.
Matrix and Vector • A matrix is an n x m array of numbers • n rows, m columns • The ij-th element, aij, is the element in row i and column j • A vector is a matrix that has only one row or only one column
Basic Functions • The transpose is obtained by swapping columns and rows • In Matlab: apostrophe • The addition operation requires dimensional agreement. • i.e. to add a m x n matrix and a q x r matrix, must have m = q and n = r • Matrix addition is done by corresponding element
Matrix Multiplication • Matrix multiplication requires inner-dimensional agreement • i.e. to multiply a m x n matrix and a q x r matrix, must have n = q • Matrix multiplication is done by summing elementwise multiplication of row i in the first matrix with column j of the second matrix to get the ij-th element of the product.
Determinant • The determinant operation applies to a square matrix (# rows = # columns) • Denoted with bars • 2x2 case:
alternate sign Determinant • For the 3x3 case:
Determinant • For higher order cases uses tools. • TI-86,89: det • Maple: > with(linalg); > det([[1,5,7],[2,4,8],[3,6,9]]); • Matlab: det
Cross Product • The cross product is a vector operation • yields a vector according to the right-hand-rule • Also have:
Cross Product • Example: • Using your tools. • TI-89: crossp([1,5,7],[2,4,8]) • Maple: > with(linalg); > crossprod([[1,5,7],[2,4,8]); • Matlab: cross([1 5 7],[2 4 8])
A-1 = Inverse • A matrix times its inverse equals the identity matrix • Identity: All elements on the main diagonal are 1, all others are 0; matrix version of the scalar 1. • Matrix division is undefined • Using TI-89: ([[1,5,7][2,4,8][3,6,9]])^-1 • Matlab: inv([1,5,7; 2,4,8; 3,6,9]); • Using Maple: inverse([[1,5,7],[2,4,8],[3,6,9]]);
Linear Equations • A linear equation is of the form: where the ai’s are constants (coefficients) • In order to solve for n unknowns (xn), n independent equations are needed.
2 Equations, 2 Unknowns • Consider the system of equations: • 3 things can happen: • Exactly one solution (lines intersect) independent • No solution (lines are parallel) • Infinite number of solutions (same line)
x = Solving Systems of Equations • Consider a system of 3 eqns, 3 unknowns: • This can be written as: • Using inverses can only be used if there is a single, unique solution; If multiple or no solutions exist, the inverse does not exist
Solving Systems of Equations • Using your tools: • Using Maple: multiply(inverse([[2,4,4],[1,2,1],[3,4,-2]]),[[12],[4],[1]]); • Using TI-89 (([[1,5,7],[2,4,8],[3,6,9]])^-1)*([12;4;1]) Or use ‘solve’ • Using Matlab: inv ([2,4,4; 1,2,1; 3,4,-2])*[12; 4; 1]);
Homework • WebAssign • Your documentation of your homework is 20% of your webassign assignment grade. Homework documentation is due at the beginning of class when the webassign homework is due. If webassign is not due at the beginning of a class, your documentation is due at the beginning of the immediate next class or lab. • If you need a refresher on problem presentation, read Ch. 2 in Eide