Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had originally asked this question on math overflow and it was suggested that I ask it here.

So I know that a force will change the magnitude of velocity if it is at an angle other that 90 degrees. If the force is perpendicular to the velocity it will cause the path of the object to curve in a circular motion and the magnitude will remain constant. My problem is that that is all I know.

I'm working on a program to model a charged particle in a magnetic field. I'm using the equation for the Lorentz force to calculate the force on the particle but I don't know where to go from there. I have searched online with no success. All I can find is a general description of how a force will change velocity.

My question is how does a force vector affect a velocity vector mathematically and how can I use a known force and velocity to determine a new velocity?

share|cite|improve this question
Newton's second law is what you're looking for =) – Physicsworks Nov 16 '11 at 8:29
up vote 6 down vote accepted

I'm surprised you haven't found this information online because the equation is one of the most basic in all of physics:

$$\mathbf{F} = m\mathbf{a} = m\frac{\mathrm{d}\mathbf{v}}{\mathrm{d}t}$$

(bold represents a vector). For an application like yours, it will be more useful to rearrange this in the form of an evolution equation

$$\frac{\mathrm{d}\mathbf{v}}{\mathrm{d}t} = \frac{\mathbf{F}(\mathbf{v}, t)}{m}$$

There are two ways to handle this.

  1. If the magnetic field configuration is known and is given by a simple function, you may be able to solve the evolution equation analytically. In that case, just program that solution into your code and have the program calculate the position of the particle at each time.
  2. In general, that is not practical, so you will have to investigate the field of numerical integration. Here is a primer: as a crude method of solution, you can replace the derivative operator with a finite difference operator, e.g. for the $x$-component:

    $$\frac{\mathrm{d}v_x}{\mathrm{d}t} \to \frac{v_x(t + \delta t) - v_x(t)}{\delta t}$$

    Plugging this into the evolution equation, you can rearrange it to

    $$v_x(t + \delta t) = v_x(t) + \frac{1}{m}F_x(v_x(t), v_y(t), v_z(t), t)\delta t$$

    Since you have a formula for calculating $F_x$ as a function of $\mathbf{v}$ and $t$, you can use the $x$-velocity at any given time step to calculate an approximation to the $x$-velocity at the next time step, and similarly for the other components. This is called the Euler method for numerical integration. Although it's easy to understand, it's highly unstable - that is, it becomes very inaccurate very quickly, because calculating the velocities and forces only at the beginning of each time step (as opposed to, say, the beginning and end and taking an average) leads to errors that accumulate at each time step.

    There are more sophisticated methods of numerical integration which arrange for the errors to largely cancel out by calculating values of $F_x$ within the time step. Whatever programming language or framework you are using, there is probably a scientific computation library that includes a numerical integrator, which you should look into using. That sort of thing is beyond the scope of this site, however. (Try searching on Stack Overflow)

share|cite|improve this answer
I used a method similar to that and it worked good when the force was not perpendicular. when the force is perpendicular the velocity it changes magnitude of the velocity (this should not happen). This happens when I add the initial velocity to to the change in velocity over the interval. How can I add the vectors to alter the direction without affecting the magnitude? – Falko Nov 16 '11 at 18:07
That's the sort of thing which I was saying is largely outside the domain of this site. But as a first step, make sure you're using a stable integrator (Runge-Kutta 4, in most cases). Beyond that, you can try something like rescaling the magnitude of the velocity after each step, but that would introduce its own errors, and I'm not sure if they would be better or worse than what you're currently doing. – David Z Nov 16 '11 at 18:23
Thank you so much for your help. I was able to get it all working. I just projected the original velocity onto v(t+δt) and then it worked as expected. :) – Falko Nov 16 '11 at 20:51

protected by Qmechanic Mar 7 at 14:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.