Package edu.rit.hyb.antimatter provides the Antimatter Simulation, an example of an N-body problem.

The Antimatter Simulation program calculates the motion of a number of antiprotons moving in a two-dimensional plane. The antiprotons have equal, negative charges. Each antiproton experiences a repulsive force from every other antiproton that is directly proportional to the product of the antiprotons' charges and is inversely proportional to the square of the distance between the antiprotons. The antiprotons are surrounded by an "antiproton trap" -- a square metal cage with sides of length R, extending from coordinates (0,0) to (R,R) in the (x,y) plane. The antiproton trap has a negative charge. Thus, each antiproton experiences a repulsive force away from the sides of the trap. Since the antiprotons are repelled from the sides of the trap, the antiprotons will never touch the trap and matter-antimatter annihilation will not happen.

The Antimatter Simulation program maintains each antiproton's position and velocity. The program calculates the positions and velocities as a function of time by doing a series of discrete time steps. At each time step, the program calculates the total force on each antiproton (repulsive forces from all other antiprotons plus repulsive forces from the sides of the trap), updates the velocity based on the force, and updates the position based on the velocity and force:
V' = V + F Δt
P' = P + V Δt + 1/2 F Δt2
where F is the vector force on the antiproton, V is the antiproton's vector velocity before the time step, V' is the antiproton's vector velocity after the time step, P is the antiproton's vector position before the time step, P' is the antiproton's vector position after the time step, and Δt is the size of the time step. (These formulas represent the first few terms in the Taylor series expansions for velocity and position as a function of time.)

The hybrid SMP cluster parallel programs in this package use Parallel Java (PJ) in package edu.rit.pj.