A Combination of Variational and Penalty Methods for Solving a Class of Fractional Optimal Control Problems