  Self-gravitating systems are expected to reach a statistical equilibrium
state either through collisional relaxation or violent collisionless
relaxation. However, a maximum entropy state does not always exist and the
system may undergo a ``gravothermal catastrophe'': it can achieve ever
increasing values of entropy by developing a dense and hot ``core'' surrounded
by a low density ``halo''. In this paper, we study the phase transition between
``equilibrium'' states and ``collapsed'' states with the aid of a simple
relaxation equation [Chavanis, Sommeria and Robert, Astrophys. J. 471, 385
(1996)] constructed so as to increase entropy with an optimal rate while
conserving mass and energy. With this numerical algorithm, we can cover the
whole bifurcation diagram in parameter space and check, by an independent
method, the stability limits of Katz [Mon. Not. R. astr. Soc. 183, 765 (1978)]
and Padmanabhan [Astrophys. J. Supp. 71, 651 (1989)]. When no equilibrium state
exists, our relaxation equation develops a self-similar collapse leading to a
finite time singularity.
