A detailed study of the quadrupole ion trap