Lecture 2
Vector Algebra
Vector represents a quantity with magnitude and direction. Many scientific quantities are vector quantities, such as force, pressure, flux, momentum, electric field, magnetic field, displacement, velocity, and acceleration.
Vector, however, does not represent the quantity’s location. Whenever a vector is mentioned, it is normally accompanied by additional information suggesting location;
for example, the pressure at the bottom of the water tank, the neutron flux five meters away from the reactor, or the beam velocity at the exit window.
Graphically, vector is represented by an arrow line whose magnitude is indicated by the line’s length, and whose direction is indicated by the pointing arrow as shown below.
Mathematically, vector is represented by two or more components. (A single
component can only tell magnitude, but cannot tell direction. Quantity represented by a single component is commonly called scalar. In other words, each component of a vector is a scalar quantity.) For instance,
( )
2,4 , 3,2 , 3,5,2( )
, x,y,z,(
k,l,m,n)
are all vectors. Notice the uses of
( )
... and ... to group the components together.Although both constructions are correct and widely used in various places, we will strictly use ... to represent vectors in this class to avoid confusion since
( )
... are more commonly used for representing coordinates. Keep in mind that uses of other constructions such as[ ]
... or{ }
... are also possible.When writing a vector quantity, some kind of text formatting or special character is often used to differentiate the vector quantity from scalar quantity, e.g. a, a ! , !
a , or a. Dimension of a vector is equal to the number of components used to represent the vector; for instance, 3,2 , x,y,z , k,l,m,n are respectively two-, three-, and four- dimensional vectors. The vector’s dimension also associates with the number of dimensions or coordinates required to represent the vector. For instance, three- dimensional vector is represented in three-dimensional coordinates.
In general, we can assume that both two- and three-dimensional vectors are in
Cartesian space. For two-dimensional vector, the first and the second components are the vector’s projections on the x- and the y-axes respectively. For three-dimensional vector, the first, the second, and the third components are the vector’s projections on
the x-, the y-, and the z-axes respectively. Note that Cartesian space does not necessary have to represent physical (displacement) space (x, y, z), they can also represent non-physical spaces such as velocity space (Vx, Vy, Vz) or acceleration space (Ax, Ay, Az).
Given two points, A and B, in the same three-dimensional space, a position vector can be constructed from one point to the other. Let the coordinates of points A and B be
a1,a2,a3
( )
and(
b1,b2,b3)
respectively. The position vector from point A to point B is thenAB! "!!
= b1!a1,b2 !a2,b3!a3 ,
where its magnitude is represented and calculated by
! "AB!!
=
(
b1!a1)
2 +(
b2 !a2)
2+(
b3!a3)
22 .Note that magnitude of a vector is a scalar quantity.. In general, magnitude of a vector can be calculated by
X = xi2
i
!
,where xi is the ith component of X. Nevertheless, such method of magnitude calculation does not always work for higher-dimensional vector, i.e. vector with dimension higher than three, because higher-dimensional vector’s components may not represent coordinates that are orthogonal to each other, hence it would require different method to add them.
Two vectors of the same dimension can be added, i.e.
X+Y = x1+y1,x2+y2,...,xn+yn .
Addition can be graphically represented by connecting one vector’s head (e.g. Y) to the other vector’s tail (e.g. X). The resulting vector can then be drawn connecting the tail of the former vector (i.e. Y) to the head of the later vector (e.g. X) as shown.
There is no vector multiplication, although one can still multiply vector with a scalar, i.e.
c X =X+X+...c times= cx1,cx2,...,cxn ,
where c is a scalar. In doing so, the magnitude of the resulting vector is c times that of the original vector, i.e.
c X =c X .
The resulting vector is also parallel with the original vector. If c is positive, then the resulting vector points to the same direction as the original vector. If c is negative, then the resulting vector points to the opposite direction from the original vector.
Properties of Vectors
Let A, B, and C be vector quantities with the same dimensions, and c and d be scalar quantities. Then, the followings are some important properties of vectors:
1. A+B=B+A;
2. A+
( )
B+C =( )
A+B +C=(
A+C)
+B;3. c A
( )
+B =c A+cB; 4.(
c+d)
A=c A+d A;5. c A=Ac; 6.
( )
cd A=c d A( )
.Unit Vectors and Standard Basis Vectors
Unit vector is a vector whose magnitude equals to one. To construct a unit vector from any general vector, one shall divide the general vector (i.e. each component of the vector) by its scalar magnitude, i.e.
Unit vector of A!"
= A!"
A!" = a1
A!" ,a2
A!" , ... , where A= a1,a2, ....
Unit vectors are usually written with a hat ( ^ ) on top to differentiate them from general vectors. For instance, Aˆ is the unit vector of A!"
. Unit vectors point to the same direction as the vectors from which they have been derived. The usefulness of unit vectors can often be found when writing vectors in coordinate systems. For instance, let unit vectors iˆ, ˆj, and kˆ represent respectively x-, y-, and z-coordinates in the three-dimensional Cartesian space. Then, for a three-dimensional vector
A!"
= a1,a2,a3 , one can write A!"
=a1iˆ+a2ˆj+a3kˆ
iˆ, ˆj, and kˆ are called standard basis vectors.
Given two-dimensional vectors !"A , !"B
, and C!"
where A!"
and B!"
are orthogonal to each other, one can write C!"
in the new coordinate system consisting of unit vector of A!"
and B!"
. For example, let A!"
= 3, 4 , !"B
= !4, 3 , and C!"
= 1, 2 , then
!"A
= 32 +42 =5 Aˆ = 3, 4
5 = 0.6, 0.8
and
!"B
=
( )
!4 2+32 =5 Bˆ = !4, 35 = !0.8, 0.6 C!"
=2.2 ˆA+0.4 ˆB.
Coordinate transformation is useful when we need to deal with dynamic problem. For example, when we want to investigate movement of an object in a moving frame of reference.
Dot Product
Although there is no vector multiplication, there are several vector operations that utilize multiplication between vectors’ components. One of them is called dot product. Let A!"
and B!"
be vectors with the same dimension, where !"A
= a1,a2, ...
and B!"
= b1,b2, ... . Then, the dot product between A!"
and !"B
is defined as A!"
iB!"
=a1b1+a2b2+....
The symbol i indicates dot operation. The result of dot operation is a scalar quantity.
A!"
and !"B
do not necessary have to be in the same space. For instance, !"A
can be in electric field space, while !"B
is in magnetic field space. The spaces, however, must coincide with each other. That is, each of their coordinates must overlap. In addition, units of all components in A!"
and !"B
must be consistent, i.e. a1,a2, ... all have the same unit, and b1,b2, ... all have the same unit.
Some properties of dot product include:
1. !"A i!"B
=B!"
iA!"
; 2. !"A
i !"B +C!"
( )
=( )
A!"iB!" +( )
!"AiC!" ;3. cA!"
( )
i!"B=c A( )
!"i!"B =!"Ai( )
cB!" , where c is a scalar quantity;4. !"A i!"A
= !"A2
, if A!"
is defined.
Dot product can also be defined in term of the angle between two vectors:
A!"
iB!"
= A!"
!"B
cos!AB " !AB=cos#1 A!"
iB!"
A!"
!"B
$
%&& ' ()) where θ is defined as shown below.
From the equation, notice that if ! ="/ 2, then A!"
iB!"
=0. We can then conclude that
“two vectors are perpendicular to each other if and only if their dot product is zero.”
Furthermore, since cos! is also less than one, then A!"
iB!"
! !"A B!"
. Notice also that
!"B
cos!AB = !"A
iB!"
!"A "compAB!"
and A!"
cos!AB= A!"
iB!"
B!" "compB!"A
.
These quantities are respectively component of B!"
along A!"
(compAB!"
) and component of A!"
along B!"
(compBA!"
).
Both compA!"B
and compBA!"
are scalar quantities, but can be converted to vectors by multiplying them with unit vectors of the vectors on which they are projected. The results are called projections (of !"B
on !"A
, or of !"A on B!"
), i.e.
projAB!"
= A!"
iB!"
A!" Aˆ and projBA!"
= A!"
iB!"
B!" Bˆ. Graphically, projections are as shown below.
Recall the coordinate transformation example above where !"A
= 3, 4 , B!"
= !4, 3 ,
and C!"
= 1, 2 . We can see that
- A!"
iB!"
=(3)(!4)+(4)(3)=0, thus A!"
!B!"
;
- A!"
iC!"
=(3)(1)+(4)(2)=11;
- B!"
iC!"
=(!4)(1)+(3)(2)=2;
- !"A
= 32 +42 =5;
- !"B
=
( )
!4 2+32 =5;- C!"
= 12+22 = 5;
- !AC =cos"1 !"A
iC!"
A!"
C!"
#
$%% &
'(( =cos"1 11
5 5
#
$% &
'( =0.18;
- !BC =cos"1 B!"
iC!"
B!"
C!"
#
$%% &
'(( =cos"1 2
5 5
#$% &
'( =1.39;
- projAC!"
= A!"
iC!"
A!" Aˆ=11
5
Aˆ =2.2 ˆA;
- projBC!"
= B!"
iC!"
B!" Bˆ= 2
5
Bˆ =0.4 ˆB;
- C!"
= projAC!"
+ projBC!"
=2.2 ˆA+0.4 ˆB. Examples of dot product applications are:
1. Work done by force, W!"!
=F!"
id"
, where W!"!
, F!"
, and d!
are respectively work, force, and displacement.
Since, W!"!
=0 if F!"
!d"
, the equation suggests that force in the direction perpendicular the displacement cannot do work.
2. Similarly, electric field E!"
does work when its dot product with electrical current J!"
is non-zero. This is called ohmic heating, and is how electrical energy turns into heat.
3. Alternative way to characterize a surface is to use normal vector n! . At any point on the surface, n!
is a vector that is perpendicular to the surface.
Suppose we have a plane, and points P(x, y, z) and P0(x0, y0, z0) are on the plane. R!"
= x,y,z and R!"
0 = x0,y0,z0 are vectors that point from the origin to points P and P0 respectively. Then, R!"
!R!"
0 is a vector which line along the plane. Consequently, one can find n!
by solving equation:
n! i R"!
!R"!
(
0)
=0.If the plane’s equation is given as ax+by+cz=d, then we can write it as a,b,c i x,y,z =d.
Notice that we can always specify R!"
0 so that n! iR"!
0 =d. Consequently, n!
= a,b,c . Cross Product
Another vector operation is called cross product. The conditions of vectors
undergoing cross operation are similar to those for vectors undergoing dot operation.
However, there are some differences:
- the result of cross operation is still a vector quantity; and - cross product is only defined for three-dimensional vector.
Let !"A
= a1,a2,a3 and B!"
= b1,b2,b3 , cross product is defined as A!"
!!"B
=
(
a2b3"a3b2)
,(
a3b1"a1b3)
,(
a1b2 "a2b1)
=
(
a2b3"a3b2)
iˆ+(
a3b1"a1b3)
ˆj+(
a1b2 "a2b1)
kˆwhere ˆi, ˆj, and kˆ are standard basis vectors of the space in which A!"
and B!"
reside.
Angle between two vectors can also be calculated using cross product:
!"A
!B!"
= A!"
!"B
sin" ,
where 0!" !#. Because of this angle limitation, however, it is more practical to use dot product instead.
From the equation, if ! =0, we can see that the cross product would be zero. Then we can conclude that
“two vectors are parallel to each others if and only if their cross product is zero.”
Some other important characteristics of cross product include:
1. the resulting cross product is perpendicular to the two vectors involved;
and
2. right-hand-rule can be used to find the direction of the resulting cross product.
Some properties of cross product include:
1. !"A
!B!"
="!"B
!!"A
;
2. cA!"
( )
!B!"=c A(
!"!!"B)
=!"A!( )
cB!" ;3. !"A
! B!"
+C!"
( )
=(
!"A!!"B)
+(
!"A!C!")
4. A!"
+B!"
( )
!C!"=(
!"A!C!")
+(
B!"!C!")
;5. !"A i !"B
!C!"
( )
=(
A!"!B!")
iC!";6. !"A
! B!"
!C!"
( )
=( )
!"AiC!" B!""( )
A!"i!"B C!".Examples of cross product applications are:
1. Angular momentum !"L
of a particle is defined as L!"
=r"
!!"p where r!
is the positional vector, and !"p
is the linear momentum (!"p
=mv"
).
2. Velocity of a charge particle in static electric and magnetic fields which are perpendicular to each other is given as
v!
= E"!
!"!B B"!2
Matrices
Matrix is an array of numbers with certain numbers of rows and columns:
[ ]
A = a11 a12 a13 a21 a22 a23!
"
##
$
%
&
&
Bracket […] is sometimes used to indicate that certain quantity is a matrix quantity.
Elements inside the matrix are scalar quantities. Indexing of the matrix elements is done using row and column in order, e.g. a12 is element in row 1 and column 2.
Matrix [A] above is called size two-by-three or 2×3 matrix.
Matrix in which all of its elements are zero is called zero matrix and is represented by [0].
Matrix in which its numbers of rows and columns are the same is called square matrix.
Identity matrix is square matrix in which all of its elements are zero except for the diagonal elements, i.e. an element is a diagonal element if its indices i = j. Identity matrix is usually denoted by [I]
Upper triangular matrix is a square matrix in which all the elements below the diagonal elements are zero.
Lower triangular matrix is a square matrix in which all the elements above the diagonal elements are zero.
Matrix Operations
Transposision is one of matrix operation where the matrix’s rows and columns are interchanged. That is, aij becomes aji. Symbolically, superscript T is used to indicate transposition operation, i.e. transposition of [A] is [A]T.
If [A] is a square matrix, then
- if [A]T = [A], then [A] is called symmetric matrix; and - if [A]T = -[A], then [A] is called skew-symmetric matrix.
Addition of matrix is only possible between two matrices with the same size. If [A]
and [B] have the same size, and aij’s are elements of [A] and bij’s are elements of [B], then
[ ]
A +[ ]
B =a11+b11 ! a1j +b1j
" # "
ai1+bi1 ! ajj +bjj
!
"
##
#
$
%
&
&
&.
Scalar multiplication of matrix is done by multiplying each element in the matrix by the scalar, i.e. if c is a scalar, then
c A
[ ]
= ca"11 !# ca"1j cai1 ! cajj!
"
##
#
$
%
&
&
&
Multiplication between two matrices is only possible when the number of columns of one matrix is the same as the number of rows of the other matrix. The order of multiplication is important, that is, if [A] is 2×3 matrix and [B] is 3×4 matrix. [A][B]
is possible, but [B][A] is invalid. If [C] is the resulting matrix of [A][B] and cij’s are its elements, then
cij = aikbkj
k=1
!
n =ai1b1j +ai2b2j+...+ainbnj,where n is the number of columns of [A] (= the number of rows of [B]). The size of the resulting matrix [C] is u×v where u is the number of rows of [A] and v is the number of columns of [B].
It should be easily understandable from the condition for matrix multiplication that [A][B] ≠ [B][A]
Note that
[A][B] = [0] does not necessarily mean that [A] or [B] is zero.
Also,
[A][B] = [A][C] does not necessarily mean that [B] = [C].
Some properties of matrix multiplication include:
1.
(
k A[ ] ) [ ]
B =k A( [ ] [ ]
B)
=[ ]
A(
k B[ ] )
=k A[ ] [ ]
B ;2.
[ ]
A( [ ]
B[ ]
C)
=( [ ]
A[ ]
B) [ ]
C =[ ]
A[ ]
B[ ]
C ;3.
( [ ]
A +[ ]
B) [ ]
C =[ ]
A[ ]
C +[ ]
B[ ]
C ;4.
[ ]
C( [ ]
A +[ ]
B)
=[ ]
C[ ]
A +[ ]
C[ ]
B ;5.
( [ ]
A[ ]
B)
T =[ ]
B T[ ]
A TGauss Elimination
Matrix can be use to help solving system of equations. The method is known as Gauss Elimination. Suppose we have the following of system of equations:
x1!x2 +x3 =0
!x1+x2 !x3=0 10x2+25x3 =90 20x1+10x2 =80
There are 3 unknowns and 4 equations. So there is one too many functions. We can combine the last 2 equations by subtracting the forth equation from the third equation.
This gives
!20x1+25x3=10
Combine with the first two equations, we can write them in the form of matrix equation:
1 !1 1
!1 1 !1
!20 0 25
"
#
$$
$
%
&
'' '
x1 x2 x3
"
#
$$
$
%
&
''
'= 0
0 10
"
#
$$
$
%
&
'' '
To use Gauss elimination, it is more compact to write the equation as
1 !1 1 0
!1 1 !1 0
!20 0 25 10
"
#
$$
$
%
&
'' '
It is important to make sure that the first element of the top row is non-zero. The goal is then to use the following operations:
Step 1: Starting with row X for X = 1
Step 2: Multiplying row X by a scalar number, and subtract it from row (X + 1). The scalar number is selected so that after the subtraction, element X in row (X + 1) would be zero. Repeat the same operation for all the rows after so that all the elements X in those rows become zero.
Step 3: Move to row X for X = X + 1. If it is the last row, proceed to Step 5.
Step 4: If element X in row X is zero, then switch the row with any row below whose element X is non-zero. The later row will become row X instead. Then, repeat Step 2 again.
Step 5: At this point, the left of the dash line should be upper triangular matrix. Convert the matrix back to equation form.
Step 6: Starting with the last equation, the variable in this equation should now be solvable. Use the solution in the row above to solve for more variable. Continue until the last variable which only appears in the top equation is solved.
Determinant
Another important matrix operation is called determinant. It is only defined for square matrix.
For 2×2 matrix, determinant of [A] is calculated by
detA= a11 a12
a21 a22 =a11a22 !a12a21.
Note that |…| is used to indicate determinant operation. Note also that determinant is a scalar quantity.
For n×n matrix, determinant is defined as
detA=aj1Cj1+aj2Cj2 +...+ajnCjn =a1jC1j +a2jC2j+...+anjCnj
for j = 1, 2, …, n, and the cofactor Cij is defined as Cij =
( )
!1 i+jMij,where Mij is determinant of matrix [A] without row i and column j. Thus, for 3×3 matrix,
detA=
a11 a12 a13 a21 a22 a23 a31 a32 a33
=(!1)1+1a11 a22 a23
a32 a33 +(!1)1+2a12 a21 a23
a31 a33 +(!1)1+3a13 a21 a22 a31 a32
Some properties of determinant include:
1. Multiplying any row by scalar number = multiplying determinant by the same scalar.
2. Interchanging 2 rows = multiplying determinant by -1.
3. Adding or subtracting scalar multiple of one row to or from other row does not change determinant.
4. Determinant of upper triangular matrix is the product of all the diagonal elements of the matrix.
5. Transposition does not change determinant.
6. Any matrix with zero row or column has zero determinant.
7. If [A] and [B] are n×n matrices, then
det ([A][B]) = det ([B][A]) = det A det B.
From properties 2-4, we can use Gauss Elimination to find determinant. However, careful consideration is needed if there is any interchanging process during the elimination since it would change the determinant as stated in property 2.
Inverse matrix
For a square matrix [A], its inverse is denoted by [A]-1, where [A][A]-1 = [A]-1[A] = [I].
Not all square matrices have inverse. Inverse is defined as
[ ]
A !1= "# $%CijT
detA ,
where Cij is the cofactor previously defined. We can see that
“if det A = 0, then [A] has no inverse.”
Some properties of inverse matrix include:
1.
( [ ]
A[ ]
B)
!1 =[ ]
B !1[ ]
A !1;2.
( ) [ ]A !1 T =( ) [ ]A T !1
3.
( ) [ ]A !1 !1=[ ]A
Eigenvalues and Eigenvectors
One of the most often used applications of matrices in engineering is for solving eigenvalue problems. Eigenvalue problem is in the form of
[A]x!
=!x! ,
where [A] is an n×n matrix, x!
is a non-zero n-dimension vector, and λ is a scalar. λ is known as eigenvalue or characteristic value of [A], and x!
is known as eigenvector or characteristic vector of [A]. There are n values of λ, and for each value of λ there is a corresponding eigenvector. It is easy to see that cx!
will also be able to satisfy the equation if c is any scalar.
The equation above can be rewritten as [A]!"
[ ]
I( )
x! =0.Consequently, the eigenvalues λ can be found from solving equation det
(
[A]!"[ ]
I)
= 0.Eigenvectors can then be found by substituting each λ back into the original equation and apply method like Gauss elimination.
Example:
Let
[ ]
A = !22 21 !3!6!1 !2 0
"
#
$$
$
%
&
'' '
then !"3!"2 +21"+45=0. So !1=5,!2 =!3="3 The corresponding eigenvector for !1 is
x1= 1 2
!1
"
#
$$
$
%
&
'' '
.
Since !2 =!3, two of the rows are eliminated during Gauss elimination process, leaving only one equation to solve with 3 variables. Thus, we can pick any 2 values for 2 variables, and calculate the last one. Consequently,
x2 = !2 1 0
"
#
$$
$
%
&
'' '
, and x3 = 3 0 1
!
"
##
#
$
%
&
&
&
Example:
Find a matrix which linearly transform any two dimensional vectors x,y to the reflections of themselves about x-axis.
There are 2 cases which we need to consider:
1. If y = 0, then the vectors always line on the x-axis. Thus, the reflections of themselves would be the same vector. In this case,
!1=1 and r!
1 = 1
0
!
"
# $
%&
2. If y ± 0 but x = 0, then the reflections of the vectors would yield negative values. In this case,
!2 ="1 and r!
2 = 0
1
!
"
# $
%&
Our problem becomes
[ ]
A r!=!r!For !1 =1 and r!
1 = 1
0
!
"
# $
%&, a11 a12
a21 a22
!
"
##
$
%
&
&
1 0
!
"
# $
%&=
( )
1 1 0!
"
# $
%& 'a11=1,a21 =0.
For !2 ="1 and r!
2 = 0
1
!
"
# $
%&,
a11 a12 a21 a22
!
"
##
$
%
&
&
0 1
!
"
# $
%&=
( )
'1 0 1!
"
# $
%& (a12 =0,a22 ='1. Thus,
[ ]
A = 1 0 0 !1"
#$ %
&
' is the transform matrix that we are looking for.