# MethodError: no method matching in JuMP

**URL:** <https://discourse.julialang.org/t/methoderror-no-method-matching-in-jump/66543>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [August 17, 2021, 11:50am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-in-jump/66543 "2021-08-17T11:50:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [August 17, 2021, 8:09pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-in-jump/66543/2 "2021-08-17T20:09:34Z")

</div>

You can’t use arbitrary functions in JuMP. You need to use a user-defined function:  
[https://jump.dev/JuMP.jl/stable/manual/nlp/#User-defined-Functions](https://jump.dev/JuMP.jl/stable/manual/nlp/#User-defined-Functions)

But this will only work if it’s possible to automatically differentiate the function. I don’t know if that works with Interpolations.jl.

---

_[View the full topic](https://discourse.julialang.org/t/methoderror-no-method-matching-in-jump/66543)._
