Originally Posted By: paul
your program has a set number of 4000 that reads momentum added by accelerator , this number should be 8000


That number means the momentum added to the pipe (and subtracted from the mass). So they both get 4000 but in different directions.