This paper develops a numerical technique for solving the problem of periodic ferroresonant overvoltages in a power system. The system is modeled as a set of nonlinear ordinary differential equations, whose periodical solutions are found by a numerical algorithm based on Galerkin's method. It is shown that this approach takes into account the various aspects of ferroresonance phenomena, i. e. harmonic as well as even or odd order subharmonic oscillations. Results computed by this technique are presented and discussed.