The optimal design of pressure swing adsorption systems