# Solving a quadratic program inside a JuMP model solve

**URL:** <https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [May 3, 2018, 8:31pm UTC](https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690 "2018-05-03T20:31:32Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Juser](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Juser](https://discourse.julialang.org/u/Juser)\
**Post date:** [June 13, 2018, 3:06am UTC](https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690/15 "2018-06-13T03:06:37Z")

</div>

It could be something with numeric error or tolerances as @odow suggested. Alternatively, you can solve the interior optimization problem when doing the function eval for the econometric problem and then either compute the analytic gradient of the econometric objective function by hand (since the argmax of your interior function should be easy to differentiate because of the envelope theorem). If other parts of your function are better handled by Automatic Differentiation, you can do the differentiation manually for your argmax and overwrite/overload that function when the inputs are duals. See, for example, [this post](https://discourse.julialang.org/t/automatic-differentiation-slow-slower-than-finite-differences/11209/14).

---

_[View the full topic](https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690)._
