Catastrophe theory and stellar systems