The passage of several ensembles of ions through an ideal electric quadrupole, hexapole, and octopole operating in the rf-only mode has been simulated on a computer by solving numerically the appropriate equations of motion for each ion in the ensemble. The molecular weight was chosen to be 50, 145, and 1000 u in the different ensembles. The remaining assumptions are as follows. (1) The initial distribution of transverse velocities of ions is Maxwellian and corresponds to 500 K. (2) The initial positions of ions having different initial velocities are randomly and uniformly distributed at the entrance hole. (3) The quadrupole, hexapole, and octopole fields are generated by pure a.c. voltages (rf-only mode) whose amplitudes are either identical or close to the value set by the upper limit of stability for the device in question. The following quantities were calculated for the ensembles of ions: (1) transverse displacements, (2) transverse kinetic energies, and (3) cross-sections of the ion beam along the beam axis. The results show that the electric hexapole and octopole are more suitable for transporting and confining ion beams than is the quadrupole.