Initial conditions in non-equilibrium statistical mechanics: I. The generation of solitary waves from discontinuities