Analysis and simulation of virtual cathode oscillations