Minimizing the entropy production in two heat exchangers and a reactor