F undamental E lectromagnetics
[ Chapter 2: Vector Algebra ]
Prof. Kwang-Chun Ho
[email protected]
Tel: 02-760-4253 Fax:02-6919-2160
Basic concept of scalars and vectors What is unit vector?
Vector addition and subtraction Position and distance vectors Vector multiplication
Dot product Cross product
Components of a vector
Key Points
Scalar quantities:
Time, Mass, Distance, Temperature, etc Vector quantities:
Velocity, Force, Acceleration, etc Field:
A function that specifies a particular quantity everywhere in a region
Scalars and Vectors
Scalars Vectors
Definition Magnitude only Magnitude & Direction
Scalar field:
Is a function that specifies a scalar quantity everywhere in a region
Height of a mountain
Sound intensity in a theater
Is just one where a quantity in “space” is represented by numbers, such as this temperature map
Scalars and Vectors
Can express
as a function T x y ( , )
Vector field:
Is a function that specifies a vector quantity everywhere in a region
Gravitational force on a body in a space
Wind map in the atmosphere
Scalars and Vectors
Vectors show magnitude and displacement, drawn as a ray :
Vector Notation
A
Vector :
Magnitude of : or
Direction of : unit vector whose magnitude is unity.
That is,
In Cartesian(or rectangular) coordinates, it represents as or
where are components of in x, y and z directions, respectively.
a
AA
,
Aa A A A a
A
A A A
x,
y,
z
A A
A
x x y y z z
A a A a A a , , and
x y z
A A A
Or can use Bold-Faced Type like
A A A
A
Unit vector
(Graphical Representation)
A
a
Aa
AA Aa
AThe magnitude and unit vector of vector are then
2 2 2
x y z
A A A A
2 2 2x x y y z z
A
x y z
A a A a A a a
A A A
A
Unit vector
a
xa
ya
zA
z z
A a
x x
A a
y y
A a
Example 2.1:
Describe the vectors and , shown in the following figures
P
R
Unit vector
x
y z
P
x
y z
R 3 a
x4 a
yExample 2.2:
Describe the vectors and , shown in the following figures
R
2R
11
2
x y
,
x y z
R aa ba
R aa ba ca
Unit vector
R
1R
2Two vectors and add together to obtain a new vector :
if , then
Vector subtraction is similarly carried out as C A B
x,
y,
z and
x,
y,
z
A A A A B B B B
x x
x
y y
y
z z
zC A B a A B a A B a
x x
x( )
y y
y
z z
zD A B A B
A B a A B a A B a
A
B C
Vector addition and subtraction
Vector addition and subtraction
Vectors may be added graphically,
“head to tail.”
Vector addition and subtraction
Special case of vector addition
Add the negative of the subtracted vector
Continue with standard vector addition procedure
A B A B
Example 2.3:
If and , find
(a) the component of along ,
(b) the magnitude of ,
(c) a unit vector along
Solution:
(a)
(b) Since , we have
(c) Letting , a unit vector along is
10
x4
y6
zA a a a
2
x yB a a 3A B
y
4 A
3 A B 3(10, 4, 6) (2,1, 0) (28, 13,18)
2 2 2
3 A B 28 ( 13) 18 1277
2 (10, 4, 6) (4, 2, 0) (14, 2, 6) C A B
2 2 2
(14, 2, 6) 14 ( 2) 6
A
a C
C
A
a
y2 A B
C
Vector addition and subtraction
Example 2.4:
Given vector and , determine
(a) ,
(b) ,
(c ) The component of along ,
(d) A unit vector parallel to
Solution:
(a)
(b)
(c)
(d)
A unit vector parallel to this vector is
x
3
zA a a
5
x2
y6
zB a a a A B
5A B
A
a
y3A B
Vector addition and subtraction
MatLab Lesson:
MatLab scripts to calculate a vector magnitude
MatLab scripts to calculate the unit vector
Find the unit vector of vector using MatLab
function y=magvector(R)
% Calculates the magnitude of a Cartesian vector R y=sqrt(R(1)^2+R(2)^2+R(3)^2);
function y=unitvector(R)
% Calculates the unit vector of a Cartesian vector R y=R/magvector(R);
>> A=[10 -4 6];
>> unitvector(A)
10
x4
y6
zA a a a
Vector addition and subtraction
Show the graphical representation of addition and subtraction of two vectors in Example 1.3
Run vectoralg.m!
Visual EMT using MatLab
A point P may be described by (x, y, z)
Then, the position vector of point P is the directed distance from the origin to P, that is,
As example, a position vector is shown as
p x y z
r OP xa ya za
3 a
x 4 a
y 5 a
zr
pPosition and distance vectors
, ,
p x y z
r xa ya za
x y z
a
xa
ya
z rp
Distance vector: displacement from one point to another
if two points P and Q are given as and , the distance vector is
x
P, y
P, z
P
x
Q, y
Q, z
Q
PQ Q P Q P x Q P y Q P z
r r r x x a y y a z z a
Position and distance vectors
r
Pr
Qr
PQQP P Q
r r r r
Pr
QP
Example 2.5:
Given points and , find:
(a) the position vectors of P and R,
(b) the distance vector ,
(c) the distance between P and Q
Solution:
(a)
(b)
(c)
1, 3, 5 , 2, 4, 6
P Q R 0, 3,8
r
QRPosition and distance vectors
Example 2.6:
Woman walks with a velocity of 1.0 m/s along the
aisle of a train that is moving with a velocity of 3.0 m/s.
What is the woman’s velocity?
Solution:
For passenger sitting in a train: 1.0 m/s
For bicyclist standing:
Relative velocity in 1-D
Cyclist: frame of reference A
Moving train: frame of reference B
In 1-D motion, position of P relative to frame of reference A is given by distance x
P/A Position of P relative to frame of reference B is given by distance x
P/B Distance from origin A to origin B is given by x
B/A Thus,
Velocity v
P/Aof P relative to frame A is the derivative of x
P/Awith respect to time
Relative velocity in 1-D
/ / /
P A B A P B
x x x
/ / /
1.0 / 3.0 / 4.0 /
P A P B B A
v v v
m s m s m s
dt
dx dt
dx dt
dx
P/A P/B B/A
Example 2.7:
A river flows SE at 10 km/hr, and a boat flows upon it.
A man walks upon the deck at 2 km/hr to the perpendicular direction.
Find the velocity of the man with respect to
the earth.
Solution:
Since the velocity of boat is
10 cos 45 sin 45 7.071( ) km/hr
b x y
u a a
a a
Relative velocity in 2-D
u
mu
abu
b, and the velocity of the man with respect to the boat (relative velocity) is
the absolute velocity of the man is
that is, 10.2 km/hr at 56.3
osouth of east
56.3
5.657 8.485 km/hr 10.2
ab m b x y
j
u u u a a
e
2 cos 45 sin 45 1.414( ) km/hr
m x y
x y
u a a
a a
Relative velocity in 2-D
Example 2.8:
The velocity of the boat relative to the water is 4.0 m/s, directed
perpendicular to the current
The river is 1.8 km wide and the velocity of the water relative to the shore is 2.0 m/s
How far upstream is the boat when it reaches the opposite shore?
Solution:
Relative velocity in 2-D
There are two types of vector multiplication:
Scalar (or dot) product:
Vector (or cross) product:
Dot product:
Here is the smaller angle between two vectors, and the result is scalar.
If and , then A B
A B cos
ABA B A B
AB
x,
y,
z
A A A A
x x y y z z
A B A B A B A B
0 (Orthogonal) 1
x y y z z x
x x y y z z
a a a a a a a a a a a a
x,
y,
z
B B B B
using
% Matlab script
>> dot(A,B)
Vector multiplication
Example 2.9:
Work of a force acting on a body when the body is moved by a small distance
Work done by the force is
x
cos
F x F x
( Product between the components of the same direction )
(Graphical Representation)
ABB
A a
a B
(Projection= )
B cos
ABVector multiplication
Example 2.10:
Find the work done against gravity to move a 10 kg baby from the point (2,3) to the point (5,7) ?
Solution:
We have that the force vector is
And the displacement vector is
The work is the dot product
Notice the negative sign verifies that the work is done against gravity
Hence, it takes 392 J of work to move the baby
10 9.8
yF mg a
5 2
x 7 3
y3
x4
yx a a a a
98
y 3
x4
y 392
F x a a a
Vector multiplication
x y
(2, 3)
(5, 7)
Example 2.11:
If and , find Solution:
Using the dot product,
Thus,
ABx
3
zA a a
5
x2
y6
zB a a a
Vector multiplication
% Matlab script A = [1 0 3];
B = [5 2 -6];
Num = dot(A,B);
Den=sqrt(sum(A.^2))*sqrt(sum(B.^2));
Theta_AB = (180/pi)*acos(Num/Den)
There are instances where the product of two vectors is another vector
Torque:
The torque (turning force) vector lies in a direction perpendicular to the plane formed by the
position vector and the force vector
The torque is the vector (or cross) product of the position vector and the force vector
Vector multiplication
Cross Product:
where is a unit vector normal to the area of parallelogram, and the result is vector
a
nA B AB sin
ABa
n% Matlab script
>> cross(A,B)
Vector multiplication
(Right‐hand rule) (Right‐handed screw rule)
sin
ABA B AB
= area of parallelogram
B A B
A B
B
a
na
nIf and , then
Basic properties:
x y z
x y z
x y z
y z z y x z x x z y x y y x z
a a a A B A A A
B B B
A B A B a A B A B a A B A B a
x,
y,
z
A A A A
x,
y,
z
B B B B
(More easily remembered form)
A B B A
A B C A B C
A B C A B A C
, , ,
x y z y x
y z x z y
z x y x z
a a a a a
a a a a a
a a a a a
(Commutative Law)
(Associative Law)
(Distributive Law)
Vector multiplication
a
xa
ya
za
za
ya
xExample 2.12:
Let and ,
(a) Find the vector component of along
(b) Determine a unit vector perpendicular to both and
Solution:
(a) Since , using , we have
(b) Using
3
y4
zA a a
4
x10
y5
zB a a a
B B B B B
A A a A a a
BB
a B
2
10 4, 10, 5
0.2837 0.7092 0.3546
B
141
x y zA B B
A a a a
B
0 3 4 55,16, 12 ,
4 10 5
x y z
a a a
A B
B
cos
AB BA a A A
Vector multiplication
A
B
A
B
Example 2.13:
Show that vector , and form the sides of a triangle.
Is this a right angle?
Calculate the area of the triangle
Solution:
Since , it is a right angle triangle
Area =
4, 0, 1 , 1, 3, 4
a b c 5, 3, 3
Rectangle Area
% Matlab script a = [4 0 -1];
b = [1 3 4];
c = cross(a,b);
Area = 1/2*sqrt(sum(c.^2));
Vector multiplication
Plot the trajectory of a particle moving in Cartesian coordinate in terms of vector notations
Run rectCoord.m!
Visual EMT using MatLab
Let ’s and
(a) Plot the Dot-product (b) Plot the Cross-product
2
xA a
A B
A B
Run vecalgebra.m!
2 2
sin
x x y yB xy a e
a
Visual EMT using MatLab
Scalar triple product:
Given three vectors , and , the scalar triple product is
if and , then ,
A B
A B C B C A C A B
x,
y,
z ,
x,
y,
z
A A A A B B B B
xx yy zzx y z
A A A
A B C B B B
C C C
C
x,
y,
z
C C C C
Vector multiplication
Vector triple product:
Given three vectors , and , the vector triple product is
A B C B A C C A B
, A B
C
Vector multiplication
Height = A a
n
Area = B C a
nA
C
B
A direct application of vector product is to determine the projection (or component) of a vector in a desired direction
Given a vector , the scalar component along vector is
The vector component of along vector is
cos cos
B AB B AB B
A A A a A a
A
B
B B B B B
A A a A a a
Components of a vector
A
B
A
A
A A
BDivision of vectors does not consider because it is undefined
Coordinate components of a vector:
Components of a vector
A
y: Component
along y-direction
a
ya
ya
xa
xA
x: Component along x-direction
There are two methods of vector addition
Graphical : represent vectors as scaled-directed line segments; attach tail to head
Analytical : resolve vectors into x and y components;
add components
Components of a vector
,
x x x
,
y y y
R A B
R A B
R A B
cos , sin
cos , sin
x A y A
A A A A
B B B B
Example 2.14:
Derive the cosine formula Solution:
From the triangle of figure, we know that
2 2 2
2 cos a b c bc A
0, that is,
a b c
b c a
Thus, it becomes
2
2 2
2 2 cos
a a a b c b c b b c c b c b c bc A
Application of vectors
a
ba
b
c
Example 2.15:
Derive the law of sines for a triangle using vectors Solution:
We have
Because , we can write or
Thus,
Similarly, we have
B C
180
B C A 0 B B
0
B C A B C B A
sin sin
BC BA sin sin
A C
sin sin sin
A B C
Application of vectors
Problem 2.1:
Find the unit vector along the line joining point (2, 4, 4) to point (-3, 2, 2).
Problem 2.2:
Let , and
(a) Determine
(b) Calculate
(c) For what values of k is ?
(d) Find
Problem 2.3:
Show that
Homework Assignments
2
x5
y3 ,
z3
x4
yA a a a B a a
x y z
C a a a 2
A B 5 A C
2 kB
A B / A B
A B
2 A B
2 AB
2Problem 2.4:
Points , and form a triangle in space. Find the three angles of the triangle.
Problem 2.5:
and are vector fields given by and . Determine
(a) at (1, 2, 3)
(b) The component of along at (1, 2, 3)
(c) A vector perpendicular to both and at (0, 1, -3) whose magnitude is unity.
Homework Assignments
1
1, 2, 3 ,
25, 2, 0
P P P
3 2, 7, 3
E
F
2
x y zE xa a yza
2
x y z