| Hosted by CoCalc | Download
1
\documentclass[a4paper]{article}
2
3
%% Language and font encodings
4
\usepackage[english]{babel}
5
\usepackage[utf8x]{inputenc}
6
\usepackage[T1]{fontenc}
7
8
%% Sets page size and margins
9
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
10
11
%% Useful packages
12
\usepackage{amsmath}
13
\usepackage{graphicx}
14
\usepackage[colorinlistoftodos]{todonotes}
15
\usepackage[colorlinks=true, allcolors=blue]{hyperref}
16
\usepackage{siunitx}
17
%\usepackage{float}
18
\usepackage{subcaption}
19
\usepackage{floatrow}
20
% Table float box with bottom caption, box width adjusted to content
21
\newfloatcommand{capbtabbox}{table}[][\FBwidth]
22
\usepackage{blindtext}
23
\usepackage{esvect}
24
25
\title{Simulating Charged Particles in Magnetic Fields}
26
\author{Crystal Burgos, Ryan Culhane, Sara Idris}
27
28
29
\begin{document}
30
\maketitle
31
32
\section{Abstract}
33
This investigation set out to develop a Python program that could model the motion of multiple particles in an arbitrary magnetic field. The code we created uses Euler's method, along with necessary initial values and physical quantities, to approximate the motion of each particle for a set step size and number of iterations. The program we developed then plots the motion of each particle in the magnetic field, taking into account the electric forces between each particle.
34
\section{Introduction}
35
36
37
\subsection{Magnetic Fields}
38
Charges moving in a magnetic field will experience a force given by the relation below:
39
$$ F = q \vec{v} \times \vec{B}$$
40
where q is the charge of the particle, $\vec{v}$ is the velocity and $\vec{B}$ is the magnetic field vector.
41
\\ \\
42
This implies that if the particle is moving in the same direction as the magnetic field, there is no force exhibited on the particle. As the angle between the velocity vector and the magnetic field vector increases from \ang{0} to \ang{90}, the magnitude of the force exerted on the particle increases. By the nature of the cross product, the force is always perpendicular to both the magnetic field and the velocity of the particle.
43
\subsection{Electric Forces}
44
Coulomb's Law states that two charged particles exert an equal and opposite force on one another that is proportional to the charge on each particle and inversely proportional to the distance between particles squared. Furthermore, the force acts along the line connecting the two particles and is attractive if the charges are of opposite sign and repulsive if the charges are of the same sign. Symbolically, Coulomb's Law can be expressed as:
45
46
$$ \vv{F} = \frac{k_e q_1 q_2}{r^3}\vv{r} $$
47
where $k_e$ is the electrostatic constant, $q_1$ is the charge of one of the particles, $q_2$ is the charge of the other particle, and $\vv{r}$ is the vector from the first particle to the second and $r$ is its magnitude. Furthermore, electrostatic interactions obey the Law of Superposition and the net electric force on a particle is simply the sum of the forces exerted on that particle by all the other particles in the system.
48
49
\subsection{Euler's Method}
50
% use a table and do a step by step process
51
Euler's method is a mathematical process that allows us to approximate the value of functions using only the derivative and the initial conditions of the function. If the first derivative is known, then one can approximate the value of the function by assuming the slope is constant for a small step $\delta t$. At the initial value of the function $(x_0,y_0)$, the function will have a slope $f'(x_0,y_0)$, and the new $y$ position will be the product of the slope and the time step. At $x = x_0 + \delta t$ the slope can also be approximated as $f'(x_0+\delta t,y_0+\delta tf'(x_0,y_0))$ and the process can be repeated after each additional time step.
52
For example, let us use $f'(x,y)=y-x$ with the initial condition $y(0)=2$, time step $\delta t=1$, and interval $[0,5]$ to model the process. The initial set up is shown below:
53
\begin{table}[H]
54
\begin{center}
55
\caption{One Step of Euler's Method for $f'(x,y)=y-x$}
56
\begin{tabular}{c|c|c|c|c}
57
$t$ & $x_t$ & $y_t$ & $f'(x_t,y_t)$ & $rise_t$ \\
58
\hline
59
0 & 0 & 2 & 2 & 2 \\
60
1 & 1 & 4 & & \\
61
\end{tabular}
62
\end{center}
63
\end{table}
64
To fill Table 1, we first start at the initial condition where $x_0 = 0$ and $y_0 = 2$. At this point, the slope is $2-0=2$. The rise is the product of the slope and the step size, or $f'(0,2)*\delta t$, which is $2*1=2$. Then we can calculate $(x_1,y_1)$ by first adding the step size to $x_0$, which is $0+1=1$. To find $y_1$ we add $rise_0$ to $y_0$, or add $2+2=4$. Now we can repeat this process until we reach the end of the interval over which we want to approximate the function.
65
\begin{table}[H]
66
\begin{center}
67
\caption{Euler's Method for $f'(x,y)=y-x$ On [0,5] with step size 1}
68
\begin{tabular}{c|c|c|c|c}
69
$t$ & $x_t$ & $y_t$ & $f'(x_t,y_t)$ & $rise_t$ \\
70
\hline
71
0 & 0 & 2 & 2 & 2 \\
72
1 & 1 & 4 & 3 & 3 \\
73
2 & 2 & 7 & 5 & 5 \\
74
3 & 3 & 12 & 9 & 9 \\
75
4 & 4 & 21 & 17 & 17 \\
76
5 & 5 & 38 & 33 & 33 \\
77
\end{tabular}
78
\end{center}
79
\end{table}
80
81
82
Although Euler's method can only be used as an approximation, as the time step decreases, the approximation becomes more accurate. This algorithm is useful because it allows us to approximate the value of a function over an interval using only the initial conditions and the derivatives of the function.
83
\\ \\
84
In our investigation, given the initial charges, masses, positions, velocities, and a function for the magnetic field, we can find the acceleration of the particle and use the Euler method to model its motion.
85
86
\section{Implementation}
87
\subsection{Overview}
88
%3 sentences summarizing what the code does
89
Our goal was to plot the motion of charged particles as they travel through a magnetic field and interact with each other. Below is a flow chart that diagrams our process.
90
\begin{figure}[H]
91
\begin{center}
92
Figure 1: Flow Chart of Coding Process
93
\includegraphics[width=0.8\textwidth]{newflchart.png}
94
\caption{Flow chart that illustrates the process by which we created our code.}
95
\end{center}
96
\end{figure}
97
% add block code and separate the paragraphs by block
98
The specifics of each step of this flow chart are outlined below.
99
\subsection{Particle Class}
100
To organize the particles in the field and our initial conditions, we created a class for our particles where we stored the initial x, y, and z positions as arrays, the velocities in the x, y, and z directions as arrays, the mass as a float, and the charge of the particle as a float.
101
102
\subsection{Magnetic Field Function}
103
After defining the initial conditions, we created a function that defined the x, y, and z components of the magnetic field as functions of a particle's position. We stored these components in numpy arrays.
104
\subsection{Electric Force Function}
105
We also defined a function that uses the positions of each particle as well as their charge to calculate the total electric force exerted on each particle by all the other charges in the system. Again, we stored the electric force components in numpy arrays.
106
\subsection{Force Function}
107
Then, we defined a function that calculated the force on the particle using the magnetic field function, and the particle's velocity and charge to compute the force due to the field and then added the electric and magnetic forces component-wise to find the total force on the particle.
108
\subsection{Acceleration Function}
109
Next, we created a function that determined the acceleration of the particle from the total force, the mass of the particle, and Newton's Second Law.
110
\subsection{Euler Method Implementation}
111
Then we defined a new function that performed one step in Euler's method by using kinematic equations to find the new x, y, and z positions using the acceleration for the corresponding direction and a time step of 0.0005. The new positions were then appended to the position arrays defined in each particle so we could keep track of the particle's position at each time. The same method was used to find the new velocities in the x, y, and z directions and update the velocity arrays.
112
\subsection{Plotting}
113
Afterwards, we created a for loop that would perform the one step Euler function 10,000 times, storing the particle's position, velocity, and acceleration at each step. We also used this function to plot the particle's motion on a 3D plot.
114
\subsection{Calibration}
115
Due to the computational resolution of Python, we could not model the mass and charges of our particles to be like that of elementary charges like electrons. Because these quantities are so small, (on the order of $10^{-31}$ and $10^{-19}$, respectively), many of our calculations get rounded to 0 or would approach infinity too quickly. As a result, we chose to keep our charges and masses on the order of $10^{-3}$ to $10^{-2}$ in magnitude. This way, our parameters are small enough, but not so small that we cannot detect noticeable changes. We also scaled the electric constant $k_e$ to 1000 for the same reason. Similarly, we used a time step t=0.0005 and repeated Euler's method 10,000 times in order to avoid making our position and velocity values too large, or cause the program to run for too long. Due to our rather arbitrary assignment of these variables, we have not included units in our reported masses and charges, but calculations were carried our assuming the values we report later are in SI units..
116
117
\section{Results}
118
To test our code we plotted the motion of the particle in 3 fields where we knew the expected motion of the particle.
119
\subsection{Particles in Zero Magnetic Field}
120
In the first case, we plotted the motion of three charged particles in zero magnetic field, neglecting the electric field. In this case, we expected the motion of the particle to be straight line since there was no field to exert a force on the particle.
121
\newpage
122
\begin{center}
123
Linear Motion in Zero Magnetic Field
124
\end{center}
125
\begin{figure}[H]
126
\begin{floatrow}
127
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{zerobonly.png}}{
128
\caption{Linear motion of 3 particles in a magnetic field of 0.}}\qquad%
129
\capbtabbox{%
130
\begin{tabular}{c|c}
131
Physical Quantity & Initial Value \\ \hline
132
Charge 1 & $1 \times 10^{-3}$ \\
133
Mass 1 & $1 \times 10^{-3}$ \\
134
$\vv{x}_0 $ 1 (Position Vector) & (2,0,0)\\
135
$\vv{v}_0 $ 1 (Velocity Vector) & (0,1,0)\\ \hline
136
Charge 2 & $1 \times 10^{-3}$ \\
137
Mass 2 & $1 \times 10^{-3}$ \\
138
$\vv{x}_0 $ 2 (Position Vector) & (1,1,1)\\
139
$\vv{v}_0 $ 2 (Velocity Vector) & (1,0,0)\\ \hline
140
Charge 3 & $1 \times 10^{-3}$ \\
141
Mass 3 & $1 \times 10^{-3}$ \\
142
$\vv{x}_0 $ 3 (Position Vector) & (2,2,2) \\
143
$\vv{v}_0 $ 3 (Velocity Vector) & (1,0,0) \\
144
$\vv{B}(x,y,z)$ & (0,0,0) \\
145
146
\end{tabular}
147
}{%
148
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
149
}
150
\end{floatrow}
151
\end{figure}
152
153
As expected, the three particles move linearly, suggesting our program passes this test case.
154
155
\subsection{Uniform Circular Motion in Uniform Magnetic Field}
156
In this case, we plotted the motion of a particle in a uniform magnetic field with a velocity perpendicular to that of the magnetic field. The expected trajectory is circular motion because the magnetic field and velocity are perpendicular, so the force exerted by the field only changes the direction, not the magnitude of velocity.
157
\begin{center}
158
Uniform Circular Motion in Uniform Magnetic Field
159
\end{center}
160
\begin{figure}[H]
161
\begin{floatrow}
162
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{byisfivebonly.png}}{
163
\caption{Circular motion of a charged particle moving with a velocity perpendicular to a uniform magnetic field.}}\qquad%
164
\capbtabbox{%
165
\begin{tabular}{c|c}
166
Physical Quantity & Initial Value \\ \hline
167
Charge & $1 \times 10^{-3}$ \\
168
Mass & $1 \times 10^{-3}$ \\
169
$\vv{x}_0 $ (Position Vector) & (2,0,0) \\
170
$\vv{v}_0 $ (Velocity Vector) & (2,0,0)\\
171
$\vv{B}(x,y,z)$ & (0,5,0) \\
172
\end{tabular}
173
}{%
174
\caption{Initial conditions of the particle and the magnetic field vector in the case to the left.}%
175
}
176
\end{floatrow}
177
\end{figure}
178
179
Again, our program performed as expected. Interestingly, the particle does not trace the exact same circular path, which is a clear indication of the discrete nature of the Euler method and the somewhat limited resolution of our program.
180
181
\subsection{Spiral in Uniform Magnetic Field}
182
In this case we plotted the motion of a charged particle in a uniform magnetic field with one perpendicular component of velocity and one other component of velocity in the same direction as that of the magnetic field. The expected motion is a spiral because one component of velocity is perpendicular to the field so the particle should move in a circle, but the component of velocity in the other direction is unchanged by the magnetic field. Therefore, the particle should move in a circle in one plane and in a line in another plane, creating a spiral shape of motion.
183
\begin{center}
184
Spiral in Uniform Magnetic Field
185
\end{center}
186
\begin{figure}[H]
187
\begin{floatrow}
188
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{spiralbonly.png}}{
189
\caption{Spiral motion of a charged particle in a uniform magnetic field moving with one component of velocity perpendicular to the field and another component in the same direction as the field.}}\qquad%
190
\capbtabbox{%
191
\begin{tabular}{c|c}
192
Physical Quantity & Initial Value \\ \hline
193
Charge & $1 \times 10^{-3}$ \\
194
Mass & $1 \times 10^{-3}$ \\
195
$\vv{x}_0 $ (Position Vector) & (2,0,0) \\
196
$\vv{v}_0 $ (Velocity Vector) & (2,1,0) \\
197
$\vv{B}(x,y,z)$ & (0,5,0) \\
198
199
\end{tabular}
200
}{%
201
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
202
}
203
\end{floatrow}
204
\end{figure}
205
206
% use two different viewpoints and present them side by side
207
% maybe also plot the electric field and magnetic field for each corresponding motion plot
208
% do 3-4 cases with 3 plots for each case
209
% provide a case that shows we know it works; show a particle moving in a field perpendicular to its velocity
210
211
212
\subsection{Particles in Non-Uniform Magnetic Field}
213
Seeing as our code passed the three test cases (neglecting the effects of electric forces), we decided to model particles' motion in more complex, non-uniform fields.
214
\\ \\
215
In the first case of non-uniform magnetic fields, we plotted the motion of two charged particles in a magnetic field where each component of the field depended on two of the position components. The electric forces between the particles are not accounted for in this plot.
216
\begin{center}
217
First Case in Non-Uniform Magnetic Field
218
\end{center}
219
\begin{figure}[H]
220
\begin{floatrow}
221
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{nonuniformbfieldBonly.png}}{
222
\caption{The first case of the motion of two charged particles in a non-uniform magnetic field.}}\qquad%
223
\capbtabbox{%
224
\begin{tabular}{c|c}
225
Physical Quantity & Initial Value \\ \hline
226
Charge 1 & $1 \times 10^{-3}$ \\
227
Mass 1 & $1 \times 10^{-3}$ \\
228
$\vv{x}_0 $ (Position Vector) 1 & (0,0,0)\\
229
$\vv{v}_0 $ (Velocity Vector) 1 & (0,1,0)\\ \hline
230
Charge 2 & $1 \times 10^{-3}$ \\
231
Mass 2 & $1 \times 10^{-3}$ \\
232
$\vv{x}_0 $ (Position Vector) 2 & (4,0,0)\\
233
$\vv{v}_0 $ (Velocity Vector) 2 & (1,-1,2)\\
234
$\vv{B}(x,y,z)$ & ($x-y$,$x-z$,$z-x$)\\
235
\end{tabular}
236
}{%
237
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
238
}
239
\end{floatrow}
240
\end{figure}
241
242
The second case of a particle moving in a non-uniform magnetic field is the case of a particle in a field where the z-component is constant, but the other two components of the field depend on two components of the position vector.
243
\begin{center}
244
Second Case in Non-Uniform Magnetic Field
245
\end{center}
246
\begin{figure}[H]
247
\begin{floatrow}
248
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{nonuniformbfield2Bonly.png}}{
249
\caption{Second case of the motion of a charged particle in a non-uniform magnetic field.}}\qquad%
250
\capbtabbox{%
251
\begin{tabular}{c|c}
252
Physical Quantity & Initial Value \\ \hline
253
Charge & $1 \times 10^{-3}$ \\
254
Mass & $1 \times 10^{-3}$ \\
255
$\vv{x}_0 $ (Position Vector) & (3,0,5)\\
256
$\vv{v}_0 $ (Velocity Vector) & (2,1,3) \\
257
$\vv{B}(x,y,z)$ & ($4x-3y$,$\frac{x}{z}$,$3$)\\
258
\end{tabular}
259
}{%
260
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
261
}
262
\end{floatrow}
263
\end{figure}
264
265
In the third case, a charged particle moves in a magnetic field always dependent on the position of the particle.
266
\begin{center}
267
Third Case in Non-Uniform Magnetic Field
268
\end{center}
269
\begin{figure}[H]
270
\begin{floatrow}
271
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{nonuniformbfield3Bonly.png}}{
272
\caption{Third case of the motion of a particle in a non-uniform magnetic field.}}\qquad%
273
\capbtabbox{%
274
\begin{tabular}{c|c}
275
Physical Quantity & Initial Value \\ \hline
276
Charge & $1 \times 10^{-3}$ \\
277
Mass & $1 \times 10^{-3}$ \\
278
$\vv{x}_0 $ (Position Vector) & (4,4,5) \\
279
$\vv{v}_0 $ (Velocity Vector) & (4,1,2)\\
280
$\vv{B}(x,y,z)$ & ($x^{\frac{1}{2}}$,$3+x-y-z$,$y-2$)\\
281
\end{tabular}
282
}{%
283
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
284
}
285
\end{floatrow}
286
\end{figure}
287
The computational technique of Euler's method allows us to model the motion of particles in non-uniform, more complicated magnetic fields to the resolution of time steps of 0.0005.
288
289
\subsection{Multiple Particles in a Magnetic Field Affected by Electric Forces}
290
Now that we are confident in our ability to model particles' motion in magnetic fields, we chose to incorporate the interactions via the electric force that have an effect on the particles' motion.
291
\\ \\
292
In the first case, we observe the motion of two particles moving in a uniform magnetic field with and without accounting for the electric forces between the charges themselves.
293
\\ \\
294
Figure 8 below demonstrates the motion of the two particles in a uniform magnetic field without accounting for the electric forces between them.
295
\begin{center}
296
First Case in Uniform Magnetic Field Without Electric Forces
297
\end{center}
298
\begin{figure}[H]
299
\begin{floatrow}
300
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{nonuniformbfield4bonly.png}}{
301
\caption{The first case of the motion of two charged particles in a uniform magnetic field without accounting for the electric forces between them.}}\qquad%
302
\capbtabbox{%
303
\begin{tabular}{c|c}
304
Physical Quantity & Initial Value \\ \hline
305
Charge 1 & $1 \times 10^{-2}$ \\
306
Mass 1 & $1 \times 10^{-2}$ \\
307
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
308
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
309
Charge 2 & $1 \times 10^{-2}$ \\
310
Mass 2 & $1 \times 10^{-2}$ \\
311
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
312
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,1)\\
313
$\vv{B}(x,y,z)$ & (0,5,0)\\
314
\end{tabular}
315
}{%
316
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
317
}
318
\end{floatrow}
319
\end{figure}
320
Figure 9 below demonstrates the motion of the two particles in a uniform magnetic field after accounting for the electric forces between them. The effect of the electric forces are evident when you observe the changes in the y-axis intervals. Before accounting for the electric forces, the y-axis interval is [0,5] while after it is [0,30].
321
\begin{center}
322
First Case in Uniform Magnetic Field With Electric Forces
323
\end{center}
324
\begin{figure}[H]
325
\begin{floatrow}
326
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{nonuniformbfield4bande.png}}{
327
\caption{The first case of the motion of two charged particles in a uniform magnetic field after accounting for the electric forces between them.}}\qquad%
328
\capbtabbox{%
329
\begin{tabular}{c|c}
330
Physical Quantity & Initial Value \\ \hline
331
Charge 1 & $1 \times 10^{-3}$ \\
332
Mass 1 & $1 \times 10^{-3}$ \\
333
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
334
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
335
Charge 2 & $1 \times 10^{-3}$ \\
336
Mass 2 & $1 \times 10^{-3}$ \\
337
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
338
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,1)\\
339
$\vv{B}(x,y,z)$ & (0,5,0)\\
340
\end{tabular}
341
}{%
342
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
343
}
344
\end{floatrow}
345
\end{figure}
346
347
In the second case, we plot the motion of three charged particles in a uniform magnetic field.
348
\\ \\
349
The plot of the motion of the particles before accounting for the electric forces is shown in Figure 10.
350
\newpage
351
\begin{center}
352
Second Case in Uniform Magnetic Field Without Electric Forces
353
\end{center}
354
\begin{figure}[H]
355
\begin{floatrow}
356
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{uniformbfield5bonly.png}}{
357
\caption{The second case of the motion of two charged particles in a uniform magnetic field before accounting for the electric forces between them.}}\qquad%
358
\capbtabbox{%
359
\begin{tabular}{c|c}
360
Physical Quantity & Initial Value \\ \hline
361
Charge 1 & $1 \times 10^{-2}$ \\
362
Mass 1 & $1 \times 10^{-3}$ \\
363
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
364
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
365
Charge 2 & $1 \times 10^{-2}$ \\
366
Mass 2 & $1 \times 10^{-3}$ \\
367
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
368
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,2)\\ \hline
369
Charge 3 & $-1 \times 10^{-2}$ \\
370
Mass 3 & $1 \times 10^{-3}$ \\
371
$\vv{x}_0 $ (Position Vector) 3 & (-5,2,6)\\
372
$\vv{v}_0 $ (Velocity Vector) 3 & (1,0,1)\\
373
$\vv{B}(x,y,z)$ & (2,5,-3)\\
374
\end{tabular}
375
}{%
376
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left. Note that charge 3 is negative.}%
377
}
378
\end{floatrow}
379
\end{figure}
380
The plot of the motion of the three particles after accounting for the electric forces is shown in Figure 11.
381
\begin{center}
382
Second Case in Uniform Magnetic Field With Electric Forces
383
\end{center}
384
\begin{figure}[H]
385
\begin{floatrow}
386
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{uniformbfield5bande.png}}{
387
\caption{The second case of the motion of two charged particles in a uniform magnetic field after accounting for the electric forces between them.}}\qquad%
388
\capbtabbox{%
389
\begin{tabular}{c|c}
390
Physical Quantity & Initial Value \\ \hline
391
Charge 1 & $1 \times 10^{-2}$ \\
392
Mass 1 & $1 \times 10^{-3}$ \\
393
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
394
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
395
Charge 2 & $1 \times 10^{-2}$ \\
396
Mass 2 & $1 \times 10^{-3}$ \\
397
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
398
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,2)\\ \hline
399
Charge 3 & $-1 \times 10^{-2}$ \\
400
Mass 3 & $1 \times 10^{-3}$ \\
401
$\vv{x}_0 $ (Position Vector) 3 & (-5,2,6)\\
402
$\vv{v}_0 $ (Velocity Vector) 3 & (1,0,1)\\
403
$\vv{B}(x,y,z)$ & (2,5,-3)\\
404
\end{tabular}
405
}{%
406
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left.}%
407
}
408
\end{floatrow}
409
\end{figure}
410
In the third case, we plotted the motion of four particles, one of which had $\vv{0}$ initial velocity, in a uniform magnetic field before and after accounting for the electric forces between the particles. In the plot not accounting for the electric forces, it is expected that we will not see the charge that has initial velocity of $\vv{0}$ because it is not experiencing any force and according to Newton's First Law will just stay at rest.
411
\\ \\
412
Figure 12 shows the plot of motion of all four particles before accounting for the electric forces.
413
\newpage
414
\begin{center}
415
Third Case in Uniform Magnetic Field Without Electric Forces
416
\end{center}
417
\begin{figure}[H]
418
\begin{floatrow}
419
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{uniformbfield6bonly.png}}{
420
\caption{The third case of the motion of four charged particles in a uniform magnetic field before accounting for the electric forces between them. Note that charge 4 cannot be seen because it does not move.}}\qquad%
421
\capbtabbox{%
422
\begin{tabular}{c|c}
423
Physical Quantity & Initial Value \\ \hline
424
Charge 1 & $1 \times 10^{-2}$ \\
425
Mass 1 & $1 \times 10^{-3}$ \\
426
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
427
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
428
Charge 2 & $1 \times 10^{-2}$ \\
429
Mass 2 & $1 \times 10^{-3}$ \\
430
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
431
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,2)\\ \hline
432
Charge 3 & $-1 \times 10^{-2}$ \\
433
Mass 3 & $1 \times 10^{-3}$ \\
434
$\vv{x}_0 $ (Position Vector) 3 & (-5,2,6)\\
435
$\vv{v}_0 $ (Velocity Vector) 3 & (1,0,1)\\ \hline
436
Charge 4 & $-1.2 \times 10^{-2}$ \\
437
Mass 4 & $1 \times 10^{-3}$ \\
438
$\vv{x}_0 $ (Position Vector) 4 & (-1,1,3)\\
439
$\vv{v}_0 $ (Velocity Vector) 4 & (0,0,0)\\
440
$\vv{B}(x,y,z)$ & (2,5,-3)\\
441
\end{tabular}
442
}{%
443
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left. Note that charge 4 has a negative charge 1.2 times greater than the other charges and no initial velocity.}%
444
}
445
\end{floatrow}
446
\end{figure}
447
Figure 13 shows the motion of the particles after accounting for the electric forces.
448
\begin{center}
449
Third Case in Uniform Magnetic Field With Electric Forces
450
\end{center}
451
\begin{figure}[H]
452
\begin{floatrow}
453
\ffigbox[9cm]{\includegraphics[width=9cm,height=6cm]{uniformbfield6bande.png}}{
454
\caption{The third case of the motion of four charged particles in a uniform magnetic field after accounting for the electric forces between them. Note the slight motion of charge 4 (in red) that was absent from figure 12.}}\qquad%
455
\capbtabbox{%
456
\begin{tabular}{c|c}
457
Physical Quantity & Initial Value \\ \hline
458
Charge 1 & $1 \times 10^{-2}$ \\
459
Mass 1 & $1 \times 10^{-3}$ \\
460
$\vv{x}_0 $ (Position Vector) 1 & (2,0,0)\\
461
$\vv{v}_0 $ (Velocity Vector) 1 & (2,1,0)\\ \hline
462
Charge 2 & $1 \times 10^{-2}$ \\
463
Mass 2 & $1 \times 10^{-3}$ \\
464
$\vv{x}_0 $ (Position Vector) 2 & (2,0,3)\\
465
$\vv{v}_0 $ (Velocity Vector) 2 & (1,0,2)\\ \hline
466
Charge 3 & $-1 \times 10^{-2}$ \\
467
Mass 3 & $1 \times 10^{-3}$ \\
468
$\vv{x}_0 $ (Position Vector) 3 & (-5,2,6)\\
469
$\vv{v}_0 $ (Velocity Vector) 3 & (1,0,1)\\ \hline
470
Charge 4 & $-1.2 \times 10^{-2}$ \\
471
Mass 4 & $1 \times 10^{-3}$ \\
472
$\vv{x}_0 $ (Position Vector) 4 & (-1,1,3)\\
473
$\vv{v}_0 $ (Velocity Vector) 4 & (0,0,0)\\
474
$\vv{B}(x,y,z)$ & (2,5,-3)\\
475
\end{tabular}
476
}{%
477
\caption{Initial conditions of each particle and the magnetic field vector in the case to the left. Note that charge 4 has a negative charge 1.2 times greater than that of the other charges and has no initial velocity.}%
478
}
479
\end{floatrow}
480
\end{figure}
481
Since charge 4 is experiencing only an electric force at first, it begins to move and once it has a velocity, it also begins to experience a magnetic force. When you compare Figure 13 to Figure 12, it can also be seen that charge 4 attracts charges 1 and 2, but repels charge 3 as expected.
482
\section{Conclusion}
483
%% next steps: really small t, a different numerical integration method, B as a function of time, and electric field
484
The code we created in Python allowed us to model the motion of a charged particle in different magnetic fields and even allowed us to plot the motion of multiple particles in varying magnetic fields while also accounting for the electric forces between the particles. Nonetheless, there were still limitations to our code.
485
\\ \\
486
For instance, because of the computational resolution of Python, we could not plot the motion of particles with very small time steps less than 0.0001, a detail that could make our plots much more accurate. This effect can be seen in Figure 3 where the motion is not perfectly circular and does not trace the exact same path, as should be expected. As the time step approaches 0, the path should become more circular. In addition, we could use a different method of numerical integration instead of Euler's method. Methods like Runge-Kutta, for example, could enhance our code's accuracy in approximating the particles' motion. In future investigations this may be a worthy option to pursue but for this investigation we decided it was better to use a method we were already familiar with to aid the implementation process and allow us to incorporate the electric force effects.
487
\\ \\
488
We also were limited, due to time constraints, to plotting the motion of charged particles in magnetic fields that were uniform or dependent only on position. However, it could be interesting to plot the motion of charged particles in time-varying magnetic. We also only accounted for the electric forces between the particles in our field, but it could be useful to be able to plot the motion of multiple charged particles in both a magnetic and electric field.
489
\\ \\
490
Other limitations of our model include how it handles collisions and short range interactions. If we set two particles with opposite charges to collide with one another by giving them zero initial velocity, they keep moving past each other instead of colliding and coming to a stop as would be expected in such a symmetric situation.
491
492
493
\end{document}
494
495