Analytic and Numeric Solutions of Discretized Constrained Optimal Control Problem with Vector and Matrix Coefficients