A Numerical Approach for Fractional Optimal Control Problems by Using Ritz Approximation