Mathematics of Fire