1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simulating charge deflection in magnetic field

  1. Nov 14, 2004 #1
    I eventually want to simulate cosmic ray propagation in a random magnetic field, but will start with a particle of some charge in a uniform field.

    In order to simulate it, what I think needs to be done is to create a 3d array of points, with a value for the magnetic field magnitude and direction (all the same in a uniform field) at each point, and then define one of the points as being the starting point for a charge with a specific velocity and direction.

    Does this sound like the right way to go so far?

    So as the charge moves through the uniform magnetic field, it should trace out a circular path, correct?

    I'm having trouble understanding a few things:

    How is the particle's position and velocity defined in a discrete array of points such as this? Because the magnetic force is only evaluated (and thus only applied) if a particle hits one of the points, it seems like i could assign a path for the particle that would avoid most of the points in the array, thus giving an inaccurate result. Is this making any sense? I'm really confused about this.

    How does the magnetic field vector at a given point in the array actually change the particle's direction? According to F=qVxB, the force will be perpendicular to the direction of the velocity, but it seems like the force is instantaneous, so the acceleration is instantaneous. How is the new direction of the velocity determined at this point? :confused:

    Thanks.
     
  2. jcsd
  3. Nov 14, 2004 #2

    Tide

    User Avatar
    Science Advisor
    Homework Helper

    I don't think you would want to set up an array for all "points" in space. Rather, you deal with individual particles and compute their trajectories. If the magnetic field is uniform then you can explicitly write the trajectories and it becomes a simple matter of "plotting" them. Otherwise, you may have to resort to numerical solutions for the trajectories.

    You accomplish that by finite differences and it will look something like this for each particle:

    [tex]\vec v_{i+1} = \vec v_i + q \vec v_i \times \vec B(\vec x_i) \Delta t[/tex]

    [tex]\vec x_{i+1} = \vec x_i + \vec v_i \Delta t[/tex]

    That's the basic idea but you will have to refine the process since numerical errors tend to grow rather quickly. A good text on numerical methods will provide what you need.
     
  4. Nov 14, 2004 #3
    How could this be done with a randomly distributed magnetic field, though?

    The goal is to simulate cosmic ray propagation in the intergalactic magnetic field, which I don't think can simply be written down as B = ....


    Thanks.
     
    Last edited: Nov 14, 2004
  5. Nov 14, 2004 #4

    Tide

    User Avatar
    Science Advisor
    Homework Helper

    Whatever the magnetic field is the particle trajectories will be dictated by the Lorentz force. I think that before you proceed you should try to develop a clearer idea of exactly what it is that you want to accomplish. Also, what do you mean when you say "randomly distributed magnetic field?" You'll certainly require some knowledge of the fields before attempting any kind of simulation.
     
  6. Nov 14, 2004 #5
    I've just been told that the magnetic field will be randomly distributed. I don't know what that means either. My first thought was that it would have to be done as I originally stated, with random vectors at points in an array, but that doesn't seem right.

    In the equations you give, [tex]\Delta t[/tex] is a constant, correct? A timestep, I guess. Aren't the units on the velocity equation incorrect? Should the second term be divided by the mass of the particle?


    Also, the magnitude of the velocity doesn't change, only the direction, correct? Does that agree with your iterative velocity equation?
     
    Last edited: Nov 14, 2004
  7. Nov 14, 2004 #6

    Tide

    User Avatar
    Science Advisor
    Homework Helper

    brian,

    Yes, the mass should appear there! I was focussing on the form you would use for numerical integration of the equations of motion. Also, the time step would ordinarily be a constant.
     
  8. Nov 14, 2004 #7
    How could I fix the velocity equation so that the magnitude remains constant, but the direction changes? Would it work if I used the velocity equation you give, divide it by its magnitude, and multiply that unit vector by the original velocity's magnitude?

    So, based on your equation, it would be [tex]\Vec v_{new} = |\Vec v_{i}| * (\Vec v_{i+1} / |\Vec v_{i+1}|)[/tex]
     
  9. Nov 14, 2004 #8

    Tide

    User Avatar
    Science Advisor
    Homework Helper

    The Lorentz force itself will assure that the speed remains constant. You don't have to do anything special. However, since it is a numerical solution, you may use the fact that the speed is constant as a check on your algorithm! If you find the speed of your simulated particle changing then something is amiss with your algorithm.
     
  10. Nov 14, 2004 #9
    But, in your velocity equation, you have v_i being added to another vector that isn't zero, so the direction and magnitude will change. For example, if v_i = <1,0,0> and the VxB part gives <0,1,0>, the new vector is <1,1,0> and its magnitude is no longer 1 but sqrt2.
     
  11. Nov 14, 2004 #10

    Tide

    User Avatar
    Science Advisor
    Homework Helper

    First, realize that those are vector equations. Also, the vxB part does NOT give <0 1 0>. You neglected the magnitude of the quantity including the delta t part - which is presumed "small!" Obviously, each component of the velocity will change with time but the speed will not.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Simulating charge deflection in magnetic field
Loading...