Invia SMS: Singularity Theory for Nonlinear Optimization Problems