# What happens when we use the Virial Theorem iteratively?

Say I want to model the formation of structure in the Universe as a series of events whereby already virialised systems are brought together to create a larger virialised system.

I will take the problem of $N$ such identical systems as an example, each with

\begin{equation} K_i = \frac{1}{2} m_i \langle v_i^2 \rangle \end{equation} and \begin{equation} W_i = -\frac{Gm_i^2}{r_i}, \end{equation}

such that $2K_i + W_i = 0$ and so $E_i = -K_i = W_i/2$.

What happens to the overall kinetic energy $K$, potential energy $W$ and final energy $E$ after each new system is added, and would this be different if all the systems were brought together at once?

Since energy must be dissipated by some mechanism at each iteration in order to regain the virialised state with a change in overall kinetic and potential energy due to combining the systems, it would seem to me that these final quantities will depend on the way in which the systems are combined.