# For MathProgBase Interface, quadprog function. How can I get an optimal status when limiting iteration

**URL:** <https://discourse.julialang.org/t/for-mathprogbase-interface-quadprog-function-how-can-i-get-an-optimal-status-when-limiting-iteration/18959>\
**Category:** General Usage\
**Created:** [December 24, 2018, 10:09am UTC](https://discourse.julialang.org/t/for-mathprogbase-interface-quadprog-function-how-can-i-get-an-optimal-status-when-limiting-iteration/18959 "2018-12-24T10:09:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balance37](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@Balance37](https://discourse.julialang.org/u/Balance37)\
**Post date:** [December 24, 2018, 10:09am UTC](https://discourse.julialang.org/t/for-mathprogbase-interface-quadprog-function-how-can-i-get-an-optimal-status-when-limiting-iteration/18959/1 "2018-12-24T10:09:10Z")

</div>

Hi, I was trying to use the quadprog(objective vector, Hessian matrix, A, sense, b, lower bound, upper bound, solver) function according to this link  
[https://mathprogbasejl.readthedocs.io/en/latest/quadprog.html](https://mathprogbasejl.readthedocs.io/en/latest/quadprog.html)

It returns an instance of the type:

type QuadprogSolution  
status  
objval  
sol  
attrs  
end

If “status = Optimal”, objval, sol and attrs will have values.

I need to limit the iterations of the solver to 100, x = quadprog(f,H,Aeq,‘=’,beq,lb,ub,IpoptSolver(max\_iter=100))  
but in this case, the status = UserLimit, and objval, sol and attrs won’t have values.

Can someone help with this? Thank you!
