A theory of sorption hysteresis in biological materials