On the solution of the optimal control problem for thermal protection of the surface