Combining Electric and Magnetic Forces: Difference between revisions

From Physics Book
Jump to navigation Jump to search
Added tested public interactive model link and light-mode source; simplified captions and coding connection while retaining original-source attribution.
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Claimed by Luis Pimentel Fall 2018
<big>'''Evan Littlejohn — Fall 2026'''</big>
Edited the Velocity Selector section. Went into more detail about why this works and created a VPython trinket demonstrating and visualizing a velocity selector for particles.


Though the pattern in which electric and magnetic forces interact with particles is observably different, their effects can be quantitatively be compared. The principle of adding the two functions of force as a net force is one that now serves as a fundamental principle of electromagnetics. It serves as a building block for many important Laws such as [[Hall Effect]] and  [[Motional Emf]].
'''Combining electric and magnetic forces''' means adding two vector forces acting on the same charged particle. The electric force depends on charge and electric field; the magnetic force also depends on the particle's velocity. Together they explain how a beam can bend, gain or lose kinetic energy, or pass straight through a velocity selector.


==The Main Idea==
== The Main Idea ==


If a charged particle within an electric field is moving in a magnetic field, the particle is subject to an [[Electric Force]] and a [[Magnetic Force]]. The net force on the particle is called the [[Lorentz Force]], which is the sum of electric and magnetic forces.
Imagine a positive particle moving to the right between two charged plates. The lower plate is positive and the upper plate is negative, so the electric field points upward. A magnetic field pointing out of the page gives this moving positive particle a downward magnetic force. At the right entry speed, the forces cancel. A slower or faster particle initially bends away from the centerline.


===A Mathematical Model===
Matching force magnitudes is only half the check: '''do the force vectors point in opposite directions?''' Check the force directions before setting their magnitudes equal.


====Electric Forces====
[[File:EL_F26_selector-directions.png|center|alt=Positive particle travels right; the electric force points up and the magnetic force points down. Magnetic field points out of the page.]]


[[File:ElectricForces.jpg|thumb| '''Figure 1.''' An electric force acts in a pattern parallel to the electric field, pointing radially inward or outward of a particle. The direction depends on the signs of the interacting charged particles. ]]
''Figure 1. Force directions for a positive charge entering along +x with E along +y and B along +z. Equal arrow lengths illustrate the selected speed. This is a schematic, not a drawing to scale. Original diagram created for this revision; no external image reused.''


• A particle being acted upon by an electric force will move in a straight line, in the path, or negative path depending on charge, of the the electric field line (See '''Figure 1''') .
=== A Mathematical Model ===


• Electric fields point in a direction radially outward/ inward of a charged particle. There are four possible scenarios for the interaction of 2 charged particles:
==== The Lorentz force and its assumptions ====


:1. A negatively charged particle (p1) is acting on a negatively charged particle (p2)
For charge <math>q</math> moving with velocity <math>\vec v</math> through prescribed external fields,
::- p2 feels force pointing radially outward from p2
:2. A positively charged particle (p1) is acting on a negatively charged particle (p2)
::- p2 feels force pointing radially inward toward p2
:3. A negatively charged particle (p1) is acting on a positively charged particle (p2)
::- p2 feels force pointing radially inward toward p1
:4. A positively charged particle (p1) is acting on a positively charged particle (p2)
::- p2 feels force pointing radially outward from p1


• The electric force formula: <math>\vec {F}_{E}=q\vec E </math>
<math>\vec F_E=q\vec E,\qquad \vec F_B=q\vec v\times\vec B,\qquad \frac{d\vec p}{dt}=q(\vec E+\vec v\times\vec B).</math>
:- Force on the observed particle is determined by the interaction of the charge of the observed particle and the electric field created by other charged particles.


====Magnetic Forces====
These are electromagnetic forces; add any other forces separately. Fields and velocity must be expressed in the same reference frame. Here <math>q</math> is signed, <math>\vec E</math> has units N/C or V/m, <math>\vec B</math> is measured in tesla, and <math>\vec v</math> is in m/s. For the same fields and velocity, changing the sign of the charge reverses each force.<ref name="MIT">MIT OpenCourseWare, 8.02T Electricity and Magnetism (Spring 2005), Chapter 8, especially sections 8.2, 8.5, and 8.6. [https://ocw.mit.edu/courses/8-02t-electricity-and-magnetism-spring-2005/90510e513af27a2dde30b890a61bbcd1_ch8magneti_field.pdf Magnetic Fields].</ref>


[[File:Magnetic Force Lines.jpg|thumb| '''Figure 2.''' Magnetic Fields follow a helical pattern ]]
For the low speeds used below, <math>\vec p\approx m\vec v</math>, so acceleration is force divided by mass. At relativistic speeds use <math>\vec p=\gamma m\vec v</math>, with <math>\gamma=1/\sqrt{1-v^2/c^2}</math>; the momentum form of the force law still applies.<ref name="relativity">OpenStax, University Physics Volume 3, section 5.8. [https://openstax.org/books/university-physics-volume-3/pages/5-8-relativistic-momentum Relativistic Momentum].</ref> All examples use speeds much less than <math>c=299792458\ \mathrm{m/s}</math>.<ref name="NIST">NIST, CODATA physical constants. [https://physics.nist.gov/cgi-bin/cuu/Value?c Speed of light in vacuum].</ref>
[[File:RightHandRule.jpg|thumb| '''Figure 3.''' Magnetic Force Right Hand Rule]]


• The magnetic force on a charged particle is orthogonal to the magnetic field.
==== A reliable direction check ====


• The particle must be moving with some velocity for a magnetic force to be present.
Compute the cross product before multiplying by signed charge:


• Particles move perpendicular to the magnetic field lines in a helical manner (See '''Figure 2''')
<math>\vec v\times\vec B=(v_yB_z-v_zB_y,\ v_zB_x-v_xB_z,\ v_xB_y-v_yB_x).</math>


• To find the magnetic force, you can use the Right Hand Rule as follows (See '''Figure 3'''):
The magnitude is <math>F_B=|q|vB\sin\theta</math>, where <math>\theta</math> is the angle between velocity and magnetic field. This equation alone does not give direction. In particular, motion parallel or antiparallel to the magnetic field produces zero magnetic force.


:1. Thumb in direction of the velocity
For this page, choose <math>\vec E=(0,E,0)</math> and <math>\vec B=(0,0,B)</math>, with positive <math>E</math> and <math>B</math>. The components become
:2. Fingers in the direction of the magnetic field
:3. Your palm will face in the direction of the Magnetic Force


• The magnetic force formula: <math> {\vec {F}_{M} = q\vec {v}\times\vec {B}} </math>
<math>F_x=qBv_y,\qquad F_y=q(E-Bv_x),\qquad F_z=0.</math>
:- q is the charge of the moving charge, including its sign
:- <math>\vec v</math> is the velocity of the moving charge
:- <math>\vec B</math> is the applied magnetic field, in Tesla
:- Note: if <math>\vec v</math> and <math>\vec B</math> are parallel to each other, <math> {\vec {F}_{M} = 0} </math> (<math> {\vec {A}\times\vec {B} = |\vec A||\vec B|sin(θ) = 0} </math>)


====Electric and Magnetic Forces Combined====
Initially <math>v_y=0</math>, so only the y component can be nonzero. Later, a deflected particle acquires <math>v_y</math>, and its x velocity changes too. Because the velocity changes, assuming constant transverse acceleration generally gives the wrong trajectory.
[[File:Velocity selector.gif|thumb| '''Figure 4.''' The electric field, magnetic field, and velocity vector are all perpendicular to each other  ]]


• The Lorentz Force formula:
==== Velocity selection ====
:<math> {\vec {F}_{net} = \vec {F}_{E} + \vec {F}_{M}} </math>
:<math> {\vec {F}_{net} = q\vec E + q\vec {v}\times\vec {B}} </math>


• When the net force is equal to zero, the velocity stays constant.
A nonzero charge travels straight at constant velocity in this selector when
:<math> {\vec {F}_{E} = \vec {F}_{M}} </math>
:<math> {q\vec E = q\vec {v}\times\vec {B}} </math>


As seen in '''Figure 4''' , when the net forces acting on a particle are balanced the electric field, magnetic field, and velocity vector are all perpendicular to each other. The electric and magnetic forces are equal but opposite. When forces are not balanced the trajectory of the the particle will change.  
<math>\vec F_E=-\vec F_B,\qquad \vec E+\vec v\times\vec B=0.</math>


The Lorentz Force calculation is now a fundamental principle of electromagnetism.
With entry velocity <math>\vec v=(v,0,0)</math>, <math>\hat x\times\hat z=-\hat y</math>. Therefore <math>q(E-vB)=0</math>, giving


===A Computational Model===
<math>v_{\mathrm{selected}}=\frac{E}{B}.</math>


Following are diagrams which display a uniform electric field in the +x direction and a uniform magnetic field in +y direction for a proton and an electron, with varying velocities.
The charge cancels, including its sign, and mass does not enter the force-balance condition. For the specified entry direction, a proton and an electron at the selected speed are both undeflected, although their trajectories away from balance differ because their charge-to-mass ratios differ.


The force equations and the right hand rule can both be used to determine the directions of the forces:
The geometry matters. Taking the dot product of the general zero-force equation with <math>\vec B</math> shows that <math>\vec E\cdot\vec B=0</math> is necessary. When <math>B\ne0</math> and the fields are perpendicular, the full family of force-free velocities is
:- According to <math> {\vec {F}_{E} = q\vec E} </math>, <math> {\vec {F}_{Eproton}} </math> points in the direction of <math> \vec E </math> and <math> {\vec {F}_{Eelectron}} </math> points in opposite direction of <math> \vec E </math>.
:- According to <math> {\vec {F}_{M} = q\vec {v}\times\vec {B}} </math>, <math> \vec {F}_{M} = 0 </math> when <math> \vec v </math> is parallel to <math> \vec B </math>. The direction of <math> \vec {F}_{M} </math> can be determined by the cross multiplication of <math> \vec v </math> and <math> \vec B </math> and by the sign of <math> q </math>.


<math>\vec v=\frac{\vec E\times\vec B}{B^2}+v_{\parallel}\hat B.</math>


• '''Proton at rest:'''
The parallel component contributes no magnetic force. Thus <math>E/B</math> is the selected total speed only when the beam is constrained to the transverse direction used here. The perpendicular term is also the guiding-center drift velocity in uniform crossed fields: it describes the steady motion of the center of the orbit. Particles with other initial velocities can gyrate around that moving center.<ref name="UT">Richard Fitzpatrick, University of Texas at Austin. [https://farside.ph.utexas.edu/teaching/336k/Newton/node30.html Charged Particle Motion in Electric and Magnetic Fields].</ref>
:[[File:protonr2.png]]
:- Direction of electric force: +x
:- Direction of magnetic force: no magnetic force


==== Which field changes kinetic energy? ====


• '''Proton moving in +x direction:'''
Dot the force with velocity:
:[[File:protonx2.png]]
:- Direction of electric force: +x
:- Direction of magnetic force: +z


<math>\frac{dK}{dt}=\vec F\cdot\vec v=q\vec E\cdot\vec v.</math>


• '''Proton moving in +y direction:'''
The magnetic term is zero because the magnetic force is perpendicular to the velocity. A magnetic field can turn a particle without directly changing its kinetic energy. In combined fields, kinetic energy can change through electric work. In the uniform electric field used here,
:[[File:protony.png]]
:- Direction of electric force: +x
:- Direction of magnetic force: no magnetic force


<math>K(t)-K(0)=qE[y(t)-y(0)].</math>


• '''Proton moving in +z direction:'''
This relation provides an independent numerical check: if a simulation predicts a large violation, inspect its signs, units, and timestep.
:[[File:protonz.png]]
:- Direction of electric force: +x
:- Direction of magnetic force: -x


=== A Computational Model ===


• '''Electron at rest:'''
'''[https://www.glowscript.org/#/user/evanlittlejohn/folder/MyPrograms/program/WikiVelocitySelectorF2026 Run the interactive velocity selector]'''. The model opens in Web VPython. This wiki currently does not support embedding it directly; the complete source is also provided below.
:[[File:electronr2.png]]
:- Direction of electric force: -x
:- Direction of magnetic force: no magnetic force


Three independent particles enter at 70, 100, and 130 km/s. Defaults are <math>E=2000\ \mathrm{V/m}</math>, <math>B=0.020\ \mathrm T</math>, proton mass, and an exit plane 0.100 m downstream. The default slit half-width is 2 mm. Each trajectory stops at that plane and is classified as passing or blocked. Displayed particle sizes are exaggerated.


• '''Electron moving in +x direction:'''
Fourth-order Runge–Kutta integration updates position and velocity together, recomputing the velocity-dependent force at intermediate stages. The model also refines the final integration step to locate the crossing of the exit plane.
:[[File:electronx.png]]
:- Direction of electric force:-x
:- Direction of magnetic force: -z


'''Investigate:''' predict the initial deflections, run the model, then reverse the charge and compare. Mass stays fixed, so the negative-charge case is not an electron. Adjust the slit '''half-width''' from 1 to 30 mm; the full opening is twice that value. A 2 mm half-width passes only the selected beam, 17 mm passes the selected and fast beams, and 25 mm passes all three. Changing the aperture reclassifies existing trajectories without changing their motion. To replay, click Reset, then Run. Field strengths and the three entry speeds stay fixed.


• '''Electron moving in +y direction:'''
[[File:EL_F26_selector-trajectories.png|center|alt=At the ten-centimeter exit, the slow positive particle is 24.4 millimeters above center, the selected particle stays centered, and the fast particle is 16.4 millimeters below center.]]
:[[File:electrony.png]]
:- Direction of electric force: -x
:- Direction of magnetic force: no magnetic force


''Figure 2. Exact trajectories independently calculated for the default positive-charge case. The slow beam exits above the slit, the matched beam at its center, and the fast beam below it. Horizontal and vertical axes use different units/scales. Original figure created for this revision.''


• '''Electron moving in +z direction:'''
'''Limits:''' uniform, static fields and nonrelativistic point particles; no fringing, collisions, interparticle forces, radiation reaction, or beam feedback on the fields. Plate collisions are omitted. The three default trajectories fit within the hypothetical ±30 mm plates in the difficult example. Real acceptance also depends on device geometry.
:[[File:electronz.png]]
:- Direction of electric force: -x
:- Direction of magnetic force: +x


==Examples==
The code is checked against exact trajectories, charge reversal, field-only limits, timestep convergence, and energy accounting. Readouts report the maximum current position error and energy residual <math>|\Delta K-qEy|/K_0</math> across the particles, using each particle's initial energy <math>K_0</math>. Small residuals indicate numerical consistency with the ideal model, not experimental accuracy.


[[File:EL_F26_work-energy-check.png|center|alt=The slow positive particle changes velocity while its kinetic-energy change matches electric work throughout the plotted interval.]]


===Simple===
''Figure 3. An independent diagnostic compares kinetic-energy change with electric work. The two curves overlap. This calculation maintains uniform fields for the entire plotted interval, without imposing an exit screen. Original figure created for this revision.''


A proton is moving with velocity 7e8 in the +x direction. The trajectory of the proton is constant. There is an electric field in the area of 3.6e7 in the +y direction. Calculate the direction and magnitude of the magnetic field acting on the particle?
== Examples ==


:''Solution:''
These original worked examples use SI units, signed charge, and prescribed external fields. Constants are <math>e=1.602176634\times10^{-19}\ \mathrm C</math> and <math>m_p=1.67262192595\times10^{-27}\ \mathrm{kg}</math>; round physical answers to the precision of the inputs. Extra digits are shown below to help compare calculations.
:Step 1: <math> {|q\vec E| = |q\vec v\vec B|} </math>
:Step 2: <math> {\vec {E} = \vec {v}\vec {B}} </math>
:Step 3: <math> {\vec {B} = \frac {\vec {E}} {\vec {v}} = \frac {3.6e7} {7e8}} </math>


:Answer: <math> {\vec {B} = 0.051 T} </math>
=== Simple ===


The magnetic field is in the +z direction.
'''Which speed passes straight through?''' A proton enters along +x with <math>\vec E=(0,2000,0)\ \mathrm{V/m}</math> and <math>\vec B=(0,0,0.020)\ \mathrm T</math>. Find its undeflected speed and decide whether an electron at the same velocity is also undeflected.


===Middling===
'''Solution.'''


At a particular instant, a proton is moving with velocity <0,5e5,0> m/s and an electron is moving with velocity <-4.2e2,0,0> m/s. The electron is located 1.4e-3 m below the proton (in the -y direction). Determine the net force on the electron due to the proton.
# Directions first: <math>\vec v\times\vec B=(0,-vB,0)</math>. For the proton, the electric force is upward and the magnetic force is downward.
# Set the net y force to zero: <math>q(E-vB)=0</math>.
# Divide by nonzero charge and solve: <math>v=2000/0.020=1.00\times10^5\ \mathrm{m/s}</math>.
# Check units: <math>(\mathrm{N/C})/[\mathrm{N\,s/(C\,m)}]=\mathrm{m/s}</math>.
# Check magnitudes: both forces have magnitude <math>3.20435\times10^{-16}\ \mathrm N</math>. Their directions are opposite.


:''Solution:''
For the electron, both forces reverse, so they still cancel. A proton entering at 70 km/s initially bends upward; one entering at 130 km/s initially bends downward. This answer concerns the specified beam direction, not arbitrary three-dimensional velocities.
:Step 1: <math> {\vec {F}_{net} = \vec {F}_{E} + \vec {F}_{B}} </math>
:Step 2: <math> {\vec {F}_{net} = \vec {F}_{E} + 0 = q\vec {E}} </math> (At the electron's location, <math> \vec B = 0 </math> because the velocity of the proton is parallel to <math> \hat{r} </math>)
:Step 3: <math> {\vec {E} = \frac {1} {4πεo} \frac {q} {r^2} \hat{r}} </math> (<math> \hat{r} = <0,-1,0> and r = 1.4e-3 m</math>)
:Step 4: <math> \vec E = <0,-7.35e-4,0> N/C </math>
:Step 5: <math> {\vec {F}_{net} = -e \vec E = <0,1.18e-22,0> N} </math>


===Difficult===
=== Middling ===
[[File:Middle_Example_A.jpg|thumb| '''Figure 5.''' Middle example diagram. ]]


A copper bar of length L and zero resistance slides at a constant velocity, v. There is a uniform magnetic field, B, directed into the page. A voltmeter is connected across a resistor, R, and reads ΔV. See '''Figure 5'''. Determine the direction of the magnetic force on the diagram and the current through the resistor. Your answer should be in terms of the given variables.
'''Find a vector force and instantaneous power.''' A particle has charge <math>q=-2e</math> and, at one instant,


[[File:Middle_Example_B.jpg|thumb| '''Figure 6.''' Middle example solution. ]]
<math>\vec v=(30000,40000,-10000)\ \mathrm{m/s},</math>


:''Solution:''
<math>\vec E=(600,-800,200)\ \mathrm{V/m},\qquad \vec B=(0.010,-0.020,0.030)\ \mathrm T.</math>
:Step 1: Direction of the Magnetic Force - Use right hand rule or <math> {\vec v \times\vec B} </math>. See '''Figure 6'''.
:Step 2: Current through the resistor -
::: <math> {ΔV}_{round trip} = 0 </math>
::: <math> {{ΔV}_{round trip} + motional emf - {ΔV}_{resistor} = 0} </math>
::: <math> motional emf = IR </math>
::: <math> I = \frac {motional emf} {R} </math>
::: <math> {|q\vec E| = |q\vec v\vec B|} </math>, <math> {|ΔV| = IR} </math>
::: <math> {qE = qvB} </math>
::: <math> E = vB </math>
::: <math> motional emf = |ΔV| = E*ΔL = vBL </math>
::: <math> {I = \frac {vBL} {R}} </math>


==Connectedness==
These fields differ from the selector defaults.


The Lorentz Force principle has been a component in many modern day inventions and critical building block for many physics principles. With known forces, we can predict the very important figure, the velocity and trajectory of a moving particle.
'''Solution.''' First evaluate the cross product:


===Applications===
<math>\vec v\times\vec B=(1000,-1000,-1000)\ \mathrm{V/m}.</math>


'''''Velocity Selector'''''
For example, its x component is <math>40000(0.030)-(-10000)(-0.020)=1000</math>. Now add the electric field, then multiply the entire vector by the signed charge:
[[File:Velocityselector2.png|thumb| '''Figure 7.''' Illustration of a Velocity Selector ]]


The Velocity Selector is a device used to filter particles based on their velocity. A Velocity Selector uses controlled, perpendicular, electric and magnetic fields to filter certain charged particles (See '''Figure 7''' ). These electric and magnetic fields exert a Lorentz force on the particle. For the particle to remain unaffected, the Lorentz force must be zero. Therefore, we have:
<math>\vec F=(-2e)(1600,-1800,-800)=(-5.12697,5.76784,2.56348)\times10^{-16}\ \mathrm N.</math>


<math> \vec{F}_{Lorentz} = q\vec{E} + q\vec{v} ⨯ \vec{B} = 0 </math>  
Squaring the components and taking the square root gives <math>|\vec F|=8.13174\times10^{-16}\ \mathrm N</math>.


<math> \lvert q\vec{E}\rvert = \lvert q\vec{v} ⨯ \vec{B}\rvert </math>
Power is a dot product, not force magnitude times speed unless the vectors are parallel. Here


<math> qE= qvB </math>  
<math>\vec E\cdot\vec v=600(30000)-800(40000)+200(-10000)=-1.60\times10^7\ \mathrm{V/s},</math>


<math> v = E/B </math>  
<math>P=q\vec E\cdot\vec v=+5.12697\times10^{-12}\ \mathrm W.</math>


From this relationship we can adjust to our electric and magnetic fields to pass particles with a desired speed of a narrow band through a target area. Particles at a desired speed will remain unaffected while other particles with undesired speeds will be deflected. This technique is used in technologies such as electron microscopes and spectrometers.
The kinetic energy is increasing at this instant. As a check, <math>(1000,-1000,-1000)\cdot(30000,40000,-10000)=0</math>, so the magnetic contribution to power is zero. Negative charge does not automatically mean decreasing kinetic energy.


The following VPython trinket module is a demonstration of a velocity selector. Two particles of different speeds pass through an area with perpendicular magnetic and electric fields. Within this trinket, you can change the initial values of the velocity selector and particle velocities to see how this affects the particles' motion as they try to pass through a circular area.
=== Difficult ===


[[File:velocitySelector3Stages.jpg|thumb| '''Figure 7.1.''' SImulation of a Velocity Selector ]]
'''Will a fast proton pass through a finite slit?''' Use the selector defaults, but let a proton enter at <math>v_0=1.30\times10^5\ \mathrm{m/s}</math> from <math>x=y=0</math>, with no initial y velocity. The exit plane is at <math>x=0.100\ \mathrm m</math>; its slit has half-width 2.00 mm. Plates are at <math>y=\pm30.0\ \mathrm{mm}</math>. Find the first exit time, test transmission, and check energy.


[https://trinket.io/glowscript/d3067081b7 Velocity Selector Trinket]
'''Solution.'''


'''1. Form the coupled equations.''' Define <math>u=E/B=10^5\ \mathrm{m/s}</math>, <math>\omega=qB/m_p=1.91576663\times10^6\ \mathrm{s^{-1}}</math>, and <math>\delta=v_0-u=30000\ \mathrm{m/s}</math>. Then


<math>\dot v_x=\omega v_y,\qquad \dot v_y=\omega(u-v_x).</math>


For <math>w=v_x-u</math>, differentiation gives <math>\ddot w=-\omega^2w</math>. Applying the initial velocity conditions gives


'''''Electric Motor'''''
<math>v_x=u+\delta\cos(\omega t),\qquad v_y=-\delta\sin(\omega t).</math>


An electric motor is a device that uses the Lorentz force to convert electric energy into mechanical energy. Using the [[magnetic torque]] principle, electric energy is created by using the magnetic field of a magnet.  The [[torque]] laws are based off the principles of the net electric and magnetic forces.
'''2. Integrate once more to find position.'''


===Other related topics===
<math>x(t)=ut+\frac{\delta}{\omega}\sin(\omega t),\qquad y(t)=\frac{\delta}{\omega}[\cos(\omega t)-1].</math>


Here are other principles that use the net force of magnetic and electric forces as a building block:
Both coordinates are zero at the entrance. Also <math>\ddot y(0)=-\delta\omega</math> is negative, agreeing with the initial force on a fast proton.


[[Hall Effect]]
'''3. Solve for the first exit-plane crossing.''' Set <math>x(t)=0.100\ \mathrm m</math> in the equation above. The x velocity is at least 70000 m/s, so x increases monotonically and this crossing is unique. Bisection gives


[[Lorentz Force]]
<math>t_{\mathrm{exit}}=0.843565\ \mu\mathrm s.</math>


[[Motional Emf]]
Using length divided by entry speed would be incorrect because the x velocity changes.


[[Electric Motors]]
'''4. Test the geometry.''' At that time,


[[Motional Emf using Faraday's Law]]
<math>y_{\mathrm{exit}}=-16.3683\ \mathrm{mm},\qquad (v_x,v_y)=(98642.1,-29969.3)\ \mathrm{m/s}.</math>


[[Inductance]]
The magnitude of the deflection exceeds the 2.00 mm half-width, so the proton hits the exit screen. It has not hit a plate first: the phase grows from zero to about 1.616 radians, less than <math>\pi</math>, and y decreases monotonically to −16.3683 mm, remaining between the plates. In comparison, a matched proton follows the centerline and exits after 1.00 microsecond.


==History==
'''5. Check energy independently.'''


The relationship between electric and magnetic forces was first questioned in the mid-18th century when Johann Tobias Mayer (1760) and Henry Cavendish (1762) proposed that the force on magnetic poles and electrically charged objects followed the inverse-square law, which was proven to be true by Charles-Augustin in 1784.
<math>qEy_{\mathrm{exit}}=-5.24499\times10^{-18}\ \mathrm J,</math>


Following Michael Faraday's proposal of the concept of electric and magnetic fields, James Clerk Maxwell was first to mathematically prove the concepts. In 1865, Maxwell's field equations consisted of some form of the Lorentz force equation, but at the time it was not clear how it related to forces on charged moving particles. J.J Thomson was the first to attempt a derivation of Maxwell's field equations, and he derived a basic form of the formula for the electromagnetic forces on a charged moving particle in relation to the properties of the particle and its external fields. In 1892, Hendrik Lorentz corrected mistakes of the old formula and derived the modern form of the equation, which contains the forces due to both electric and magnetic fields.
<math>\frac{m_p}{2}(v_x^2+v_y^2-v_0^2)=-5.24499\times10^{-18}\ \mathrm J.</math>
 
Electric work and kinetic-energy change agree. The proton loses energy while moving partly against its upward electric force. The magnetic force changes the direction of the proton's velocity but does no work.
 
'''Interpretation:''' the slit does not prove that only one exact speed can pass. A finite aperture admits a band, and other device lengths can allow off-speed trajectories to return toward the axis. The force-balance result tells us that <math>E/B</math> produces an undeflected transverse beam in this ideal geometry; acceptance also depends on the slit, length, entrance directions, and plate collisions.
 
== Connectedness ==
 
'''Connection to my major: computer science.''' As a computer science major, I connect most directly with this topic through the computational model. The physical state can be represented by four numbers: <math>x, y, v_x, v_y</math>. A function calculates how quickly each of those quantities changes, and an integration algorithm uses those rates to update the state. Separating the physics calculation from the visualization makes the code easier to test: changing a color or a button should not change a predicted trajectory. Vector algebra becomes executable code, and differential equations become a concrete programming problem.
 
'''Connection to my interest in coding.''' I like using code to make a problem easier to explore. For a physics model, that raises a practical question: how do I check whether the code is correct? An animation can look convincing even when its physics is wrong. For this model, useful checks include an exactly straight selected beam, charge reversal at fixed mass, agreement with an independently derived trajectory, and the work–energy relation. These checks turn the physics into concrete requirements for the code and make it easier to find mistakes.
 
'''Measurement and instrumentation.''' The ideal undeflected beam has speed E/B, independent of particle mass. A finite slit also admits a range of nearby speeds. If the transmitted beam then enters a region containing only a perpendicular magnetic field <math>B_a</math>, the circular radius is <math>r=mv/(|q|B_a)</math>, so <math>m/|q|=rB_a/v</math>. Measuring radius at known speed gives a mass-to-charge ratio, not mass alone unless charge is known.
 
'''A real application.''' JEOL describes Wien filters in the illumination systems of transmission electron microscopes, where crossed fields help narrow the electron beam's energy distribution. In that setting, velocity selection helps control the beam used to form an image.<ref name="JEOL">JEOL, electron microscopy glossary. [https://www.jeol.com/words/emterms/20121023.004200.php Wien filter].</ref>
 
== History ==
 
Crossed fields became a way to measure properties of particles that could not be seen directly. At the Cavendish Laboratory at the University of Cambridge in England, J. J. Thomson's cathode-ray research in 1897 established evidence for negatively charged constituents of matter.<ref name="Cambridge">University of Cambridge, Cavendish Laboratory. [https://www.phy.cam.ac.uk/about/our-history/ Our history], entry for 1897.</ref> He received the 1906 Nobel Prize in Physics.<ref name="NobelHistory">Nobel Prize, institutional history. [https://www.nobelprize.org/prizes/themes/the-nobel-prize-in-physics-1901-2000/ The Nobel Prizes in Physics 1901–2000].</ref>
 
In his 1906 Nobel lecture, Thomson described arranging electric and magnetic effects to cancel the beam's deflection and using their ratio to infer its speed. The same force balance used above turned the position of a fluorescent spot into a way to measure particle speed.<ref name="Thomson">J. J. Thomson, Nobel Lecture, “Carriers of Negative Electricity,” December 11, 1906. [https://www.nobelprize.org/uploads/2018/06/thomson-lecture.pdf Lecture]; [https://web2.lemoyne.edu/~giunta/EA/THOMSONann.HTML university-hosted transcription].</ref>
 
== Common Mistakes and Quick Checks ==
 
* '''Mistaking a field line for a particle path.''' With only a uniform upward electric field and an initial sideways velocity, a particle follows a parabola. The field specifies the force direction, not the existing velocity direction.
* '''Writing equal force vectors for cancellation.''' Opposite vectors cancel: <math>\vec F_E=-\vec F_B</math>. Equality of magnitudes is a separate statement.
* '''Calling every magnetic trajectory a helix.''' In a uniform magnetic field alone, perpendicular motion is circular, parallel motion is straight, and a combination gives a helix. These describe particle paths, not a universal shape of magnetic field lines.<ref name="OpenStaxMotion">OpenStax, University Physics Volume 2, section 11.3. [https://openstax.org/books/university-physics-volume-2/pages/11-3-motion-of-a-charged-particle-in-a-magnetic-field Motion of a Charged Particle in a Magnetic Field].</ref>
* '''Forgetting signed charge.''' Find <math>\vec v\times\vec B</math> first, then reverse for negative charge.
* '''Using the entry force for the whole flight.''' The magnetic term changes when velocity changes. Integrate the coupled equations or use their exact solution.
* '''Assuming a magnetic field supplies kinetic energy.''' Check <math>P=q\vec E\cdot\vec v</math>.
 
'''Self-check:''' if both the electric and magnetic field reverse, does the selected +x velocity change? No: both force vectors reverse and their cancellation is preserved. If only the magnetic field reverses while the beam and electric field remain fixed, the two forces reinforce for a positive charge entering along +x.
 
=== Practice: Predict Before Calculating ===
 
'''1. A positive particle enters along +x at twice E/B, with E upward and B out of the page. Which way does it initially accelerate?'''
 
The magnetic force is downward and twice as large as the upward electric force, so the initial net acceleration is downward. A negative particle of the same mass initially accelerates upward because both forces reverse. The fields themselves have not reversed. Later the force can change direction as the velocity changes.
 
'''2. Does an added velocity component parallel to B destroy the balance?'''
 
No. For <math>\vec v=(E/B)\hat x+w\hat z</math>, the z component has zero cross product with B, and the forces still cancel. The total speed is <math>\sqrt{(E/B)^2+w^2}</math>. A real aperture can separately reject the resulting z displacement. The usual E/B speed result assumes the transverse beam direction specified here.
 
'''3. At the instant a particle is at rest in nonzero E and B, can the force be nonzero while the power is zero?'''
 
Yes. The force is <math>q\vec E</math>, but instantaneous power is <math>\vec F\cdot\vec v=0</math>. Immediately afterward the force changes the velocity, and electric power generally becomes nonzero. Force and instantaneous energy-transfer rate are different quantities.


== See also ==
== See also ==


[[Hall Effect]]
* [[Lorentz Force]] — the combined force law.
* [[Electric Force]] — force from the electric field.
* [[Magnetic Force]] — cross products and magnetic deflection.
* [[Hall Effect]] — charge separation and transverse electric fields.
* [[Motional Emf]] — moving charges and potential differences.
 
=== Further reading ===
 
* MIT OpenCourseWare, 8.02T, Chapter 8: force directions, velocity selection, and mass analysis.
* OpenStax, ''University Physics Volume 2'', sections 11.3 and 11.7: magnetic trajectories and applications.
* Richard Fitzpatrick's University of Texas notes: a mathematical treatment of uniform-field motion.
 
=== External links ===
 
* [https://openstax.org/books/university-physics-volume-2/pages/11-7-applications-of-magnetic-forces-and-fields Applications of Magnetic Forces and Fields — OpenStax]
* [https://www.jeol.com/words/emterms/20121023.004200.php Wien filter — JEOL]
* [https://web2.lemoyne.edu/~giunta/EA/THOMSONann.HTML Thomson's account of cathode-ray measurements]
 
== References ==
 
<references />
 
'''Media and computational provenance:''' the three diagrams, worked examples, and model were newly created for this revision. No figures from ''Matter & Interactions'', image-search results, or other textbooks are reproduced. Factual sources are cited above. Figure-generation code, editable SVGs, PNGs, model source, and verification scripts are retained with the project.
 
<!-- MODEL_SOURCE_START -->
 
== Computational Source (Fallback) ==
 
The complete source for the linked Web VPython model is provided below. It has been checked against an independent analytic solution and local tests, compiled with the official GlowScript 3.2 compiler, and run in the browser. Copy the listing, including its version header, into a compatible GlowScript VPython editor to modify it. The model runs on the linked host, not inside this wiki page.
 
<pre>
GlowScript 3.2 VPython
# Original draft model, November 2026. SI units except display conversions.
# Paste this complete file into a GlowScript VPython editor.
# Fields are uniform throughout each trajectory up to the aperture plane.
# No fringe fields, collisions, relativity, radiation, or particle interactions.


[[Lorentz Force]]
E = 2000
B = 0.020
charge_magnitude = 1.602176634e-19
mass = 1.67262192595e-27
q = charge_magnitude
selected_speed = E/B
length = 0.10
half_aperture = 0.002
dt = 3e-9
ratios = [0.7, 1.0, 1.3]
colors = [vector(0.65,0.33,0.09), vector(0.14,0.44,0.31), vector(0.16,0.42,0.61)]
scene = canvas(width=800, height=440, background=color.white, foreground=vector(0.12,0.16,0.22))
scene.title = '&lt;b&gt;Crossed fields: which speed passes straight?&lt;/b&gt;&lt;br&gt;'
scene.center = vector(0.05,0,0)
scene.range = 0.065
scene.forward = vector(0,0,-1)
scene.up = vector(0,1,0)
scene.userspin = False
scene.autoscale = False
scene.append_to_caption('E = 2000 V/m upward (+y); B = 0.020 T out of screen (+z).&lt;br&gt;')
scene.append_to_caption('Launch along +x. Green: v = E/B = 100 km/s. Orange: 70%; blue: 130%.&lt;br&gt;')
scene.append_to_caption('The screen is at x = 0.10 m. Adjust its aperture half-width below; full width is twice that value.&lt;br&gt;')
scene.append_to_caption('Charge reversal keeps the proton mass; the negative particle is NOT an electron.&lt;br&gt;&lt;br&gt;')


[[Motional Emf]]
# Grey aperture screen and dotted reference axis, all original geometry.
top_screen = box(pos=vector(length,0.026,0),size=vector(0.001,0.048,0.001),color=color.gray(0.6))
bottom_screen = box(pos=vector(length,-0.026,0),size=vector(0.001,0.048,0.001),color=color.gray(0.6))
curve(pos=[vector(0,0,-0.001),vector(length,0,-0.001)],color=color.gray(0.5),radius=0.00012)
arrow(pos=vector(0.012,0.032,0),axis=vector(0,0.013,0),color=vector(0.53,0.40,0.09),shaftwidth=0.0007)
label(pos=vector(0.012,0.048,0),text='E (+y)',box=False,height=12,color=vector(0.12,0.16,0.22))
label(pos=vector(0.055,0.040,0),text='B: out of screen (+z)',box=False,height=12,color=vector(0.12,0.16,0.22))
label(pos=vector(0.054,-0.046,0),text='x increases to the right; distances in meters',box=False,height=12,color=vector(0.12,0.16,0.22))
for xx in [0.03,0.05,0.07,0.09]:
    for yy in [-0.03,0.03]:
        ring(pos=vector(xx,yy,-0.002),axis=vector(0,0,1),radius=0.0014,thickness=0.00015,color=color.gray(0.5))
        sphere(pos=vector(xx,yy,-0.002),radius=0.00035,color=color.gray(0.5))


[[Electric Motors]]
def derivative(s):
    return [s[2],s[3],q*B*s[3]/mass,q*(E-B*s[2])/mass]


[[Motional Emf using Faraday's Law]]
def shifted(s,k,h):
    return [s[j]+h*k[j] for j in range(4)]


[[Inductance]]
def rk4(s,h):
    k1 = derivative(s)
    k2 = derivative(shifted(s,k1,h/2))
    k3 = derivative(shifted(s,k2,h/2))
    k4 = derivative(shifted(s,k3,h))
    return [s[j]+h*(k1[j]+2*k2[j]+2*k3[j]+k4[j])/6 for j in range(4)]


===Further reading===
def accepts(y,half_width):
    # Exact boundary is included for this ideal point-particle aperture.
    return abs(y) &lt;= half_width


Books, Articles or other print media on this topic
def diagnostics(s,t,vx0):
    omega = q*B/mass
    u = vx0-selected_speed
    exact_x = selected_speed*t+u*sin(omega*t)/omega
    exact_y = u*(cos(omega*t)-1)/omega
    position_error = sqrt((s[0]-exact_x)**2+(s[1]-exact_y)**2)
    initial_energy = mass*vx0**2/2
    delta_energy = mass*(s[2]**2+s[3]**2)/2-initial_energy
    energy_residual = abs(delta_energy-q*E*s[1])/initial_energy
    return [position_error,energy_residual]


[http://web.mit.edu/sahughes/www/8.022/lec10.pdf | MIT Physics notes on Lorentz force]
states = []
particles = []
trails = []
times = [0,0,0]
done = [False,False,False]
running = False
reset_requested = True
for i in range(3):
    states.append([0,0,ratios[i]*selected_speed,0])
    particles.append(sphere(pos=vector(0,0,0),radius=0.001,color=colors[i]))
    trails.append(curve(color=colors[i],radius=0.00025))


===External links===
def toggle(evt):
Great youtube videos on Lorentz Force Law:
    global running
[https://www.youtube.com/watch?v=gINzRCOOs-8 |Lorentz Force Law Video 1]
    running = not running
[https://www.youtube.com/watch?v=PK6sEF9SNjw | Lorentz Force Law Video 2]
    evt.text = 'Pause' if running else 'Run'


==References==
def reset(evt):
    global reset_requested
    reset_requested = True


Boundless. “Electric vs. Magnetic Forces.” Boundless Physics. Boundless, 21 Jul. 2015. Retrieved 05 Dec. 2015 from https://www.boundless.com/physics/textbooks/boundless-physics-textbook/magnetism-21/motion-of-a-charged-particle-in-a-magnetic-field-158/electric-vs-magnetic-forces-554-11176/
def reverse(evt):
    global q, reset_requested
    q = -q
    reset_requested = True
    evt.text = 'Charge: +e (click to reverse)' if q &gt; 0 else 'Charge: -e (click to reverse)'


def refresh_readout():
    text_lines = ''
    max_position_error = 0
    max_energy_residual = 0
    for i in range(3):
        outcome = 'moving'
        if done[i]:
            outcome = 'PASSES' if accepts(states[i][1],half_aperture) else 'BLOCKED'
        text_lines += str(ratios[i])+' times E/B: t = '+str(round(times[i]*1e6,3))+' microseconds, y = '+str(round(states[i][1]*1000,3))+' mm: '+outcome+'&lt;br&gt;'
        residuals = diagnostics(states[i],times[i],ratios[i]*selected_speed)
        max_position_error = max(max_position_error,residuals[0])
        max_energy_residual = max(max_energy_residual,residuals[1])
    status.text = text_lines
    diagnostic_text.text = 'Largest current position error: '+str(max_position_error)+' m; relative energy residual: '+str(max_energy_residual)


Chabay, Ruth W., and Bruce A. Sherwood. Matter & Interactions. 4th ed. Vol. 2. Hoboken, NJ: Wiley, 2015. 812-814. Print.
def change_aperture(evt):
    global half_aperture
    half_aperture = evt.value/1000
    top_screen.pos = vector(length,(0.05+half_aperture)/2,0)
    bottom_screen.pos = vector(length,-(0.05+half_aperture)/2,0)
    top_screen.size = vector(0.001,0.05-half_aperture,0.001)
    bottom_screen.size = vector(0.001,0.05-half_aperture,0.001)
    aperture_text.text = 'Half-width: '+str(round(half_aperture*1000,1))+' mm; full opening: '+str(round(half_aperture*2000,1))+' mm'
    refresh_readout()


All images found on google image search:
run_button = button(text='Run',bind=toggle)
https://en.wikipedia.org/wiki/Magnetic_field
scene.append_to_caption('  ')
https://en.wikipedia.org/wiki/Wien_filter
button(text='Reset',bind=reset)
http://aplusphysics.com/wordpress/regents/em/electric-field/
scene.append_to_caption('  ')
button(text='Charge: +e (click to reverse)',bind=reverse)
scene.append_to_caption('&lt;br&gt;&lt;br&gt;')
aperture_text = wtext(text='Half-width: 2.0 mm; full opening: 4.0 mm')
scene.append_to_caption('&lt;br&gt;')
aperture_slider = slider(min=1,max=30,step=0.1,value=2,length=360,bind=change_aperture)
scene.append_to_caption('&lt;br&gt;Completed tracks are reclassified immediately; widening the aperture does not change the trajectories.&lt;br&gt;&lt;br&gt;')
status = wtext(text='')
scene.append_to_caption('&lt;br&gt;')
diagnostic_text = wtext(text='')
scene.append_to_caption('&lt;br&gt;Position error compares RK4 with the exact uniform-field orbit. Energy residual = |delta K - q E delta y| / K_initial.&lt;br&gt;')
scene.append_to_caption('&lt;br&gt;&lt;br&gt;Predict: which way will the slow positive particle bend? Then reverse charge.&lt;br&gt;')
scene.append_to_caption('Try half-widths of 17 mm and 25 mm. A boundary point counts as passing. The particle stops at the screen plane.&lt;br&gt;')
scene.append_to_caption('The electric force can change kinetic energy; the magnetic force alone cannot.&lt;br&gt;')


[[Fields]]
while True:
    rate(60)
    if reset_requested:
        for i in range(3):
            states[i] = [0,0,ratios[i]*selected_speed,0]
            particles[i].pos = vector(0,0,0)
            trails[i].clear()
            trails[i].append(pos=particles[i].pos)
            times[i] = 0
            done[i] = False
        running = False
        run_button.text = 'Run'
        reset_requested = False
        refresh_readout()
    if running:
        for i in range(3):
            if not done[i]:
                h = dt
                next_state = rk4(states[i],h)
                if next_state[0] &gt;= length:
                    lo = 0
                    hi = dt
                    for j in range(40):
                        mid = (lo+hi)/2
                        if rk4(states[i],mid)[0] &lt; length:
                            lo = mid
                        else:
                            hi = mid
                    h = hi
                    next_state = rk4(states[i],h)
                    done[i] = True
                states[i] = next_state
                times[i] += h
                particles[i].pos = vector(states[i][0],states[i][1],0)
                trails[i].append(pos=particles[i].pos)
        refresh_readout()
        if done[0] and done[1] and done[2]:
            running = False
            run_button.text = 'Run (reset to replay)'
</pre>
<!-- MODEL_SOURCE_END -->

Revision as of 21:36, 29 November 2026

Evan Littlejohn — Fall 2026

Combining electric and magnetic forces means adding two vector forces acting on the same charged particle. The electric force depends on charge and electric field; the magnetic force also depends on the particle's velocity. Together they explain how a beam can bend, gain or lose kinetic energy, or pass straight through a velocity selector.

The Main Idea

Imagine a positive particle moving to the right between two charged plates. The lower plate is positive and the upper plate is negative, so the electric field points upward. A magnetic field pointing out of the page gives this moving positive particle a downward magnetic force. At the right entry speed, the forces cancel. A slower or faster particle initially bends away from the centerline.

Matching force magnitudes is only half the check: do the force vectors point in opposite directions? Check the force directions before setting their magnitudes equal.

Positive particle travels right; the electric force points up and the magnetic force points down. Magnetic field points out of the page.

Figure 1. Force directions for a positive charge entering along +x with E along +y and B along +z. Equal arrow lengths illustrate the selected speed. This is a schematic, not a drawing to scale. Original diagram created for this revision; no external image reused.

A Mathematical Model

The Lorentz force and its assumptions

For charge [math]\displaystyle{ q }[/math] moving with velocity [math]\displaystyle{ \vec v }[/math] through prescribed external fields,

[math]\displaystyle{ \vec F_E=q\vec E,\qquad \vec F_B=q\vec v\times\vec B,\qquad \frac{d\vec p}{dt}=q(\vec E+\vec v\times\vec B). }[/math]

These are electromagnetic forces; add any other forces separately. Fields and velocity must be expressed in the same reference frame. Here [math]\displaystyle{ q }[/math] is signed, [math]\displaystyle{ \vec E }[/math] has units N/C or V/m, [math]\displaystyle{ \vec B }[/math] is measured in tesla, and [math]\displaystyle{ \vec v }[/math] is in m/s. For the same fields and velocity, changing the sign of the charge reverses each force.[1]

For the low speeds used below, [math]\displaystyle{ \vec p\approx m\vec v }[/math], so acceleration is force divided by mass. At relativistic speeds use [math]\displaystyle{ \vec p=\gamma m\vec v }[/math], with [math]\displaystyle{ \gamma=1/\sqrt{1-v^2/c^2} }[/math]; the momentum form of the force law still applies.[2] All examples use speeds much less than [math]\displaystyle{ c=299792458\ \mathrm{m/s} }[/math].[3]

A reliable direction check

Compute the cross product before multiplying by signed charge:

[math]\displaystyle{ \vec v\times\vec B=(v_yB_z-v_zB_y,\ v_zB_x-v_xB_z,\ v_xB_y-v_yB_x). }[/math]

The magnitude is [math]\displaystyle{ F_B=|q|vB\sin\theta }[/math], where [math]\displaystyle{ \theta }[/math] is the angle between velocity and magnetic field. This equation alone does not give direction. In particular, motion parallel or antiparallel to the magnetic field produces zero magnetic force.

For this page, choose [math]\displaystyle{ \vec E=(0,E,0) }[/math] and [math]\displaystyle{ \vec B=(0,0,B) }[/math], with positive [math]\displaystyle{ E }[/math] and [math]\displaystyle{ B }[/math]. The components become

[math]\displaystyle{ F_x=qBv_y,\qquad F_y=q(E-Bv_x),\qquad F_z=0. }[/math]

Initially [math]\displaystyle{ v_y=0 }[/math], so only the y component can be nonzero. Later, a deflected particle acquires [math]\displaystyle{ v_y }[/math], and its x velocity changes too. Because the velocity changes, assuming constant transverse acceleration generally gives the wrong trajectory.

Velocity selection

A nonzero charge travels straight at constant velocity in this selector when

[math]\displaystyle{ \vec F_E=-\vec F_B,\qquad \vec E+\vec v\times\vec B=0. }[/math]

With entry velocity [math]\displaystyle{ \vec v=(v,0,0) }[/math], [math]\displaystyle{ \hat x\times\hat z=-\hat y }[/math]. Therefore [math]\displaystyle{ q(E-vB)=0 }[/math], giving

[math]\displaystyle{ v_{\mathrm{selected}}=\frac{E}{B}. }[/math]

The charge cancels, including its sign, and mass does not enter the force-balance condition. For the specified entry direction, a proton and an electron at the selected speed are both undeflected, although their trajectories away from balance differ because their charge-to-mass ratios differ.

The geometry matters. Taking the dot product of the general zero-force equation with [math]\displaystyle{ \vec B }[/math] shows that [math]\displaystyle{ \vec E\cdot\vec B=0 }[/math] is necessary. When [math]\displaystyle{ B\ne0 }[/math] and the fields are perpendicular, the full family of force-free velocities is

[math]\displaystyle{ \vec v=\frac{\vec E\times\vec B}{B^2}+v_{\parallel}\hat B. }[/math]

The parallel component contributes no magnetic force. Thus [math]\displaystyle{ E/B }[/math] is the selected total speed only when the beam is constrained to the transverse direction used here. The perpendicular term is also the guiding-center drift velocity in uniform crossed fields: it describes the steady motion of the center of the orbit. Particles with other initial velocities can gyrate around that moving center.[4]

Which field changes kinetic energy?

Dot the force with velocity:

[math]\displaystyle{ \frac{dK}{dt}=\vec F\cdot\vec v=q\vec E\cdot\vec v. }[/math]

The magnetic term is zero because the magnetic force is perpendicular to the velocity. A magnetic field can turn a particle without directly changing its kinetic energy. In combined fields, kinetic energy can change through electric work. In the uniform electric field used here,

[math]\displaystyle{ K(t)-K(0)=qE[y(t)-y(0)]. }[/math]

This relation provides an independent numerical check: if a simulation predicts a large violation, inspect its signs, units, and timestep.

A Computational Model

Run the interactive velocity selector. The model opens in Web VPython. This wiki currently does not support embedding it directly; the complete source is also provided below.

Three independent particles enter at 70, 100, and 130 km/s. Defaults are [math]\displaystyle{ E=2000\ \mathrm{V/m} }[/math], [math]\displaystyle{ B=0.020\ \mathrm T }[/math], proton mass, and an exit plane 0.100 m downstream. The default slit half-width is 2 mm. Each trajectory stops at that plane and is classified as passing or blocked. Displayed particle sizes are exaggerated.

Fourth-order Runge–Kutta integration updates position and velocity together, recomputing the velocity-dependent force at intermediate stages. The model also refines the final integration step to locate the crossing of the exit plane.

Investigate: predict the initial deflections, run the model, then reverse the charge and compare. Mass stays fixed, so the negative-charge case is not an electron. Adjust the slit half-width from 1 to 30 mm; the full opening is twice that value. A 2 mm half-width passes only the selected beam, 17 mm passes the selected and fast beams, and 25 mm passes all three. Changing the aperture reclassifies existing trajectories without changing their motion. To replay, click Reset, then Run. Field strengths and the three entry speeds stay fixed.

At the ten-centimeter exit, the slow positive particle is 24.4 millimeters above center, the selected particle stays centered, and the fast particle is 16.4 millimeters below center.

Figure 2. Exact trajectories independently calculated for the default positive-charge case. The slow beam exits above the slit, the matched beam at its center, and the fast beam below it. Horizontal and vertical axes use different units/scales. Original figure created for this revision.

Limits: uniform, static fields and nonrelativistic point particles; no fringing, collisions, interparticle forces, radiation reaction, or beam feedback on the fields. Plate collisions are omitted. The three default trajectories fit within the hypothetical ±30 mm plates in the difficult example. Real acceptance also depends on device geometry.

The code is checked against exact trajectories, charge reversal, field-only limits, timestep convergence, and energy accounting. Readouts report the maximum current position error and energy residual [math]\displaystyle{ |\Delta K-qEy|/K_0 }[/math] across the particles, using each particle's initial energy [math]\displaystyle{ K_0 }[/math]. Small residuals indicate numerical consistency with the ideal model, not experimental accuracy.

The slow positive particle changes velocity while its kinetic-energy change matches electric work throughout the plotted interval.

Figure 3. An independent diagnostic compares kinetic-energy change with electric work. The two curves overlap. This calculation maintains uniform fields for the entire plotted interval, without imposing an exit screen. Original figure created for this revision.

Examples

These original worked examples use SI units, signed charge, and prescribed external fields. Constants are [math]\displaystyle{ e=1.602176634\times10^{-19}\ \mathrm C }[/math] and [math]\displaystyle{ m_p=1.67262192595\times10^{-27}\ \mathrm{kg} }[/math]; round physical answers to the precision of the inputs. Extra digits are shown below to help compare calculations.

Simple

Which speed passes straight through? A proton enters along +x with [math]\displaystyle{ \vec E=(0,2000,0)\ \mathrm{V/m} }[/math] and [math]\displaystyle{ \vec B=(0,0,0.020)\ \mathrm T }[/math]. Find its undeflected speed and decide whether an electron at the same velocity is also undeflected.

Solution.

  1. Directions first: [math]\displaystyle{ \vec v\times\vec B=(0,-vB,0) }[/math]. For the proton, the electric force is upward and the magnetic force is downward.
  2. Set the net y force to zero: [math]\displaystyle{ q(E-vB)=0 }[/math].
  3. Divide by nonzero charge and solve: [math]\displaystyle{ v=2000/0.020=1.00\times10^5\ \mathrm{m/s} }[/math].
  4. Check units: [math]\displaystyle{ (\mathrm{N/C})/[\mathrm{N\,s/(C\,m)}]=\mathrm{m/s} }[/math].
  5. Check magnitudes: both forces have magnitude [math]\displaystyle{ 3.20435\times10^{-16}\ \mathrm N }[/math]. Their directions are opposite.

For the electron, both forces reverse, so they still cancel. A proton entering at 70 km/s initially bends upward; one entering at 130 km/s initially bends downward. This answer concerns the specified beam direction, not arbitrary three-dimensional velocities.

Middling

Find a vector force and instantaneous power. A particle has charge [math]\displaystyle{ q=-2e }[/math] and, at one instant,

[math]\displaystyle{ \vec v=(30000,40000,-10000)\ \mathrm{m/s}, }[/math]

[math]\displaystyle{ \vec E=(600,-800,200)\ \mathrm{V/m},\qquad \vec B=(0.010,-0.020,0.030)\ \mathrm T. }[/math]

These fields differ from the selector defaults.

Solution. First evaluate the cross product:

[math]\displaystyle{ \vec v\times\vec B=(1000,-1000,-1000)\ \mathrm{V/m}. }[/math]

For example, its x component is [math]\displaystyle{ 40000(0.030)-(-10000)(-0.020)=1000 }[/math]. Now add the electric field, then multiply the entire vector by the signed charge:

[math]\displaystyle{ \vec F=(-2e)(1600,-1800,-800)=(-5.12697,5.76784,2.56348)\times10^{-16}\ \mathrm N. }[/math]

Squaring the components and taking the square root gives [math]\displaystyle{ |\vec F|=8.13174\times10^{-16}\ \mathrm N }[/math].

Power is a dot product, not force magnitude times speed unless the vectors are parallel. Here

[math]\displaystyle{ \vec E\cdot\vec v=600(30000)-800(40000)+200(-10000)=-1.60\times10^7\ \mathrm{V/s}, }[/math]

[math]\displaystyle{ P=q\vec E\cdot\vec v=+5.12697\times10^{-12}\ \mathrm W. }[/math]

The kinetic energy is increasing at this instant. As a check, [math]\displaystyle{ (1000,-1000,-1000)\cdot(30000,40000,-10000)=0 }[/math], so the magnetic contribution to power is zero. Negative charge does not automatically mean decreasing kinetic energy.

Difficult

Will a fast proton pass through a finite slit? Use the selector defaults, but let a proton enter at [math]\displaystyle{ v_0=1.30\times10^5\ \mathrm{m/s} }[/math] from [math]\displaystyle{ x=y=0 }[/math], with no initial y velocity. The exit plane is at [math]\displaystyle{ x=0.100\ \mathrm m }[/math]; its slit has half-width 2.00 mm. Plates are at [math]\displaystyle{ y=\pm30.0\ \mathrm{mm} }[/math]. Find the first exit time, test transmission, and check energy.

Solution.

1. Form the coupled equations. Define [math]\displaystyle{ u=E/B=10^5\ \mathrm{m/s} }[/math], [math]\displaystyle{ \omega=qB/m_p=1.91576663\times10^6\ \mathrm{s^{-1}} }[/math], and [math]\displaystyle{ \delta=v_0-u=30000\ \mathrm{m/s} }[/math]. Then

[math]\displaystyle{ \dot v_x=\omega v_y,\qquad \dot v_y=\omega(u-v_x). }[/math]

For [math]\displaystyle{ w=v_x-u }[/math], differentiation gives [math]\displaystyle{ \ddot w=-\omega^2w }[/math]. Applying the initial velocity conditions gives

[math]\displaystyle{ v_x=u+\delta\cos(\omega t),\qquad v_y=-\delta\sin(\omega t). }[/math]

2. Integrate once more to find position.

[math]\displaystyle{ x(t)=ut+\frac{\delta}{\omega}\sin(\omega t),\qquad y(t)=\frac{\delta}{\omega}[\cos(\omega t)-1]. }[/math]

Both coordinates are zero at the entrance. Also [math]\displaystyle{ \ddot y(0)=-\delta\omega }[/math] is negative, agreeing with the initial force on a fast proton.

3. Solve for the first exit-plane crossing. Set [math]\displaystyle{ x(t)=0.100\ \mathrm m }[/math] in the equation above. The x velocity is at least 70000 m/s, so x increases monotonically and this crossing is unique. Bisection gives

[math]\displaystyle{ t_{\mathrm{exit}}=0.843565\ \mu\mathrm s. }[/math]

Using length divided by entry speed would be incorrect because the x velocity changes.

4. Test the geometry. At that time,

[math]\displaystyle{ y_{\mathrm{exit}}=-16.3683\ \mathrm{mm},\qquad (v_x,v_y)=(98642.1,-29969.3)\ \mathrm{m/s}. }[/math]

The magnitude of the deflection exceeds the 2.00 mm half-width, so the proton hits the exit screen. It has not hit a plate first: the phase grows from zero to about 1.616 radians, less than [math]\displaystyle{ \pi }[/math], and y decreases monotonically to −16.3683 mm, remaining between the plates. In comparison, a matched proton follows the centerline and exits after 1.00 microsecond.

5. Check energy independently.

[math]\displaystyle{ qEy_{\mathrm{exit}}=-5.24499\times10^{-18}\ \mathrm J, }[/math]

[math]\displaystyle{ \frac{m_p}{2}(v_x^2+v_y^2-v_0^2)=-5.24499\times10^{-18}\ \mathrm J. }[/math]

Electric work and kinetic-energy change agree. The proton loses energy while moving partly against its upward electric force. The magnetic force changes the direction of the proton's velocity but does no work.

Interpretation: the slit does not prove that only one exact speed can pass. A finite aperture admits a band, and other device lengths can allow off-speed trajectories to return toward the axis. The force-balance result tells us that [math]\displaystyle{ E/B }[/math] produces an undeflected transverse beam in this ideal geometry; acceptance also depends on the slit, length, entrance directions, and plate collisions.

Connectedness

Connection to my major: computer science. As a computer science major, I connect most directly with this topic through the computational model. The physical state can be represented by four numbers: [math]\displaystyle{ x, y, v_x, v_y }[/math]. A function calculates how quickly each of those quantities changes, and an integration algorithm uses those rates to update the state. Separating the physics calculation from the visualization makes the code easier to test: changing a color or a button should not change a predicted trajectory. Vector algebra becomes executable code, and differential equations become a concrete programming problem.

Connection to my interest in coding. I like using code to make a problem easier to explore. For a physics model, that raises a practical question: how do I check whether the code is correct? An animation can look convincing even when its physics is wrong. For this model, useful checks include an exactly straight selected beam, charge reversal at fixed mass, agreement with an independently derived trajectory, and the work–energy relation. These checks turn the physics into concrete requirements for the code and make it easier to find mistakes.

Measurement and instrumentation. The ideal undeflected beam has speed E/B, independent of particle mass. A finite slit also admits a range of nearby speeds. If the transmitted beam then enters a region containing only a perpendicular magnetic field [math]\displaystyle{ B_a }[/math], the circular radius is [math]\displaystyle{ r=mv/(|q|B_a) }[/math], so [math]\displaystyle{ m/|q|=rB_a/v }[/math]. Measuring radius at known speed gives a mass-to-charge ratio, not mass alone unless charge is known.

A real application. JEOL describes Wien filters in the illumination systems of transmission electron microscopes, where crossed fields help narrow the electron beam's energy distribution. In that setting, velocity selection helps control the beam used to form an image.[5]

History

Crossed fields became a way to measure properties of particles that could not be seen directly. At the Cavendish Laboratory at the University of Cambridge in England, J. J. Thomson's cathode-ray research in 1897 established evidence for negatively charged constituents of matter.[6] He received the 1906 Nobel Prize in Physics.[7]

In his 1906 Nobel lecture, Thomson described arranging electric and magnetic effects to cancel the beam's deflection and using their ratio to infer its speed. The same force balance used above turned the position of a fluorescent spot into a way to measure particle speed.[8]

Common Mistakes and Quick Checks

  • Mistaking a field line for a particle path. With only a uniform upward electric field and an initial sideways velocity, a particle follows a parabola. The field specifies the force direction, not the existing velocity direction.
  • Writing equal force vectors for cancellation. Opposite vectors cancel: [math]\displaystyle{ \vec F_E=-\vec F_B }[/math]. Equality of magnitudes is a separate statement.
  • Calling every magnetic trajectory a helix. In a uniform magnetic field alone, perpendicular motion is circular, parallel motion is straight, and a combination gives a helix. These describe particle paths, not a universal shape of magnetic field lines.[9]
  • Forgetting signed charge. Find [math]\displaystyle{ \vec v\times\vec B }[/math] first, then reverse for negative charge.
  • Using the entry force for the whole flight. The magnetic term changes when velocity changes. Integrate the coupled equations or use their exact solution.
  • Assuming a magnetic field supplies kinetic energy. Check [math]\displaystyle{ P=q\vec E\cdot\vec v }[/math].

Self-check: if both the electric and magnetic field reverse, does the selected +x velocity change? No: both force vectors reverse and their cancellation is preserved. If only the magnetic field reverses while the beam and electric field remain fixed, the two forces reinforce for a positive charge entering along +x.

Practice: Predict Before Calculating

1. A positive particle enters along +x at twice E/B, with E upward and B out of the page. Which way does it initially accelerate?

The magnetic force is downward and twice as large as the upward electric force, so the initial net acceleration is downward. A negative particle of the same mass initially accelerates upward because both forces reverse. The fields themselves have not reversed. Later the force can change direction as the velocity changes.

2. Does an added velocity component parallel to B destroy the balance?

No. For [math]\displaystyle{ \vec v=(E/B)\hat x+w\hat z }[/math], the z component has zero cross product with B, and the forces still cancel. The total speed is [math]\displaystyle{ \sqrt{(E/B)^2+w^2} }[/math]. A real aperture can separately reject the resulting z displacement. The usual E/B speed result assumes the transverse beam direction specified here.

3. At the instant a particle is at rest in nonzero E and B, can the force be nonzero while the power is zero?

Yes. The force is [math]\displaystyle{ q\vec E }[/math], but instantaneous power is [math]\displaystyle{ \vec F\cdot\vec v=0 }[/math]. Immediately afterward the force changes the velocity, and electric power generally becomes nonzero. Force and instantaneous energy-transfer rate are different quantities.

See also

Further reading

  • MIT OpenCourseWare, 8.02T, Chapter 8: force directions, velocity selection, and mass analysis.
  • OpenStax, University Physics Volume 2, sections 11.3 and 11.7: magnetic trajectories and applications.
  • Richard Fitzpatrick's University of Texas notes: a mathematical treatment of uniform-field motion.

External links

References

  1. ↑ MIT OpenCourseWare, 8.02T Electricity and Magnetism (Spring 2005), Chapter 8, especially sections 8.2, 8.5, and 8.6. Magnetic Fields.
  2. ↑ OpenStax, University Physics Volume 3, section 5.8. Relativistic Momentum.
  3. ↑ NIST, CODATA physical constants. Speed of light in vacuum.
  4. ↑ Richard Fitzpatrick, University of Texas at Austin. Charged Particle Motion in Electric and Magnetic Fields.
  5. ↑ JEOL, electron microscopy glossary. Wien filter.
  6. ↑ University of Cambridge, Cavendish Laboratory. Our history, entry for 1897.
  7. ↑ Nobel Prize, institutional history. The Nobel Prizes in Physics 1901–2000.
  8. ↑ J. J. Thomson, Nobel Lecture, “Carriers of Negative Electricity,” December 11, 1906. Lecture; university-hosted transcription.
  9. ↑ OpenStax, University Physics Volume 2, section 11.3. Motion of a Charged Particle in a Magnetic Field.

Media and computational provenance: the three diagrams, worked examples, and model were newly created for this revision. No figures from Matter & Interactions, image-search results, or other textbooks are reproduced. Factual sources are cited above. Figure-generation code, editable SVGs, PNGs, model source, and verification scripts are retained with the project.


Computational Source (Fallback)

The complete source for the linked Web VPython model is provided below. It has been checked against an independent analytic solution and local tests, compiled with the official GlowScript 3.2 compiler, and run in the browser. Copy the listing, including its version header, into a compatible GlowScript VPython editor to modify it. The model runs on the linked host, not inside this wiki page.

GlowScript 3.2 VPython
# Original draft model, November 2026. SI units except display conversions.
# Paste this complete file into a GlowScript VPython editor.
# Fields are uniform throughout each trajectory up to the aperture plane.
# No fringe fields, collisions, relativity, radiation, or particle interactions.

E = 2000
B = 0.020
charge_magnitude = 1.602176634e-19
mass = 1.67262192595e-27
q = charge_magnitude
selected_speed = E/B
length = 0.10
half_aperture = 0.002
dt = 3e-9
ratios = [0.7, 1.0, 1.3]
colors = [vector(0.65,0.33,0.09), vector(0.14,0.44,0.31), vector(0.16,0.42,0.61)]
scene = canvas(width=800, height=440, background=color.white, foreground=vector(0.12,0.16,0.22))
scene.title = '<b>Crossed fields: which speed passes straight?</b><br>'
scene.center = vector(0.05,0,0)
scene.range = 0.065
scene.forward = vector(0,0,-1)
scene.up = vector(0,1,0)
scene.userspin = False
scene.autoscale = False
scene.append_to_caption('E = 2000 V/m upward (+y); B = 0.020 T out of screen (+z).<br>')
scene.append_to_caption('Launch along +x. Green: v = E/B = 100 km/s. Orange: 70%; blue: 130%.<br>')
scene.append_to_caption('The screen is at x = 0.10 m. Adjust its aperture half-width below; full width is twice that value.<br>')
scene.append_to_caption('Charge reversal keeps the proton mass; the negative particle is NOT an electron.<br><br>')

# Grey aperture screen and dotted reference axis, all original geometry.
top_screen = box(pos=vector(length,0.026,0),size=vector(0.001,0.048,0.001),color=color.gray(0.6))
bottom_screen = box(pos=vector(length,-0.026,0),size=vector(0.001,0.048,0.001),color=color.gray(0.6))
curve(pos=[vector(0,0,-0.001),vector(length,0,-0.001)],color=color.gray(0.5),radius=0.00012)
arrow(pos=vector(0.012,0.032,0),axis=vector(0,0.013,0),color=vector(0.53,0.40,0.09),shaftwidth=0.0007)
label(pos=vector(0.012,0.048,0),text='E (+y)',box=False,height=12,color=vector(0.12,0.16,0.22))
label(pos=vector(0.055,0.040,0),text='B: out of screen (+z)',box=False,height=12,color=vector(0.12,0.16,0.22))
label(pos=vector(0.054,-0.046,0),text='x increases to the right; distances in meters',box=False,height=12,color=vector(0.12,0.16,0.22))
for xx in [0.03,0.05,0.07,0.09]:
    for yy in [-0.03,0.03]:
        ring(pos=vector(xx,yy,-0.002),axis=vector(0,0,1),radius=0.0014,thickness=0.00015,color=color.gray(0.5))
        sphere(pos=vector(xx,yy,-0.002),radius=0.00035,color=color.gray(0.5))

def derivative(s):
    return [s[2],s[3],q*B*s[3]/mass,q*(E-B*s[2])/mass]

def shifted(s,k,h):
    return [s[j]+h*k[j] for j in range(4)]

def rk4(s,h):
    k1 = derivative(s)
    k2 = derivative(shifted(s,k1,h/2))
    k3 = derivative(shifted(s,k2,h/2))
    k4 = derivative(shifted(s,k3,h))
    return [s[j]+h*(k1[j]+2*k2[j]+2*k3[j]+k4[j])/6 for j in range(4)]

def accepts(y,half_width):
    # Exact boundary is included for this ideal point-particle aperture.
    return abs(y) <= half_width

def diagnostics(s,t,vx0):
    omega = q*B/mass
    u = vx0-selected_speed
    exact_x = selected_speed*t+u*sin(omega*t)/omega
    exact_y = u*(cos(omega*t)-1)/omega
    position_error = sqrt((s[0]-exact_x)**2+(s[1]-exact_y)**2)
    initial_energy = mass*vx0**2/2
    delta_energy = mass*(s[2]**2+s[3]**2)/2-initial_energy
    energy_residual = abs(delta_energy-q*E*s[1])/initial_energy
    return [position_error,energy_residual]

states = []
particles = []
trails = []
times = [0,0,0]
done = [False,False,False]
running = False
reset_requested = True
for i in range(3):
    states.append([0,0,ratios[i]*selected_speed,0])
    particles.append(sphere(pos=vector(0,0,0),radius=0.001,color=colors[i]))
    trails.append(curve(color=colors[i],radius=0.00025))

def toggle(evt):
    global running
    running = not running
    evt.text = 'Pause' if running else 'Run'

def reset(evt):
    global reset_requested
    reset_requested = True

def reverse(evt):
    global q, reset_requested
    q = -q
    reset_requested = True
    evt.text = 'Charge: +e (click to reverse)' if q > 0 else 'Charge: -e (click to reverse)'

def refresh_readout():
    text_lines = ''
    max_position_error = 0
    max_energy_residual = 0
    for i in range(3):
        outcome = 'moving'
        if done[i]:
            outcome = 'PASSES' if accepts(states[i][1],half_aperture) else 'BLOCKED'
        text_lines += str(ratios[i])+' times E/B: t = '+str(round(times[i]*1e6,3))+' microseconds, y = '+str(round(states[i][1]*1000,3))+' mm: '+outcome+'<br>'
        residuals = diagnostics(states[i],times[i],ratios[i]*selected_speed)
        max_position_error = max(max_position_error,residuals[0])
        max_energy_residual = max(max_energy_residual,residuals[1])
    status.text = text_lines
    diagnostic_text.text = 'Largest current position error: '+str(max_position_error)+' m; relative energy residual: '+str(max_energy_residual)

def change_aperture(evt):
    global half_aperture
    half_aperture = evt.value/1000
    top_screen.pos = vector(length,(0.05+half_aperture)/2,0)
    bottom_screen.pos = vector(length,-(0.05+half_aperture)/2,0)
    top_screen.size = vector(0.001,0.05-half_aperture,0.001)
    bottom_screen.size = vector(0.001,0.05-half_aperture,0.001)
    aperture_text.text = 'Half-width: '+str(round(half_aperture*1000,1))+' mm; full opening: '+str(round(half_aperture*2000,1))+' mm'
    refresh_readout()

run_button = button(text='Run',bind=toggle)
scene.append_to_caption('  ')
button(text='Reset',bind=reset)
scene.append_to_caption('  ')
button(text='Charge: +e (click to reverse)',bind=reverse)
scene.append_to_caption('<br><br>')
aperture_text = wtext(text='Half-width: 2.0 mm; full opening: 4.0 mm')
scene.append_to_caption('<br>')
aperture_slider = slider(min=1,max=30,step=0.1,value=2,length=360,bind=change_aperture)
scene.append_to_caption('<br>Completed tracks are reclassified immediately; widening the aperture does not change the trajectories.<br><br>')
status = wtext(text='')
scene.append_to_caption('<br>')
diagnostic_text = wtext(text='')
scene.append_to_caption('<br>Position error compares RK4 with the exact uniform-field orbit. Energy residual = |delta K - q E delta y| / K_initial.<br>')
scene.append_to_caption('<br><br>Predict: which way will the slow positive particle bend? Then reverse charge.<br>')
scene.append_to_caption('Try half-widths of 17 mm and 25 mm. A boundary point counts as passing. The particle stops at the screen plane.<br>')
scene.append_to_caption('The electric force can change kinetic energy; the magnetic force alone cannot.<br>')

while True:
    rate(60)
    if reset_requested:
        for i in range(3):
            states[i] = [0,0,ratios[i]*selected_speed,0]
            particles[i].pos = vector(0,0,0)
            trails[i].clear()
            trails[i].append(pos=particles[i].pos)
            times[i] = 0
            done[i] = False
        running = False
        run_button.text = 'Run'
        reset_requested = False
        refresh_readout()
    if running:
        for i in range(3):
            if not done[i]:
                h = dt
                next_state = rk4(states[i],h)
                if next_state[0] >= length:
                    lo = 0
                    hi = dt
                    for j in range(40):
                        mid = (lo+hi)/2
                        if rk4(states[i],mid)[0] < length:
                            lo = mid
                        else:
                            hi = mid
                    h = hi
                    next_state = rk4(states[i],h)
                    done[i] = True
                states[i] = next_state
                times[i] += h
                particles[i].pos = vector(states[i][0],states[i][1],0)
                trails[i].append(pos=particles[i].pos)
        refresh_readout()
        if done[0] and done[1] and done[2]:
            running = False
            run_button.text = 'Run (reset to replay)'