Optimal catalyst activity profiles in pellets. 3. The nonisothermal case with negligible external transport limitations