Tropical limit in statistical physics