VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY SE RO SS PROJECT REPORT Plot the trajectory of electron in static electromagnetic field Inst
Trang 1
VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY
HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY
SE RO SS
PROJECT REPORT Plot the trajectory of electron in static electromagnetic field
Instructor: Prof Huynh Quang Linh
Course code: PH1003
Class: CCO1
Group: 10
Members:
1 Kiéu Hai Nam 1952346
2 Nguyên Hải Đăng 1913092
Ho Chi Minh City, November 2021
Trang 2
CONTENTS
REFERENCES 14
Trang 31 Introduction
Electromagnetic theory is concerned with the study of charges at rest and
in motion Electromagnetic principles are fundamental to the study of electrical engineering It is also required for the understanding, analysis and design of various electrical, electromechanical and electronic systems Electromagnetic theory can be thought of as generalization of circuit theory Electromagnetic theory deals directly with the Ielectric and magnetic field vectors where as circuit theory deals with the voltages and currents Voltages and currents are integrated effects of electric and magnetic fields respectively
The Electromagnetic field problems involve three space variables along with the time variable and hence the solution tends to become correspondingly complex
A charged particle of mass m and charge q will experience a force acting upon it in an electric field E Also, the charged particle will experience a magnetic force acting upon it when moving with a velocity v in a magnetic
field B
The equation of the electron when its moves in static electromagnetic field 1s expressed by the Lorentz force:
F =—;+F,=qE +qvxB
With the initial position and velocity, we can determine the kinetic motion equations of electron x (t), y (t) and z (t) After that, we can determine the acceleration of the electron
Subsequently, eliminating t from mentioned motion equations, we can derive f(x, y, z) = const, which is the orbital equation of electron
If the charged particle is stationary ( v = 0), the force depends only of the electric field The direction of the electric force is in the same direction as the electric field if g > 0 and the electric force is in the opposite direction to the electric field if g <0
When a charged particle is moving only in a magnetic field, the direction
1
Trang 4of the magnetic force is at right angles to both the direction of motion and the direction of the magnetic field as given by the right hand palm rule
Tự
Vv +ử
out of page
palm face
positive charge in a
fingers magnetic field
“
Í v.(+4) thumb
B fingers
= motion of a
( 4) negative charge in
= a magnetic field
F palm face
This project requires students to use MATLAB to calculate and simulation
of the trajectory of a particle in electric and magnetic field (electromagnetic field).
Trang 52 Theory
Consider a particle of charge q coulombs and mass m kilograms subjected
to an electric field
E (0,0,E;) > E = Ezk
In newtons per coulomb and a magnetic field
B (0,0,B,) > B = Bk
The equation of the electron when its moves in static electromagnetic field 1s expressed by the Lorentz force:
F =l+h=qÈE +quxB
=>ma =q(E +0 xB)
With @ is the acceleration vector Expressing by component in the Cartesian coordinates reference, we can obtain following differential equations:
m( a,ita,jta,k)=qlEzk + (v,i+ vj +v,k ) x Bz k]
m( a,i+ ayj + a,k )= qEzk + q(v,it vj + v,k) x Bk
ma, = qBz vy
=> Wa, = —qBz v,
ma, = qkz
Bz
m
“ qBz
=> y = — m x
„— qÈz
Projection in the direction of Ox
Differential equation
x(t) =K2y'(0
Trang 6Projection in the Oy direction
Differential equation
y"(t) = ©
Projection in the Oz direction
Differential equation
z"(t) =
With
x(0) = Xo
y(0) = yo
z(0) = Zo
x'(0) = vy
y'(0) = Yy0
Z'(0) = 1;o
These are coupled second-order ordinary differential equations that can be solved by either analytical or numerical methods
Numerically, as done in this demonstration, the solution needs initial conditions for the velocity and the position, given by
7 (Xo, Yo Zo) > 7 = xo? + Vos + Zok
Vo (Pxo, yo, V9) > Vo = Vxol + 0yạj + 9;0Ñ
Trang 73 MATLAB Code and Explanation
% Motion of a electron in uniform cross B and E fields
clear; clc; clf;
syms x(t) y(t) z(t);
syms k ki k2 vxô vy9 vz9 x9 yô z0;
format short;
ĐT TT TT TT HT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT Tre
% SYMBOLTC OPERATTON
ˆ d HH
Dx = diff(x,t);
Dy = diff(y,t);
Dz = diff(z,t);
% ki = q*B/m and k2 = q*E/m
% ODE function
ode1 = diff(x,t,2) == k1*diff(y,t);
ode2 = diff(y,t,2) == -k1*diff(x,t);
ode3 = diff(z,t,2) == k2;
Eqn = [ode1, ode2, ode3];
Cond = [Dx(@) == vx@; Dy(@) == vy@; Dz(@) == vz0;
x(9) == x9; y(9) == y9; z(8) == 20];
S = dsolve(Eqn,Cond);
x_func = collect(simplify(S.x));
y_func = collect(simplify(S.y));
z_func = collect(simplify(S.z));
vx_func = collect(simplify(diff(S.x,t)));
vy_func = collect(simplify(diff(S.y,t)));
vz_func = collect(simplify(diff(S.z,t)));
ax_func = collect(simplify(diff(S.x,t,2)));
ay_func = collect(simplify(diff(S.y,t,2)));
az_func = collect(simplify(diff(S.z,t,2)));
% Motion function
disp('Motion function on x-direction: x='); disp(x_func);
disp('Motion function on y-direction: y="); disp(y_func);
disp('Motion function on z-direction: z='); disp(z_func);
disp(' co0000000000000000000000000000000000000000000' );
% Nelocity function
disp('Velocity function on x-direction: vx ='); disp(vx_func);
disp('Velocity function on y-direction: vy ='); disp(vy_func);
disp('Velocity function on z-direction: vz ='); disp(vz_func);
disp(' co0000000000000000000000000000000000000000000' );
% Acceleration function
disp('Acceleration function on x-direction: ax ='); disp(ax_func);
disp('Acceleration function on x-direction: ay ='); disp(ay_func);
disp('Acceleration function on x-direction: az ='); disp(az_func);
disp(' co0000000000000000000000000000000000000000000' );
6 Note
disp('with k1 = q*B/m');
disp('with k2 = q*E/m');
Trang 8di sp( ` ooooooooooo0000000000000000000000000000000000”};
disp('Recommended parameters for you to enter/input'}
disp('Recommended initial position of electron: [9 9 0] ');
disp('Recommended initial position of electron [2 3 -5]');
disp('Recommended static magnetic field parallel to z-axis: 2e-11');
disp('Recommended static electric field parallel to z-axis: 5e-12');
disp(' '); disp(' '); disp(' '); disp(' ');
% Enter initial position and velocity of electron
r@ = input('Enter the initial position of electron [x@ y@ z@] (m) - ');
vô = input('Enter the initial velocity of electron [vx@ vy@ vz@] (m/s) - `);
% Enter magnitude of uniform B and E fields
B = input('Enter static magnetic field parallel to z-axis [@ @ B] (T) - ');
E = input('Enter static electric field parallel to z-axis [@ Ø9 E] (V/m) - `);
% Parameter of electron
m = 9.10939e-31;
q = 1.602177e-19;
k11= q*B/m;
k22= q*E/m;
disp(' '); disp(’ '); disp(' '); disp(' °);
Fx=subs(m*ax_ func, [x9,y9, z9, vx9,vy9,vz9, k1,k2], [r9(1),r9(2),r9(3),v9(1),v9(2),v@(3
),k11,k22]);
Fy=subs(m*ay_ func, [x@,y0, z9, vx9,vy9,vz9, k1,k2], [r9(1),r9(2),r9(3),v9(1),v9(2),v@(3 ),k11,k22]);
Fz=subs(m*az_ func, [x9,y9,z9,vx9, vy8,vz9, k1, k2], [r9(1),rØ(2),r9(3),v@(1),v9(2),v9(3
),k11,k22]);
disp('Force acting on the electron on x-direction: Fx='); pretty(Fx); disp('Force acting on the electron on y-direction: Fy="); pretty(Fy); disp('Force acting on the electron on z-direction: Fz='); disp(double(Fz));
disp(' '); disp’ '); disp(' '); disp(’ ');
ĐT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT TT Tre
% OUTPUT FUNCTION
h1=subs(S.x, [x9, y9,z9, vx9,vy9,vz8, k1, k2],[r9(1) ,rØ(2),r9(3),vô(1),vô(2),v9(3),k11,
k22]);
h2=subs(S.y, [x9, y9,z9,vx9,vy9,vz9, k1, k2],[r9(1) ,rØ(2),r9(3),vô(1),vô(2),v9(3),k11,
k22]);
h3=subs(S z, [x9, y9,z9, vx9,vy9,vz8, k1, k2],[r9(1) ,rØ(2),r9(3),vô(1),vô(2),v9(3),k11,
k22]);
Trang 9disp(' - Function after entering parameters - 3;
% Motion function
disp('Motion function on x-direction: x='); pretty(h1);
disp('Motion function on y-direction: y="); pretty(h2);
disp('Motion function on z-direction: z="); pretty(h3);
đi sp( `oooooooooooo0000000000000000000000000000000000000000000000000000000000000`);
% Velocity function
disp('Velocity function on x-direction: vx ="); pretty(diff(h1,t));
disp('Velocity function on y-direction: vy ="); pretty(diff(h2,t));
disp('Velocity function on z-direction: vz ="); pretty(diff(h3,t));
đi sp( `ooooooooooooo000000000000000000000000000000000000000000000000000000000000`);
% Acceleration function
disp('Acceleration function on x-direction: ax ='); pretty(diff(h1,t,2)); disp('Acceleration function on x-direction: ay ='); pretty(diff(h2,t,2)); disp('Acceleration function on x-direction: az ="); pretty(diff(h3,t,2)); ~ v
XMax = 5 3 XMin = -XMax;
YMax = XMax ; YMin = -YMax;
ZMax = 20 ; ZMin = -20;
fplot3(h1,h2,h3,[@ 58], '`-', 'LineMWidth',1);
grid on
axis equal
box on
axis([XMin, XMax, YMin, YMax, ZMin, ZMax]);
xlabel('x [m]');
ylabel('y [m]');
zlabel('z [m]');
set(gca, 'fontsize',18);
Trang 104 Results and discussion
y [m] lở 5 x [m]
Trang 12Motion function on x-direction: x=
Motion function on y-direction: y=
v0 + (vx0*cos(kl*t) - vx0 + vy0*sin(kl*t))/kl
Motion function on z-direction: z=
(k2*t^2)/2 + vz0*t + z0
009090000000000000000000000000000000000000000000
Velocity function on x-direction: vx =
cos (k1*t)*vx0 + vy0*sin(kl1*t)
Velocity function on y-direction: vy =
(-sin(k1*t))*vx0 + vy0*cos (k1*t)
Velocity function on z-direction: vz =
vz0 + k2*t
000000000000000000000000000000000000000000000
Acceleration function on x-direction: ax =
(-k1l*sin(k1*t))*vx0 + kl*vy0*cos (k1*t)
Acceleration function on x-direction: ay
(-k1*cos (k1*t))*vx0 - kl*vy0*sin(kl*t)
Acceleration function on x-direction: az =
k2
099000000000000000000000000000000000000000000
with kl = q*B/m
with k2 = q*E/m
000000000000000000000000000000000000000000000
Recommended prameters for you to enter/input
Recommended initial position of electron: [0 0 0]
Recommended initial position of electron [2 3 -5]
Recommended static magnetic field parallel to z-axis: 2e-11
Recommended static electric field parallel to z-axis: 5e-12
Enter the initial velocity of electron [vx0 vy0 vz0] (m/s) - [2 3 -5]
Enter static electric field parallel to z-axis [0 0 E] (V/m) - 5e-12
Force acting on the electron on x-direction: Fx=
/ 7921017477769179 t \
a a | 61790380198481666882465389812213
\ 2251799813685248 /
ie 6427752177035961 1021 67848 369364650410088811975131171 341205504
10
Trang 13Force acting on the electron on x-direction: Fx=
/ 7921017477769179 t \
COS)| =e | 61790380198481666882465389812213
\ 2251799813685248 /
6427752177035961102167848369364650410088811975131171341205504
/ 7921017477769179 t \
gin| =-—=~ —= —= ——- | 20596793399493888960821796604071
\ 2251799813685248 /
3213876088517980551083924184682325205044405987565585670602752 Force acting on the electron on y-direction: Fy=
/ 7921017477769179 t \
e8) ==============—=== | 20596793399493888960821796604071
\ 2251799813685248 /
3213876088517980551083924184682325205044405987565585670602752 / 7921017477769179 t \
sin| -— | 61790380198481666882465389812213
\ 2251799813685248 /
6427752177035961102167848369364650410088811975131171341205504 Force acting on the electron on z-direction: Fz=
8.0109e-31
Motion function on x-direction: x=
/ 7921017477769179 t \
\ 2251799813685248 /
7921017477769179
/ 7921017477769179 t \
GUỸI messes | 2251799813685248
\ 2251799813695248 / 2251799813685248
2640339159256393 2640339159256393 Motion function on y-direction: y=
/ 7921017477769179 t \
ees) ——— | 4503599627370496
\ 2251799813685248 /
7921017477769179
Trang 14Motion function on x-direction: x=
/ 7921017477769179 t \
Sin) SSS | 4503599627370496
\ 2251799813685248 /
7921017477769179
/ 7921017477769179 t \
cuø|i ==——==========—=———=— | 2251799813685248
\ 2251799813685248 / 2251799813685248
Se m=-.ˆ `
2640339159256393 2640339159256393 Motion function on y-direction: y=
/ 7921017477769179 t \
cos| - | 4503599627370496
\ 2251799813685248 /
7921017477769179
/ 7921017477769179 t \
Sift] =— = -= -=-= —— | 2251799813685248
\ 2251799813685248 / 4503599627370496
ge eee ee rr ey Se SE
2640339159256393 7921017477769179
Motion function on z-direction: z=
Z
7921017477769179 t
18014398509481984
O©OOOOOOOOOOOOOOOGOOOOOOOOOOOOOCOOOOOOOOOOOOOOOOCOGOOOOOOOOOOOOOOOCOOOOOOO Velocity function on x-direction: vx =
/ 7921017477769179 t \ / 7921017477769179 t \
ĐOBổ| m——rrrr~—axr—an~ )| Z + 83h| -—-==—-~=-r~r-r-x~~— ý
\ 2251799813685248 / \ 2251799813685248 /
Velocity function on y-direction: vy =
/ 7921017477769179 t \ / 7921017477769179 t \
cos| - | 3 - sin| - | 2
\ 2251799813685248 / \ 2251799813685248 /
Velocity function on z-direction: vz =
7921017477769179 t
9007199254740992
299000000000000000000000000000000000000000000000000000000000000000000000 Acceleration function on x-direction: ax =
/ 7921017477769179 t \
cos| — -—-— - | 23763052433307537
Trang 15Command Window
Velocity function on x-direction: vx =
/ 7921017477769179 t \ / 7921017477769179 t \
-——_->an | 2 + sin| - | 3
\ 2251799813685248 / \ 2251799813685248 /
Velocity function on y-direction: vy =
/ 7921017477769179 t \ / 7921017477769179 t \
GB] == == == mxe—e-mr [| 3 :— BBẴBÄẢ =—=====-=r=—===== | 2
\ 2251799813685248 / \ 2251799813685248 /
Velocity function on z-direction: vz =
7921017477769179 t
9007199254740992
0000000000000000000000000000000000000000000000000000000000000000000 Acceleration function on x-direction: ax =
/ 7921017477769179 t \
cos| - | 23763052433307537
\ 2251799813685248 /
2251799813685248
/ 7921017477769179 t \
sin| - | 7921017477769179
\ 2251799813685248 /
1125899906842624 Acceleration function on x-direction: ay =
/ 7921017477769179 t \
668] = s-cscc css sos oss | 23763052433307537
\ 2251799813685248 /
2251799813685248
/ 7921017477769179 t \
sin| - | 7921017477769179
\ 2251799813685248 /
1125899906842624 Acceleration function on x-direction: az =
/ 7921017477769179 t \
cos| - | 23763052433307537
\ 2251799813685248 /
2251799813685248
/ 7921017477769179 t \
sin| - | 7921017477769179
\ 2251799813685248 /
1125899906842624
Fe >>