Phase transition approach to detecting singularities of PDEs