Equilibrium theory of a pressure swing adsorption process