Numerical method for solving the optimization problem of trajectory control and formation maintenance by a group of autonomous UAVs with predictive models