The role of the second Painlev transcendent in nonlinear optics