# Motion of charged particle in magnetic field

1. Oct 19, 2011

### Sparky_

Greetings-

I'm playing with the differential equations to get the standard or classical solution for the circular motion of a charged particle in a magnetic field. I have some question on my math.

I'm doing this for fun - (just because)

Should I post this in the homework section. Does this type of question belong in the homework section?

Thanks
Sparky_

2. Oct 20, 2011

### elegysix

3. Oct 20, 2011

### Sparky_

Regarding the motion of a charged particle in a magnetic field –

I have said the magnetic field is in the y direction (By)

Using
$$F = q(v X B)$$

"X" = cross product

$$m\frac {dv}{dt} = -q(v X B)$$

I had a matrix and ended up with 2 differential equations

Below is my work -

I’m uncertain on how to resolve the constants – I do have the liberty to set the initial conditions

Once I get this method to work, I want to solve this again using Eigenvalues and Eigenvectors.

$$m\frac {d^2x}{dt^2} = -qB \frac{dz}{dt}$$
$$m\frac {d^2z}{dt^2} = qB \frac{dx}{dt}$$

Take time derivative of both sides (of eq. 1):
$$\frac {d}{dt} m\frac {d^2x}{dt^2} =\frac {d}{dt} -qB \frac{dz}{dt}$$

$$m\frac {d^3x}{dt^3} = -qB \frac{d^2z}{dt^2}$$

From equation 2:
$$\frac {d^2z}{dt^2} = \frac {qB}{m} \frac{dx}{dt}$$

Some algebra and apply Euler’s equation:
$$m\frac {d^3x}{dt^3} = \frac {(-qB)(qB)}{m} \frac{dx}{dt}$$
$$\frac {d^3x}{dt^3} = (\frac {(qB)}{m})^2 \frac{dx}{dt}$$
$$u= \frac {dx}{dt}$$

Use a substitution to reduce the order of the equation:

$$pick: u = e^{at}$$
$$u’ = ae^{at}$$
$$u’’ = a^2e^{at}$$
$$a^2e^{at} + (\frac {(qB)}{m})^2 e^{at} = 0$$
$$a^2 + (\frac {(qB)}{m})^2 = 0$$
$$a = + - (\frac {(qB)}{m})$$
$$u = e^{i\frac{qB}{m}t} + e^{-i\frac{qB}{m}t}$$
$$u = C1cos(\frac{qB}{m}) + iC2sin(\frac{qB}{m}) + C3cos(\frac{qB}{m}) – iC4sin(\frac{qB}{m})$$

$$u= \frac {dx}{dt}$$
$$dx = u dt$$
$$x = \frac{mC1}{qB}sin(\frac{qBt}{m}) - \frac{imC2}{qB}cos(\frac{qBt}{m}) + \frac{mC3}{qB}sin(\frac{qBt}{m}) + \frac{imC4}{qB}cos(\frac{qBt}{m})$$
$$x = (\frac{mC1}{qB} + \frac{mC3}{qB}))sin(\frac{qB}{m}t) – (\frac{imC2}{qB} + \frac{imC4}{qB})cos(\frac{qB}{m}t)$$

Now – I’m not sure on the steps below:
Is it correct to do the following:

$$\int{ \frac{d^2x}{dt^2}} = \int{ \frac{-qB}{m}\frac{dz}{dt}}$$
$$\frac{dx}{dt} = \frac{-qBz}{m}$$

$$z = -\frac{m}{qB}\frac{dx}{dt}$$

$$z = K1 \frac{qB}{m}cos() + K2\frac{qB}{m}sin()$$

Three questions:
1)
The big question -
Is my math correct – any gotcha’s? While I know what the correct answer is, I want to accurately work it out.

2)
Regarding the constants –

I have the freedom to say x = z = 0 at t=0.

There is some complication with the cos term at t=0 and gave x=z=0 – correct?

How do I get my constants set right?

3) Am I on the right path?

Once I’m sure this math is correct – next I want to rework this using eigenvalues / eigenvectors.

Thanks
-Sparky_

4. Oct 20, 2011

### elegysix

Ok, this is pretty complex. Let me start with how I approach the problem.

Write out the force equation, do the cross product, and find the remaining coupled DE's.
Substitute one into the other to find a DE in time. Substitute that solution into the other equation to solve the other variable as a function of time.

I find it easier to just integrate the coupled DE's with respect to the other variable, and get two equations in X, Vx, Z and Vz, instead of going to the 3rd order and doing reduction of order.

I think you made it a lot harder on yourself when you took the exponential functions and said they were equal to four trig functions with four unknowns in front.

you wrote

$u=e^{\frac{iqBt}{m}}+e^{\frac{-iqBt}{m}}$ and then u = $\frac{dx}{dt}$

If you had integrated from Xo to X, and t0 to t, without doing all the rest of that stuff, it would have been like this:

$\int dx=\int e^{\frac{iqBt}{m}}+e^{\frac{-iqBt}{m}} dt$

Giving $x-x_{0} = \frac{me^{\frac{iqBt}{m}}}{iqB} -\frac{me^{\frac{-iqBt}{m}}}{iqB}$ using $t_{0}=0$

Having seen Eulers formula, you should recognize that this is $x(t)=\frac{2mSin(\frac{qbt}{m})}{qB}+x_{0}$ assuming $t_{0}=0$ and voila! you've got a particular solution with the constants figured out already.

Finally, on the last part where you said you weren't sure about it, I think you're missing the 2nd DE. Either way, when you integrated, you didn't add a constant, and thats no good.

I find it much easier to just do definite integrals on everything, rather than worrying about solving for the constants later on. Plus you can look at your results and start crossing things out which are zeros while substituting in your IV's or BC's without doing any more work.

overall, you managed to get the answer, so props. the good thing about having unknown constants is that if you can figure them out, they will eat up any dropped negatives or simple algebra mistakes you made along the way.

Hope this helps!
austin

5. Oct 24, 2011

### Sparky_

Elegysix,

Thanks for the help.

I am going to “try” to fix / cleanup my attempt – I would like to post my cleanup and make sure I’m correct.

I’m doing this just for fun – many of my weeknights are booked – this little math practice my extend over several days.

I recall first doing this for real in school and for whatever reason this particular problem stands out as when things first starting to “click” – it’s where I actually saw how to apply differential equation tools I had been taught and my plasma professor kept making the problem more interesting by adding additional components.

Once I am convinced I have my mathematics “clean” – correcting the points you caught, I would like to redo the problem using a different differential equation technique (probably Eigenvalue / Eigenvectors) – again just for fun.

-Sparky_

6. Oct 26, 2011

### Sparky_

Elegysix,

I have duplicated your work for myself –

$$u = e^{i\frac{qB}{m}t} + e^{-i\frac{qB}{m}t}$$

$$u= \frac {dx}{dt}$$

$$\int{ dx} = \int{ u dt}$$

$$x – x0 = \frac{m}{iqB}e^{frac{iqBt}{m}} - \frac{m}{iqB}e^{frac{-iqBt}{m}}$$

$$x – x0 = \frac{m}{iqB}[cos() + isin( )] - \frac{m}{iqB}[cos() - isin( )]$$

Now for a question or 2:

I agree things cancel like this, but shouldn’t I also have a constant for each term like this:

$$x – x0 = \frac{m}{iqB}[C1*cos() + iC2*sin( )] - \frac{m}{iqB}[C3*cos() – iC4*sin( )]$$

I know examples from my Diff E. book place constants there in these cases.

Next question, I know from the answer is
$$(x - x0) = K1cos( ) + K2sin( )$$

(no formal solution, just told that is the answer and a few steps pointing to using tools from differential equations)

In the answer there is a cos term.

Should I have the constants for each cos and sin term and not cancel the cos terms out?

Thanks again
Sparky_

7. Oct 27, 2011

### elegysix

When you use definite integrals, there are no arbitrary constants needed. However, what we are solving for here is a particular solution - the general solution will contain a cosine term.

$\int dx = \int e^{i \frac{qBt}{m}} + e^{-i \frac{qBt}{m}} dt$

$x(t)-x_{0} = \frac {me ^{i \frac{qBt}{m} } }{iqB} - \frac {me ^{-i \frac{qBt}{m} } }{iqB}$ (using $t_{0}=0$)

using Euler's formula: $sin(kt) = \frac {e^{ikt} - e^{-ikt}}{2i}$ gives

$x(t)-x_{0}= \frac{2m Sin( \frac{qBt}{m})}{qB}$

which is a particular solution.

8. Oct 27, 2011

### Sparky_

Elegysix,

I'm not quite caught up with you.

Are we on the same page - I was asking about constants for the coefficients on each sin and cos term.

The C1, C2, C3, and C4

$$x – x0 = \frac{m}{iqB}[C1*cos() + iC2*sin( )] - \frac{m}{iqB}[C3*cos() – iC4*sin( )]$$

This would prevent the cos terms from canceling?

If I'm off here, what is my next step to get the cos term?

Thanks
-Sparky_

9. Oct 27, 2011

### elegysix

When you use definite integrals - evaluated at bounds, you do not introduce constants like the C1 you used. When you do indefinite integration, without evaluating it at the bounds, you have to use constants like that. We did not need them for what we did so far.

I substituted in a sin function for the exponentials, by Euler's formula. You can expand the exponentials into a sin and cos term like you have done, but you do not need to add constants like you've done. You will still end up with the same answer I gave before

if $e^{ix}=cos(x)+isin(x)$

then

$\frac{m e^{i \frac {qBt}{m} }}{iqB} - \frac{me^{i \frac {-qBt}{m} }}{iqB}= \frac{m}{iqB} [cos(\frac{qBt}{m})+isin (\frac{qBt}{m}) - cos(\frac{qBt}{m}) + isin(\frac{qBt}{m})]$

combining like terms gives the result

$x(t)-x_{0}= \frac{2m}{qB}sin(\frac{qBt}{m})$

like I showed before.
Based on your initial conditions, this is the solution for x(t). If you do not use initial conditions (meaning using indefinite integrals) the constants of integration will appear and the cosine terms might not cancel.

Last edited: Oct 27, 2011
10. Oct 28, 2011

### Sparky_

Elegysix,

I’m either there or I’m close.

So perhaps Within the notes I’m reading where the problem is set up and then just the answer is given as: x =K1*cos() + K2*sin() with no work shown, I can assume that solution was obtained with indefinite integrals?

Meaning in some old notes, I see the electron (or charged particle) and a B-field vector drawn and the Lorentz equation is written, the cross product is taken and the initial differential equation is set up.

Then the solution is given (sin + cos with coefficients).

From your help, without knowing the solution approach, I can assume he went with the indefinite integral since he has the coefficients and the cos term?

Thanks again
Sparky_

11. Oct 28, 2011

### elegysix

It may have just been a guess to the solution since he did not work it out. We did the work and you should be able to solve this for any similar initial conditions without worrying about what the person in your notes did.

I will say though that the magnetic field was chosen to drastically simplify this problem. If the magnetic field depends on time or position, this will become much, much harder to solve.

Theres a video by an MIT professor on youtube who covers this topic, the last 10 or so minutes of it he talks about the spiraling and does a demonstration if you're interested. heres the link

Last edited by a moderator: Sep 25, 2014
12. Oct 31, 2011

Thank You!!