The mathematics of natural catastrophes