  In the present paper an optimal control problem for a system of
differential-algebraic equations (DAEs) is considered. This problem arises in
the dynamic optimization of unsteady district heating networks. Based on the
Carath\'eodory theory existence of a unique solution to the DAE system is
proved using specific properties of the district heating network model.
Moreover, it is shown that the optimal control problem possesses optimal
solutions. For the numerical experiments different networks are considered
including also data from a real district heating network.
