# Lorentz force and work done: where is the glitch?

#### Dale

Mentor
How would you actually evaluate the integral if these initial conditions are given:

electron initial position = {2,7,0}
electron initial velocity = {4,0,0}
B field initial vector = {0,0,-5}
B field source location {0,0,0}

What is electron's final location and velocity after one seconds?
Actually, this was easier than I thought. I used the formula from Wikipedia for the magnetic dipole field: https://en.wikipedia.org/wiki/Magnetic_dipole#External_magnetic_field_produced_by_a_magnetic_dipole_moment

That gives me B. Then F=qv x B and F=ma gives me a differential equation ma=qv x B. Plugging that into Mathematica using the initial conditions specified (assuming you meant all of the above to be in SI values) then solving for the position of the electron as a function of time. Evaluating that at t=1 gives the electron final position = (2.011,6.961). Evaluating the work done on the electron gives 0, which is confirmed by the fact that the final speed is still 4.

#### johana

If the speed was 4m/s, distance traveled in one second should be 4m. With your result the electron barely moved from its initial position.

#### Nugatory

Mentor
If the speed was 4m/s, distance traveled in one second should be 4m. With your result the electron barely moved from its initial position.
It's not moving in a straight line, so can move at 4m/s for a second yet not end up very far from its starting point.

#### Dale

Mentor
If the speed was 4m/s, distance traveled in one second should be 4m. With your result the electron barely moved from its initial position.
The length of the path is:

$$\int_0^1 |v(t)| dt = 4$$

So the path is indeed 4 m traveled at a constant speed of 4 m/s.

Here is an image of the path.

#### Attachments

• 16.6 KB Views: 274
Last edited:

#### Jabbu

Actually, this was easier than I thought. I used the formula from Wikipedia for the magnetic dipole field: https://en.wikipedia.org/wiki/Magnetic_dipole#External_magnetic_field_produced_by_a_magnetic_dipole_moment

That gives me B. Then F=qv x B and F=ma gives me a differential equation ma=qv x B. Plugging that into Mathematica using the initial conditions specified (assuming you meant all of the above to be in SI values) then solving for the position of the electron as a function of time. Evaluating that at t=1 gives the electron final position = (2.011,6.961). Evaluating the work done on the electron gives 0, which is confirmed by the fact that the final speed is still 4.
Can you please post your Mathematica code?

#### Dale

Mentor
Can you please post your Mathematica code?
Sure. It is not commented, but hopefully it is clear anyway. Ask me if you have any questions.

#### Attachments

• 16.9 KB Views: 339

#### Jabbu

Sure. It is not commented, but hopefully it is clear anyway. Ask me if you have any questions.
The question is what integration method is actually implemented by Wolfram for those functions. I also can't find where is the time step or integration resolution initialized.

There are several commonly used integration methods, like Euler method, Velocity verlet and Runge-Kutta, plus many variants and hybrid methods. They may produce the same result for some scenarios, but generally they produce different results and thus some are more suited for certain scenarios than others.

All these methods struggle with the same thing and are trying to beat it in their own way. It's resolution. Every curve must be integrated over line segments. Smaller segments or shorter dt time intervals lead to better approximation, but take more time to compute. So what these methods are attempting is to make computationally cheap predictions and produce more line segments than they actually compute by extrapolating calculated values and so save the time.

It is not obvious that while they can produce "smoother" curves, their only real purpose is just to save the time, they can't actually increase accuracy. They work great for some, but produce errors in other types of scenarios. They were important fifty years ago when computers were slow, but in my opinion many of these methods should be obsolete as they can do more harm than good.

The problem of which method to use and how to implement it is very subtle really. For example, some say Euler method is non-conservative, that in this particular case it would end up with ever increasing velocity no matter how high the resolution is set, but others disagree. They are obviously not using the same implementation, and these different implementations of what is supposed to be the same method make everything that much more unclear.

This is a huge topic on its own. It's relevant here for the unfortunate reason that numerical integration doesn't necessarily have to match the reality. Ideally the line segments should be infinitesimal, and then things like instantaneous acceleration or instantaneous velocity make some sense, but practically that's not possible, it has to be approximated and averaged, somehow. Mathematically integrals tell us what needs to be integrated, but they don't really say how. There is more than one way, they produce different results, and it is not quite clear which one is the right one for any particular application. Sadly, integration by itself is not sufficient, arguments like these should be settled with or along some actual experiment and measurement data.

#### milesyoung

Sadly, integration by itself is not sufficient, arguments like these should be settled with or along some actual experiment and measurement data.
Numerical solutions aside, you're saying we still haven't settled if the magnetic force component of the Lorentz force can do work on a point charge?

Edit: It's curious that your forum account was created the day after the OP made his last post. You wouldn't happen to be affiliated in any way?

Last edited:

#### Jabbu

Numerical solutions aside, you're saying we still haven't settled if the magnetic force component of the Lorentz force can do work on a point charge?

Edit: It's curious that your forum account was created the day after the OP made his last post. You wouldn't happen to be affiliated in any way?
I'm in game development, I couldn't care less about work done. It's integration algorithm that is interesting to me. It's important in three ways: physics calculation, animation, and networking for dealing with time delays and synchronisation. There are many ways how to go about it, some better than others.

What I'd like to see is how different integration methods produce different results compared to practical experiments, like cyclotron or CRT. Usually the equations used for practical set ups like these are generalized, I haven't seen anyone actually uses integrals to really compute electrons path step by step along the trajectory.

#### Nugatory

Mentor
What I'd like to see is how different integration methods produce different results compared to practical experiments, like cyclotron or CRT. Usually the equations used for practical set ups like these are generalized, .
Ah - that makes more sense. (if you read this thread from the beginning, you'll see why everyone is just a wee bit sensitive to attacks on the correctness of the work integral....)

In this case, the trajectory calculation is well-understood and anyone who has ever observed the tracks of charged particles in a magnetic field (something that happens daily in labs across the world) will attest that DaleSpam's spiral trajectory is qualitatively reasonable. We aren't looking at a pathology of numerical methods here.

#### Dale

Mentor
The question is what integration method is actually implemented by Wolfram for those functions.
Their documentation is pretty extensive and the software itself is well tested.

I don't think that any of your concerns are problems here. This is a pretty tame equation and the output follows all of the known behaviors. Looking at the input and the output the numerical solution seems good, both quantitatively and qualitatively.

This is a huge topic on its own. It's relevant here...
It is indeed relevant, but not a problem here. I always check the results of numerical techniques against all of the constraints of the problem that I can think of.

Sadly, integration by itself is not sufficient, arguments like these should be settled with or along some actual experiment and measurement data.
Maxwell's equations are quite well validated by experiments and measurements.

Are you suggesting that we should never attempt to make or use any physical theory but should only collect experiment and measurement data for every possible combination of every possible scenario and not make any statements about situations for which we cannot simply look up the measured result?

#### milesyoung

I couldn't care less about work done.
Alright, I read your post as you saying the fact that the speed of the electron is constant is perhaps just an error from the numerical method used to simulate its trajectory.

For a brief time I felt my forehead vein starting to pulsate again.

#### Jabbu

Their documentation is pretty extensive and the software itself is well tested.

I don't think that any of your concerns are problems here. This is a pretty tame equation and the output follows all of the known behaviors. Looking at the input and the output the numerical solution seems good, both quantitatively and qualitatively.
I'm not using Mathematica, I don't know from the names of those functions whether they imply some specific or default integration method. I'm not concerned, just want to know what method is being used. Usually I'd expect the most simple Euler method would be default as it is the fastest and applicable in many situations, but supposedly not this one. Because it's the fastest method its preferred choice, but I'm not sure about its shortcomings. I would like to know if your integration was done through some variant of the Euler method because it would mean it can be implemented to be conservative after all.

Are you suggesting that we should never attempt to make or use any physical theory but should only collect experiment and measurement data for every possible combination of every possible scenario and not make any statements about situations for which we cannot simply look up the measured result?
I'm working towards exactly that goal. But I can't just use some other software, I have to write it from scratch. To make sure I know what I'm doing I need to closely examine how different integration methods work, and more importantly why and when they do not work.

#### Nugatory

Mentor
I'm working towards exactly that goal. But I can't just use some other software, I have to write it from scratch. To make sure I know what I'm doing I need to closely examine how different integration methods work, and more importantly why and when they do not work.
Start a new thread...
You're asking a very different question than what this thread started with, and the only reason anyone is even working with numerical integration in this thread is that a previous poster refused to accept the proposition that if $f(x)=0$ everywhere then any integration of $f(x)$ over any range whatsoever has to come out zero as well.

#### johana

The length of the path is:

$$\int_0^1 |v(t)| dt = 4$$

So the path is indeed 4 m traveled at a constant speed of 4 m/s.

Here is an image of the path.
What magnitude is the force? Is it because the path is circular that no work is done? What if the magnetic field is not uniform and instead of circles the electron ends up wiggling around differently? What about two stationary permanent magnets that snap together after we let them go, is any work done then?

#### Dale

Mentor
I'm working towards exactly that goal.
Frankly, I would actively oppose that goal, I see nothing of value in it. The whole purpose of science is the production of generalizable models of nature, aka theory. If you get rid of theory then you are no longer doing science, any more than if you get rid of experiment.

Last edited:

#### Nugatory

Mentor
What magnitude is the force? Is it because the path is circular that no work is done? What if the magnetic field is not uniform and instead of circles the electron ends up wiggling around differently?
No. The key point is that the magnetic force is always perpendicular to the velocity of the charged particle (by $\vec{F}=\vec{B}\times{q}\vec{v}$) so $\vec{F}\bullet\vec{v}$ is always zero.

What about two stationary permanent magnets that snap together after we let them go, is any work done then?
That's a different problem than the one we're discussing in this thread, which is about a charged particle moving in a magnetic field.

#### Jabbu

That's a different problem than the one we're discussing in this thread, which is about a charged particle moving in a magnetic field.
Very interesting thing about it is that it can be simplified to two electrons going around in circles within two parallel planes one above the other. Now beside the centripetal magnetic force that makes them go around in circles there is one more magnetic force, orthogonal to their orbital planes, and actually moves them closer or further apart, if it was not for their electric fields which would dominate and move them apart in any case. But the faster the electrons go the greater their magnetic field is, so I suppose at some point the magnetic attraction could even overcome their electric repulsion.

#### Dale

Mentor
What magnitude is the force?
The magnitude of the force oscillates between about 8.30E-28 N and 8.42E-28 N as shown in the attached image.

What if the magnetic field is not uniform and instead of circles the electron ends up wiggling around differently?
The magnetic field in this problem is not uniform and as a result the electron is not wiggling around in a circle. The magnetic field is slightly stronger near the dipole than away from it, so the force is slightly higher there. As a result, the electron's path turns slightly sharper near the dipole and slightly less sharp away from the dipole. That is the reason why it does not complete a circle, but "drifts" slightly with each pass.

What about two stationary permanent magnets that snap together after we let them go, is any work done then?
Yes, but the work is E.J, as always.

#### Attachments

• 14.9 KB Views: 290

#### AlephZero

Homework Helper
Frankly, I would actively oppose that goal, I see nothing of value in it. The whole purpose of science is the production of generalizable models of nature, aka theory. If you get rid of theory then you are no longer doing science, any more than if you get rid of experiment.
Jabbu is developing computer ganes, not doing science. Don't let terminology like "physics engine" mislead you.

#### johana

The magnitude of the force oscillates between about 8.30E-28 N and 8.42E-28 N as shown in the attached image.

The magnetic field in this problem is not uniform and as a result the electron is not wiggling around in a circle. The magnetic field is slightly stronger near the dipole than away from it, so the force is slightly higher there. As a result, the electron's path turns slightly sharper near the dipole and slightly less sharp away from the dipole. That is the reason why it does not complete a circle, but "drifts" slightly with each pass.

Yes, but the work is E.J, as always.
Does that mean no work done at all? How do you know from E.J is it electric or magnetic force doing the work?

#### Dale

Mentor
Does that mean no work done at all? How do you know from E.J is it electric or magnetic force doing the work?
In this problem there is no E so yes, E.J implies that there is no work done at all. Other problems may have work done, but if you look carefully there is always an E.J involved.

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving