Google Answers Logo
View Question
 
Q: Simulating electron trajectory in Van Allen belts ( No Answer,   2 Comments )
Question  
Subject: Simulating electron trajectory in Van Allen belts
Category: Science > Physics
Asked by: vincecate-ga
List Price: $50.00
Posted: 06 Dec 2003 11:32 PST
Expires: 07 Dec 2003 14:18 PST
Question ID: 284176
I am trying to simulate an electron bouncing around in the
Van Allen Belts, but the code (Java applet) is not working right yet.

Currently the electrons gain energy fast, and soon leave the Earth.
They are not supposed to gain any energy because the force is
supposed to be perpendicular to their velocity.

My Applet (run or modify samples 85 and 86) is at:
    http://spacetethers.com/spacetethers.html

The source (can get all or look at individual files) is at:
    http://spacetethers.com/simulator-source.html

They key files for this problem are:
    radiation.java   - main logic for force, acceleration, velocity
    vector3d.java    - 3D vector code -  add, scale, cross
    geomagnetic.java - magnetic field  code (comments and URLs at top)
    sampleinput.java - samples 85 and 86

I want to know where the bug is that causes electrons to gain energy,
and how to fix it.

Clarification of Question by vincecate-ga on 06 Dec 2003 11:43 PST
Just so you know it is not a lot of code, the line counts are:
     87     radiation.java
     72     vector3d.java
     74     geomagnetic.java

Also, Applet1.java is where the input is parsed and the radiation.java
object is made.  But since it is gaining energy while running, I don't
think the bug is in Applet1.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Simulating electron trajectory in Van Allen belts
From: racecar-ga on 07 Dec 2003 13:58 PST
 
You have to be careful with discrete time-stepping.  Unless the change
in velocity at each time step is infinitesimal in comparison with the
velocity itself, the speed after the time step will be greater than
the speed before, even though the change in velocity is perpendicular
to the velocity.  Think of a right triangle:

    /|
   / |
Vf/  |A*dT
 /   |
/____|
  Vo

The horizontal leg is Vo, the velocity before the time step, the
vertical leg is the change in velocity, dV = A*dT (note that dV is
perpendicular to Vo), and the hypotenuse is Vf, the velocity after the
time step.  You can see that Vf is larger than Vo.  Since the velocity
is larger, and the acceleration is proportional to the velocity, the
acceleration will be larger as well, and velocity will increase
exponentially with time.  If your code has a uniform magnetic field,
and no relativistic effects, this will result in a logarithmic spiral
path, when really it should be a circle.

I have not checked your code, but I suggest making the time step
smaller.  If this decreases the errors, then the problem is almost
certainly the one I've suggested.  If this turns out to be the case,
then you can either shrink the time step until the errors are
acceptable, or, better, use a more sophisticated time step method,
such as Runge-Kutta.  You can hugely increase the accuracy of your
code by timestepping forward by half a step to find the velocity
there, and use that velocity (and the magnetic field at that location)
to calculate the acceleration and displacement for the full time step.
Subject: Re: Simulating electron trajectory in Van Allen belts
From: vincecate-ga on 07 Dec 2003 14:18 PST
 
The accelerations are enormous, like 10^9 G.  So a proton going 
1/3 the speed of light moves in a circle with diameter of about 25 km
(L-value 1.5 and 60 MeV).

Because the acceleration is so high, the problem racecar-ga explained
is particularly bad.  So, yes, that is the problem.

Thanks.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy