edu.rit.clu.antimatter
Class AntiprotonAni
- java.lang.Object
-
- edu.rit.clu.antimatter.AntiprotonAni
-
public class AntiprotonAni extends java.lang.ObjectClass AntiprotonAni is a sequential program that calculates the positions of the antiprotons as a function of time and displays an animation on the screen. Each antiproton experiences a net repulsive force from all the other antiprotons. Each antiproton also experiences a force due to a magnetic field perpendicular to the plane in which the antiprotons move.Usage: java edu.rit.clu.antimatter.AntiprotonAni seed R dt steps N
The program:
- Initializes a pseudorandom number generator with seed.
- Generates N antiprotons positioned at random in the square from (0.25R,0.25R) to (0.75R,0.75R).
- Sets each antiproton's initial velocity to 0.
- Displays a GUI showing the antiprotons' positions in the square from (0,0) to (R,R). The total momentum of all the antiprotons is also shown.
- Performs steps time steps and updates the GUI. Each time step is dt.
- Repeats until the GUI is closed or the program is externally terminated.
The GUI window looks like this:
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG