Matrices 2



KAAP686 Mathematics and Signal Processing for BiomechanicsMore on MatricesNow we discuss the topic of “matrix division” and apply this idea to solve a system of linear equations.We will define the inverse* of a matrix, for example B-1=inverse of B. Then, instead of dividing one matrix by another (C=A/B), w we will multiply by the inverse (C=B-1A).*It is really the multiplicative inverse of a matrix. A matrix also has an additive inverse, which is its negative. However, it is customary to say “inverse” instead of “multiplicative inverse”. Only a mathematician would talk about the additive inverse of a matrix.1. Matrix inverseA is the inverse of B (and vice versa) iff AB = BA = IExample: A=[1 2; 3 5]?? B=[-5 2; 3 -1].Show AB = I and BA = I.Not all matrices have inverses: for example the zero matrix, and the matrix [1 0; 0 0]. Matrix with no inverse is “noninvertible” or “singular”.Symbol for inverse: A-1 . If A has an inverse, it has only 1 inverse.Set up eqn for inverse of a 2x2 matrix, then show that it ends up being 4 eqns in 4 unknowns.A=[a b; c d];?? A-1=[e f; g h];? A A-1 = IThen show that for 2x2 matrix,A-1 = (1/detA)*[d -b; -c a] is true, because this solution to the inverse makes A A-1 = I.Use Matlab to do example:>> A=[2 1 3;2 1 1;4 5 1]>> B=inv(A)>> C=A*B>> D=B*A? Inverses and solution to a linear system of equationsThe solution to the system Ax = b, where A is a matrix and x, b are vectors, is x = A-1 b.Example: Same equations as above, but now define >>b=[6;? -12;? 3]>> x=inv(A)*band check by doing>> c=A*xInverse of product of matricesIf A, B are invertible, so is AB, and inv(AB) = inv(B)*inv(A)2. Special Matrices & Additional PropertiesDiagonal matrix: square matrix with off-diagonal elements = 0.Transpose of a matrix: denoted AT or A’.? Interchange the rows and columns.? Transpose of n-by-m matrix is m-by-n.Properties of transposes:(AT) T = A(AB)T = BT A T(AT) -1 = (A-1) TSymmetric matrices: A is symmetric if A = AT 3. Matrices as maps[In notes below, when I refer to vector (1 0) or (a c), etc., I mean the corresponding column vectors, but I write them (1 0) because it’s easier to write.]2x2 matrix = linear transformation = mapping from x-y plane into another x-y plane (call it x’-y’ if you wish).The linear 2x2 mapping sends straight lines into straight lines, parallel lines into parallel lines, but generally does not preserve angles between lines, which means lines at right angles in the starting plane may not be mapped into lines at right angles in the new plane.Consider and show how vectors (1,0) and (0,1) get mapped to vectors (a,c) and (b,d) by the transformation A whose matrix is A=[a b; c d].Unit square mapped into parallelogram; its area =side x side x sin? which is computed by taking cross product of the 2 vectors (as if they were 3D vectors with z coordinates = 0). The cross product of (a,c,0) and (b,d,0) is found by taking determinant of 3x3 matrix with rows (i, j, k); (a, c, 0); (b, d, 0). This gives vector 0i+0j+ (ad-bc)k , whose length is (ad-bc). This length is the area of the parallelogram. So the original unit square gets mapped into a parallelogram with area = ad-bc = det(A). det(A) is the “area magnification factor” for the transformation A.If det(A) < 0, then the unit square in the original x-y plane gets “flipped” by the transformation, and the direction of the cross product of (a c) with (b d) is opposite to the direction of the cross product of (1 0) with (0 1).If det(A) = 0 then the whole x-y plane gets mapped into a line (so the area of the original unit square becomes 0 after transformation).Inverse of the A matrix (A-1) is a matrix that undoes what A does.? Therefore A-1 acting on (a c) maps it to (1,0), and A-1? maps (b d) to (0 1).If det(A)=0, which means whole plane gets mapped into a line, then many points are being mapped into same point, and there’s no way to go backwards because a given point on the line in the new plane could have come from an infinite number of points in the starting plane, and there’s no way to tell which one to “go back to”.? This explains, in terms of mapping, why a matrix with det(A)=0 does not have an inverse: because there’s no way to “undo” the mapping corresponding to A.?4. Uses of matrices in biomechanics4a. Rotations.? Rotations are covered in a separate set of notes.?4b. Statistics.? The covariance matrix arises when analyzing multidimensional data. An example of multi- (two-)dimensional data is the center of pressure (x- and y-coordinates) measured as a function of time. Another example of multidimensional data is the EMG activity from several muscles measured at the same time, such as leg muscles during walking. The covariance matrix measures how much the variables vary in synchrony with one another. Analysis of the covariance matrix can sometimes give deeper insight into the data. For example, the covariance matrix is used in principle component analysis (which we will not discuss here). If there are 2 variables, the covariance matrix is 2x2; if there are 6 variables, the covariance matrix is 6x6. The covariance matrix for two-dimensional data is measured at n time points [var(x) cov(x,y)] Cov(x,y)= | | [cov(x,y) var(y)]wherevar(x) = (1/(n-1)) Sum(xi-xbar)2var(y) = (1/(n-1)) Sum(yi-ybar)2cov(x,y) = (1/(n-1)) Sum(xi-xbar)(yi-ybar).Cov(x,y)=var(x)cov(x,y)cov(y,x)var(y)wherevarx=1n-1i=1nxi-x2vary=1n-1i=1nyi-y2covx,y=cov(y,x)=1n-1i=1nxi-xyi-yThe diagonal elements of the covariance matrix are just the usual variances of x(t) and of y(t). The covariance matrix is symmetric. If x(t) and y(t) are the coordinates of the body’s center of mass during standing, then the covariance matrix can be useful for understanding normal and abnormal balance. If there are m variables and n measurement times, arrange the data in an array X with m columns and n rows. Then the covariance matrix can be computed by array multiplication:Cov(X) = (1/(n-1)) XT XCovX=1n-1XTXSince we have multiplied (m × n) × (n × m), the result is (m × m). (Remember that when the dimensions of multiplied arrays are written this way, the “inner” dimensions, n and n in this case, must match each other, and the resulting matrix has dimensions given by the outer dimensions.) ?4c. MechanicsThe deformation of an object, or of a little cube of material within that object, in response to applied forces, can be represented by a 3x3 matrix (i.e. a 2-dimensional array) called the strain tensor. It turns out that this matrix is symmetric. Forces on an object can be represented by another symmetric 3x3 matrix called the stress tensor. For many materials, including biological materials, the relation between stress (applied force) and strain (deformation) is linear, as long as the applied force is not too great.? In this linear range, stress and strain are related to one another by a 4-dimensional array, the 3x3x3x3 elasticity tensor, which represents the properties of the material.? For convenience, the strain and stress tensors (which have 6 independent elements each, since they are symmetric 3x3 matrices) are sometimes represented as 6-element vectors. This allows the elasticity tensor to be represented as a 6x6 matrix. Take a course in solid mechanics to understand these ideas more fully.4d. Force Plate CalibrationA force plate is a “black box” with six inputs (3 forces, 3 moments) and six outputs. On some force plates, including all older models, the outputs are voltages. (Newer models may have digital outputs which are numbers with units of N or N-m.) The user measures the outputs and wants to know the inputs. The ideal force plate has one output uniquely associated with each input, and a linear input/output relation for each such channel. In other words, the ideal force plate is linear and has no crosstalk. Actual force plates are not ideal. Manufacturers work hard to eliminate nonlinearity. Nonetheless, nonlinearities are sometimes noticeable, especially if a force plate has been damaged, is mounted incorrectly, or has debris in the mounting chamber. Crosstalk describes the situation where the output signal for one input also contains components from other inputs. For example, the output signal for Fx might be slightly “corrupted” by contributions from the other inputs. If the system is linear, each output signal is a (different) linear combination of all the inputs:Channel 1 (volts) = VFx = a11Fx + a12Fy + a13Fz + a14Mx + a15My + a16Mz ,Channel 2 (volts) = VFy = a21Fx + a22Fy + a23Fz + a24Mx + a25My + a26Mz ,and so on. We can write this with vectors and a matrix:which we write compactly as V=A F .An ideal forceplate with no crosstalk will have values of zero for all off-diagonal matrix elements. The user can find the individual forces and moments, even if there is crosstalk, if the elements of A are known.V = A F(from above)A-1 V = (A-1 A) F(pre-multiply by inverse of A on both sides)A-1 V = I F(I=identity matrix)F = A-1 V(desired solution: the vector of forces and moments)In other words, to get the individual forces and moments, multiply the inverse of A by the voltage vector. Newer force plates do this matrix multiplication internally, and provide voltage outputs that are “pure” (free of crosstalk) and require only scalar multiplication to get the forces and moments. On older models, the user must do the matrix multiplication, using values for the elements of A or A-1 provided by the manufacturer.Example from AMTI forceplate, model OR6-5-2000, s/n 3233, assuming 10 V excitation.A= (Values are μV/N in columns 1-3 and μV/(N-m) in columns 4-6.)3.45150.0127-0.0018-0.01360.0383-0.0121-0.01113.4263-0.0182-0.08450.01360.02740.0014-0.00470.8745-0.00740.0024-0.02840.00050.0195-0.00386.62440.0071-0.00160.01070.00050.00210.02116.6753-0.00860.00490.00320.0021-0.00620.014113.4099 See Appendix A of Vicon_workstation_reference.pdf in reserve section of course web site. (File also available (as of 2007-03-08) at udel.edu/PT/Research/MAL/Workstation_Reference.pdf.)4e. Change of Coordinate SystemOften we have data in one coordinate system and we need to convert it to another coordinate system. For example, we might obtain the location of the center of pressure in “force place coordinates” (a coordinate system local to the force plate, set by the manufacturer) and we need to convert it to laboratory coordinates. The diagram shows the two coordinate systems. Vector r denote the origin of system 1 in the coordinates of system 2. The unit vectors of coordinate system 1 are u11, u21, and u31. The unit vectors of coordinate system 2 are u12, u22, and u32. The angle between unit vectors ui1 (in system 1) and uj2 (in system 2) is θij. We use these angles to create the “direction cosines matrix” R as follows:R=cosθ11cosθ12cosθ13cosθ21cosθ22cosθ23cosθ31cosθ32cosθ33A location in system 1 coordinates is denoted x1=x1y1z1. The same location expressed in system 2 coordinates is x2=x2y2z2. The two are related by a rotation and a translation:x2=R x1+rConsider, for example, the figure below, which was modified from a force plate manual (retrieved 2011-01-18 from ). It shows the force plate coordinate system (subscript f), and the lab coordinate system (subscript L), which is offset and rotated. If we know the center of pressure location in force plate coordinates, COPf=xfyfzf, we will want to convert it to lab coordinates. In this case, the vector r, which describes the origin of the force plate system in the lab system coordinates, is r=2030-0.25. The angles θij.between unit vector i in system 1 and unit vector j in system 2 are θ11 (between xf and xL)=180°, θ12 (between xf and yL)= 90°, θ13= 90°, θ21= 90°, θ22 (between yf and yL)= 0°, θ23= 90°, θ31= 90°, θ32= 90°, θ33= 180°. Therefore the direction cosines matrix R isR=-10001000-1The center of pressure location in lab coordinates isCOPL=R COPf+r Note that the equation above for transforming locations is NOT correct for transforming forces or torques from one coordinate system to another. This is because force vectors and torque vectors are not “anchored” to one spot, and so are not affected by translations of the coordinate system. They are affected by rotations of the coordinate system, however. The equation for transforming a force vector from system1 to system 2 coordinates isf2=R f1where f1 and f2 are the force vector expressed in the two coordinate systems, and R is the matrix of direction cosines given above. The same equation can be used to transform torque vectors.Copyright ? 2013 William C. Rose ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download