VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY PROJECT REPORT Plot the trajectory of electron in static electromagnetic field Instructor: Prof..
Trang 1VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY
HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY
PROJECT REPORT
Plot the trajectory of electron in static electromagnetic field
Instructor: Prof Huynh Quang Linh
Course code: PH1003
Class: CC01
Group: 10
Members:
Ho Chi Minh City, November 2021
Trang 21 INTRODUCTION 1
2 THEORY 3
3 MATLAB Code and Explanation 5
4 Results and discussion 8
5 Conclusion 14
REFERENCES 14
Trang 31
1 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 𝐸⃗ Also, the charged particle will experience a magnetic force acting upon it when moving with a velocity 𝑣 in a magnetic field 𝐵⃗
The equation of the electron when its moves in static electromagnetic field
is expressed by the Lorentz force:
𝐹
⃗⃗⃗ = 𝐹 𝐸 + 𝐹 𝐿 = q𝐸⃗ + q𝑣 × 𝐵⃗
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 ( 𝑣 = 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 𝑞 > 0 and the electric force is in the opposite direction to the electric field if 𝑞 < 0
When a charged particle is moving only in a magnetic field, the direction
Trang 42
of 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
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 53
2 Theory
Consider a particle of charge q coulombs and mass m kilograms subjected
to an electric field
𝐸 ⃗⃗⃗ (0,0, 𝐸𝑍) → 𝐸 ⃗⃗⃗ = 𝐸𝑍 𝑘̂
In newtons per coulomb and a magnetic field
𝐵 ⃗⃗⃗ (0,0, 𝐵𝑍) → 𝐵 ⃗⃗⃗ = 𝐵𝑍 𝑘̂
The equation of the electron when its moves in static electromagnetic field
is expressed by the Lorentz force:
𝐹
⃗⃗⃗ = 𝐹 𝐸 + 𝐹 𝐿 = q 𝐸⃗ + q𝑣 × 𝐵⃗
𝐹
⃗⃗⃗ = 𝑚𝑎 ⃗⃗⃗
𝐹
⃗⃗⃗ = 𝑞( 𝐸 ⃗⃗⃗⃗ + 𝑣 ⃗⃗⃗ × 𝐵 ⃗⃗⃗ )
=> 𝑚𝑎 ⃗⃗⃗ = 𝑞( 𝐸 ⃗⃗⃗⃗ + 𝑣 ⃗⃗⃗ × 𝐵 ⃗⃗⃗ )
With 𝑎 ⃗⃗⃗ is the acceleration vector Expressing by component in the Cartesian coordinates reference, we can obtain following differential equations:
𝑚( 𝑎𝑥𝑖̂ + 𝑎𝑦𝑗̂ + 𝑎𝑧𝑘̂ ) = 𝑞[𝐸𝑍 𝑘̂ + (𝑣𝑥𝑖̂ + 𝑣𝑦𝑗̂ + 𝑣𝑧𝑘̂ ) × 𝐵𝑍 𝑘̂]
𝑚( 𝑎𝑥𝑖̂ + 𝑎𝑦𝑗̂ + 𝑎𝑧𝑘̂ ) = 𝑞𝐸𝑍 𝑘̂ + 𝑞(𝑣𝑥𝑖̂ + 𝑣𝑦𝑗̂ + 𝑣𝑧𝑘̂) × 𝐵𝑍 𝑘̂
=> {
=>
{
𝑥̈ = 𝑞𝐵 𝑚 𝑦̇𝑍
𝑦̈ = − 𝑞𝐵 𝑚 𝑥̇𝑍 𝑧̈ = 𝑞𝐸 𝑚𝑍
Projection in the direction of Ox
Differential equation
Trang 64
Projection in the Oy direction
Differential equation
𝑦′′(𝑡) = − 𝑞𝐵 𝑚 𝑥′𝑍 (𝑡)
Projection in the Oz direction
Differential equation
𝑧′′(𝑡) = 𝑞𝐸 𝑚𝑍
With
𝑥(0) = 𝑥0
𝑧(0) = 𝑧0
𝑥′(0) = 𝑣𝑥0
𝑧′(0) = 𝑣𝑧0
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
𝑟0
⃗⃗⃗ (𝑥0, 𝑦0, 𝑧0) → 𝑟 ⃗⃗⃗ = 𝑥0 0𝑖̂ + 𝑦0𝑗̂ + 𝑧0𝑘̂
𝑣0
⃗⃗⃗⃗ (𝑣𝑥0, 𝑣𝑦0, 𝑣𝑧0) → 𝑣 ⃗⃗⃗⃗ = 𝑣0 𝑥0𝑖̂ + 𝑣𝑦0𝑗̂ + 𝑣𝑧0𝑘̂
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 75
3 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 k1 k2 vx0 vy0 vz0 x0 y0 z0 ;
format short ;
% -% SYMBOLIC OPERATION
Dx = diff(x,t);
Dy = diff(y,t);
Dz = diff(z,t);
% 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(0) == vx0; Dy(0) == vy0; Dz(0) == vz0;
x(0) == x0; y(0) == y0; z(0) == z0];
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)));
% -% OUTPUT FUNCTION
% -% 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( 'ooooooooooooooooooooooooooooooooooooooooooooo' );
% Velocity 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( 'ooooooooooooooooooooooooooooooooooooooooooooo' );
% 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( 'ooooooooooooooooooooooooooooooooooooooooooooo' );
% Note
disp( 'with k1 = q*B/m' );
disp( 'with k2 = q*E/m' );
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 86
% -% DISPLAY RECOMMENDED INPUT PARAMETERS
disp( 'ooooooooooooooooooooooooooooooooooooooooooooo' );
disp( 'Recommended parameters for you to enter/input' )
disp( 'Recommended initial position of electron: [0 0 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' );
% -% INPUT PARAMETERS
disp( ' ' ); disp( ' ' ); disp( ' ' ); disp( ' ' );
% Enter initial position and velocity of electron
r0 = input( 'Enter the initial position of electron [x0 y0 z0] (m) - ' );
v0 = input( 'Enter the initial velocity of electron [vx0 vy0 vz0] (m/s) - ' );
% Enter magnitude of uniform B and E fields
B = input( 'Enter static magnetic field parallel to z-axis [0 0 B] (T) - ' );
E = input( 'Enter static electric field parallel to z-axis [0 0 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( ' ' );
% -% CALCULATE THE ELECTROMAGNETIC FORCE ACTING ON THE ELECTRON
Fx=subs(m*ax_func,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(3 ),k11,k22]);
Fy=subs(m*ay_func,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(3 ),k11,k22]);
Fz=subs(m*az_func,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(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( ' ' );
% -% OUTPUT FUNCTION
h1=subs(S.x,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(3),k11, k22]);
h2=subs(S.y,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(3),k11, k22]);
h3=subs(S.z,[x0,y0,z0,vx0,vy0,vz0,k1,k2],[r0(1),r0(2),r0(3),v0(1),v0(2),v0(3),k11, k22]);
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 97
disp( ' -Function after entering parameters -' );
% 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);
disp( 'ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' );
% 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));
disp( 'ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' );
% 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));
% -% PLOT THE TRAJECTORY OF ELECTRON
% -figure(1)
XMax = 5 ; XMin = -XMax;
YMax = XMax ; YMin = -YMax;
ZMax = 20 ; ZMin = -20;
fplot3(h1,h2,h3,[0 50], '-' , 'LineWidth' ,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' ,10);
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 108
4 Results and discussion
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 119
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 1210
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 1311
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 1412
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 1513
Downloaded by hong chinh (vuchinhhp5@gmail.com)
Trang 1614
5 Conclusion
The project has completed plot the trajectory of electron in static electromagnetic field problem using MATLAB symbolic calculation With this tool we can plot more complex situations that cannot be plotted by the analytical method The trajectory is calculated by computationally solving differential equations The direction and magnitude of magnetic and electric field can be changed along with other attributes of motion
References
1) General Physics A1, General Physics Exercises A1
2) “Motion of Charged particle in E and B” YouTube, uploaded by For the Love of Physics, 5th May, 2019,
Downloaded by hong chinh (vuchinhhp5@gmail.com)