Michael-MD / Particle-Simulation

Simulation of particle motion due to electric and magnetic fields

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Particle in electric and magnetic fields Simulation

Simulation of particle motion due to electric and magnetic fields

Simulates particle motion using numerical runge-kutta method, more specifically Heun's method by solving the lorentz force equaiton in all directions and plotting the results. The electric and magnetic fields are set as constants in each direction but this can be changed by changing the functons for each named E and B respectively. The step size needs to also be manually set, I found that for cyclic motion the step size needs to be much smaller than say cyloid motion, sometimes even two orders of magnitude. I have a preloaded example but the parameters can be changed from there to whatever you want. It should also be noted that everything is in cartesian coordinates and will need to be converted to such appropriately where necessary. I would recommend for a bit of fun to recreate popular experiments such as JJ Thomson's experment in determing the charge to mass ratio by selecting a q/m, for example q/m = 19 and attempting to determine it by adjusting the magnetic and electric fields. This was written by myself and is open source for anyone to use, I would appreciate it if you let me know first via email at mdei0001@student.monash.edu.

About

Simulation of particle motion due to electric and magnetic fields


Languages

Language:Python 100.0%