Simulations of the dynamics of ions trapped in a Paul trap with terms in the potential up to the order 10 have been carried out. The power series method is used to solve numerically the equations of motion of the ions. The stability diagram has been studied and the buffer gas cooling has been implemented by a Monte Carlo method. The dipole excitation was also included. The method has been applied to an existing trap and it has shown good agreement with the experimental results and previous simulations using other methods.