  We study the critical behaviour of solutions to weakly dispersive Hamiltonian
systems considered as perturbations of elliptic and hyperbolic systems of
hydrodynamic type with two components. We argue that near the critical point of
gradient catastrophe of the dispersionless system, the solutions to a suitable
initial value problem for the perturbed equations are approximately described
by particular solutions to the Painlev\'e-I (P$_I$) equation or its fourth
order analogue P$_I^2$. As concrete examples we discuss nonlinear Schr\"odinger
equations in the semiclassical limit. A numerical study of these cases provides
strong evidence in support of the conjecture.
