Motion of an electron in a Magentic Field

Click For Summary
SUMMARY

The discussion focuses on plotting the motion of an electron in a magnetic field using MATLAB. The user attempted to model the motion with the equations derived from the Lorentz force law, specifically F = q(v × B), but observed a spiral trajectory instead of the expected circular motion. The equations implemented include updates for velocity and position in both x and y directions, indicating potential integration errors as the cause of the spiral path. The user seeks guidance to correct the simulation for accurate circular motion.

PREREQUISITES
  • Understanding of the Lorentz force law (F = q(v × B))
  • Familiarity with MATLAB programming for simulations
  • Knowledge of numerical integration techniques
  • Basic concepts of circular motion in magnetic fields
NEXT STEPS
  • Review MATLAB's numerical integration methods, such as ode45
  • Learn about the effects of time step size on simulation accuracy
  • Study the principles of circular motion in magnetic fields
  • Explore error analysis techniques for numerical simulations
USEFUL FOR

Students and educators in physics, engineers working with electromagnetic systems, and anyone interested in simulating particle motion in magnetic fields using MATLAB.

Wiseman101
Messages
8
Reaction score
0

Homework Statement


Plot the motion of an electron in the x-y plane due to a magnetic field in the z plane. The initial position is at the origin. The initial velocity can be chosen at will.

Homework Equations


F = q(vXB)

The Attempt at a Solution


The program I am using is Matlab. I tried plotting the motion using the following set of equations, but the motion was a spiral, not circular. Any pointers in the right direction would be much appreciated!
(Vx is the velocity in the x direction, x is the position, etc..)

w=q/m

Vx(i+1) = Vx(i) + w*(Vy(i)*B)*dt
x(i+1) = x(i) + Vx(i)*dt

Vy(i+1) = Vy(i) + w*( -Vx(i)*B)*dt
y(i+1) = y(i) + Vy(i)*dt
 
Physics news on Phys.org
It's probably spiral in MATLAB because of integration errors. It seems you think that the motion has to be circular because a magnetic field always applies a force perpendicular to the electron's motion, and you'd be right.
 
Well as long as my equations are right then that's ok:smile:
 

Similar threads

Replies
11
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 29 ·
Replies
29
Views
10K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K