Simultaneous optimization and heat integration of chemical processes