Optimization and inverse problems in heat transfer