  In this paper, we consider the problem of optimizing the trajectory of an
Unmanned Aerial Vehicle (UAV) Base Station (BS). We consider a map
characterized by a traffic intensity of users to be served. The UAV BS must
travel from a given initial location at an initial time to a final position
within a given duration and serves the traffic on its way. The problem consists
in finding the optimal trajectory that minimizes a certain cost depending on
the velocity and on the amount of served traffic. We formulate the problem
using the framework of Lagrangian mechanics. When the traffic intensity is
quadratic (single-phase), we derive closed-form formulas for the optimal
trajectory. When the traffic intensity is bi-phase, we provide necessary
conditions of optimality and propose an Alternating Optimization Algorithm that
returns a trajectory satisfying these conditions. The Algorithm is initialized
with a Model Predictive Control (MPC) online algorithm. Numerical results show
how we improve the trajectory with respect to the MPC solution.
