Академический Документы
Профессиональный Документы
Культура Документы
More on Matrices
Now 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 inverse
A is the inverse of B (and vice versa) iff AB = BA = I
Example: 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 = I
Then 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=[213;211;451]
>>B=inv(A)
>>C=A*B
>>D=B*A
Inverses and solution to a linear system of equations
The 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)*b
and check by doing
>>c=A*x
Inverse of product of matrices
If A, B are invertible, so is AB, and inv(AB) = inv(B)*inv(A)
4a. 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)]
where
var(x) = (1/(n-1)) Sum(xi-xbar)2
var(y) = (1/(n-1)) Sum(yi-ybar)2
cov(x,y) = (1/(n-1)) Sum(xi-xbar)(yi-ybar).
var ( x ) cov (x , y)
Cov( x , y)=
cov ( y , x ) var ( y )
where
n
var ( x )=
1
( x x )2
n1 i=1 i
n
1
2
var ( y )=
y i y )
(
n1 i=1
n
1
cov ( x , y )=cov ( y , x )=
( x x ) ( y i y )
n1 i =1 i
The 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 bodys 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 X
1
T
Cov ( X ) =
X X
n1
Since 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. Mechanics
The 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 Calibration
A 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:
VFx
a11 a12 a13 a14 a15 a16 Fx
a
F
VFy
21 a22 a23 a24 a25 a26 y
V
a
a32 a33 a34 a35 a36 Fx
Fz 31
a
a
a
a
a
a
M
VMx
41
42
43
44
45
46
x
V
a51 a52 a53 a54 a55 a56 M
y
My
A-1 V = (A-1 A) F
(pre-multiply by inverse of A on both sides)
-1
A V=IF
(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.4515
0.0127
-0.0018
-0.0136
0.0383
-0.0121
-0.0111
3.4263
-0.0182
-0.0845
0.0136
0.0274
0.0014
-0.0047
0.8745
-0.0074
0.0024
-0.0284
0.0005
0.0195
-0.0038
6.6244
0.0071
-0.0016
0.0107
0.0005
0.0021
0.0211
6.6753
-0.0086
0.0049
0.0032
0.0021
-0.0062
0.0141
13.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
www.udel.edu/PT/Research/MAL/Workstation_Reference.pdf.)
4e. Change of Coordinate System
Often 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:
cos 11 cos 12 cos 13
R= cos 21 cos 22 cos 23
cos 31 cos 32 cos 33
()
x
1
x = y1
1
z
system 2 coordinates is
2
()
x
2
x = y2
z2
x =R x +r
Consider, for example, the figure below, which was modified from a force plate manual
(retrieved 2011-01-18 from http://bertec.com/uploads/pdfs/manuals/Force%20Plate
%20Manual.pdf). 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
xf
force plate coordinates, COPf = y f , we will want to convert it to lab coordinates. In this
zf
case, the vector r, which describes the origin of the force plate system in the lab system
20
coordinates, is r= 30
. The angles ij.between unit vector i in system 1 and unit vector
0.25
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 is
1 0 0
R= 0 1 0
0 0 1
The center of pressure location in lab coordinates is
COP L=R COP f +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 is
f 2=R f 1
where 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