  We propose a method of calculation of the power spectrum of cosmological
perturbations by means of a direct numerical integration of hydrodynamic
equations in the Fourier space for a random ensemble of initial conditions with
subsequent averaging procedure. This method can be an alternative to the
cosmological N-body simulations. We test realizability of this method in case
of one-dimensional motion of gravitating matter pressureless shells. In order
to test the numerical simulations, we found an analytical solution which
describes one-dimensional collapse of plane shells. The results are used to
study a nonlinear interaction of different Fourier modes.
