module m2-1 electrical...
TRANSCRIPT
9/24/2013
1
Module M2-1Electrical Engineering
T U T O R I A L 1 V E C T O R S A N D C O U L O M B ' S L A W
A U G U S T 2 0 1 3
1
Topics
Review of vectors (with Matlab)
Coulomb's law
2
Coulomb s law
Examples and in-class exercises
9/24/2013
2
Notation
Vector and scalar quantities3
Vector or or
Scalar
Vector is a quantity that has both magnitude and di idirection
We usually represent a vector by a bold font, or a font with an arrow or a hat on top
The Cartesian coordinate system4
The direction of the axes is determined by the right- The direction of the axes is determined by the right-hand rule
Each point in the space is represented by a triple (x, y, z)
9/24/2013
3
The vector from one point to another point5
http://www.colorado.edu/geography/gcraft/notes/coordsys/coordsys_f.html
The vector from point to point is given by
or
Vector operation in Matlab
Matab represents a vector A = 1ax + 2ay + 3az by>> A = [1 2 3]
6
>> A = [1 2 3]
For a vector
The magnitude of A is given by
Matlab command for the magnitude (A)>> norm(A)
9/24/2013
4
Dot product
For vectorand vector
7
and vector
Dot product is a scalar that equals
where is the angle between A and B
Matlab commandMatlab command>> dot(A,B)
Cross product
A cross product is a vector that equals
8
Matlab command>> cross(A,B)
9/24/2013
5
Magnitude and direction of .
9
The magnitude isThe magnitude iswhere is the angle between A and B
The direction is orthogonal to both A and B and in the direction of the thumb (right-hand rule)
Cross product (cont.)
The cross product of the two t A
10
vectors A = 2ax + 1ay + 0az
and B = 1ax + 2ay + 0az is shown in blue.
C = 0ax + 0ay + 3az.
9/24/2013
6
Example: 2D Cartesian coordinate system
Let vectors A and B be given byA=[3 -2]; B=[1 3]; C=[-2 0]
11
A [3 2]; B [1 3]; C [ 2 0]
Question 1: Draw these vectors in the same diagram
Solution (picture) to question 112
9/24/2013
7
Example: 2D (cont.)
Question 2: Find in Matlab and draw in paper the vector sums A+B and A+B+C
13
Solution (Matlab):>> clear all % clear all variables>> A = [ 3 -2];>> B = [ 1 3];>> C = [-2 0];>> A+Bans =
4 14 1>> A+B+Cans =2 1
Solution (picture): A+B = [4 1]14
triangular law parallelogram law
9/24/2013
8
Solution (picture): A+B+C = [2 1]15
triangular law parallelogram law
Example: 2D (cont.)
Question 3: Find and draw vector differences A – B, B – A, and A – B – C
16
Solution (Matlab):>> A-Bans =
2 -5>> B-Aans =
2 5-2 5>> A-B-Cans =
4 -5
9/24/2013
9
Solution (picture)17
Example: 2D (cont.)
Question 4: Find and draw scalar multiplications of vectors 2A, -3B, and C/1.5
18
Solution (Matlab):>> 2*Aans =
6 -4>> -3*Bans =
3 9-3 -9>> C/1.5ans =-1.3333 0
9/24/2013
11
Solution (picture): C/1.5 = [-4/3 0]21
Example: 2D (cont.)
Question 5: Find the dot product:
22
Solution:
>> dot(A, B)ans =
-3
9/24/2013
12
Example: 2D (cont.)
Question 6: Find and draw the cross product
23
Solution:
>> cross([A 0], [B 0])ans =0 0 11
Append zero to the z-component,so we have a 3D vector needed forcomputing a cross product
Solution (picture)24
9/24/2013
13
In-class exercise: 3D Cartesian coordinate system
Let A=[3 -2 7]; B=[1 3 5]; C=[-2 0 3]
Question 1: Draw these vector in the same diagram
25
Question 1: Draw these vector in the same diagram
Solution (picture)26
9/24/2013
14
In-class exercise: 3D (cont.)
Question 2: Find and draw vector sumsA+B, A+B+C
27
Solution (Matlab):>> clear all % clear all variables>> A=[ 3 -2 7];>> B=[ 1 3 5];>> C=[-2 0 -3];>> A+Bans =
4 1 12>> A+B+Cans =
2 1 15
Solution (picture)28
9/24/2013
15
In-class exercise: 3D (cont.)
Question 3: Find and draw vector differencesA-B, B-A, A-C
29
, , Solution (Matlab):
>> A-Bans =
2 -5 2>> B-Aans =
-2 5 -2-2 5 -2>> A-Cans =
5 -2 4
Solution (picture)30
9/24/2013
16
In-class exercise: 3D (cont.)
Question 4: Find and draw scalar multiplications of vectors 2 A, 1.75B, 0.5C
31
Solution:>> 2*Aans =
6 -4 14>> 1.75*Bans =
1.7500 5.2500 8.7500>> 0.5*C ans =
-1.0000 0 1.5000
Solution (picture)32
9/24/2013
17
In-class exercise: 3D (cont.)
Question 5: Find the dot products , ,
33
Solution (Matlab):
>> dot(A, A)ans =
62>> dot(A, B)ans =
3232>> dot(A, C)ans =
15
In-class exercise: 3D (cont.)
Question 6: Find and draw the cross products, ,
34
Solution:>> cross(A, B)ans =
-31 -8 11>> cross(B, A)ans =
31 8 1131 8 -11>> cross(A, C)ans =
-6 -23 -4
9/24/2013
18
Solution (picture)35
Coulomb’s law
Positive charge attracts negative charge
Same polarity charges repel one another
36
Same polarity charges repel one another
Forces between two chargesa unit vector pointing fromcharge Q1 to charge Q2
Force acting on charge Q2due to charge Q1
Q = electric charge (coulomb, C)R12 = distance between two charges0 = 8.854 x 10-12 F/m
9/24/2013
19
Example: two positive charges
The first charge of 20p C is located at P1(2,3,4) m
The second charge of 40p C is located at P2(5 -3 6) m
37
The second charge of 40p C is located at P2(5, 3,6) m p denotes charge of a proton (1.602 x 10-19 C)
Let F12 = force acting on the first charge due to the second charge
Let F21 = force acting on the second charge due to the first charge
Question 1: Draw a diagram depicting charges and directions of F12 and F21
Solution (picture)38
9/24/2013
20
Example: two positive charges (cont.)
Question 2: Find F12 and F21
39
Solution: the Matlab code (next page) gives us these answers
Solution (Matlab)
%-----------------------%% adjustable parameters %%-----------------------%clear all % clear all variables, etc. from memoryP = 1 602e 19; % electrical charge of proton C
40
P = 1.602e-19; % electrical charge of proton, CEp0 = 8.85e-12; % Air permittivity, F/mQ1 = 20*P; % 1st chargeQ2 = 40*P; % 2nd chargeP1 = [2 3 4]; % location of 1st chargeP2 = [5 -3 6]; % location of 2nd charge
%-----------------------%% compute the forces %%-----------------------%R12 = P2-P1; % a vector from point P1 to point P2R21 = P1-P2; % a vector from point P2 to point P1R = norm(R12); % norm of vector R12, also norm of vector R21a12= R12/R; % a unit vector in the direction of vector R12a21=R21/R; % a unit vector in the direction of vector R12
% Coulomb's law: F = (Q_1 Q_2)/(4 * pi * epislon_0 R^2 ) a_rF21 = Q1*Q2/(4*pi*Ep0*R^2)*a12; % Force acting on Q2 due to Q1F12 = Q1*Q2/(4*pi*Ep0*R^2)*a21; % Force acting on Q1 due to Q2
% Display resultsF12 F21
9/24/2013
21
In-class exercise: positive & negative charges
The first charge of 20p C is located at P1(2,3,4) m The second charge of 40e C is located at P2(5,-3,6) m
41
The second charge of 40e C is located at P2(5, 3,6) m e denotes charge of an electron (-1.602 x 10-19 C)
Let F12 = force acting on the first charge due to the second charge
Let F21 = force acting on the second charge due to the first charge
Question 1: Draw a diagram depicting charges and directions of F12 and F21
Solution (picture)42
9/24/2013
22
In-class exercise: +,- charges (cont.)
Question 2: Find F12 and F21
43
Solution: the Matlab code (next page) gives us these answers
Solution (Matlab)
%-----------------------%% adjustable parameters %%-----------------------%clear all % clear all variables, etc. from memoryP = 1 602e 19; % electrical charge of proton C
44
P = 1.602e-19; % electrical charge of proton, Ce = -P; % electrical charge of electron, CEp0 = 8.85e-12; % Air permittivity, F/mQ1 = 20*P; % 1st chargeQ2 = 40*e; % 2nd chargeP1 = [2 3 4]; % location of 1st chargeP2 = [5 -3 6]; % location of 2nd charge
%-----------------------%% computer the forces %%-----------------------%R12 = P2-P1; % a vector from point P1 to point P2R21 = P1-P2; % a vector from point P2 to point P1R = norm(R12); % norm of vector R12, also norm of vector R21a12= R12/R; % a unit vector in the direction of vector R12a21=R21/R; % a unit vector in the direction of vector R12
% Coulomb's law: F = (Q_1 Q_2)/(4 * pi * epislon_0 R^2 ) a_rF21 = Q1*Q2/(4*pi*Ep0*R^2)*a12; % Force acting on Q2 due to Q1F12 = Q1*Q2/(4*pi*Ep0*R^2)*a21; % Force acting on Q1 due to Q2
% Display resultsF12 F21