Question: Error, (in Optimization:-NLPSolve) object too large

I wrote a procedure that solves an optimal control problem governed by volterra integral equation. This procedure  takes N , number of lagrange interpolating polynomials, as parameter and call NLPSolve function .the problem is: for N>10 maple displays this Error: Error, (in Optimization:-NLPSolve) object too large. How can I fix this problem?

here is my procedure:

Please Wait...