# JuMP Unable to register the function

**URL:** <https://discourse.julialang.org/t/jump-unable-to-register-the-function/124006>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, optimization\
**Created:** [December 20, 2024, 4:36am UTC](https://discourse.julialang.org/t/jump-unable-to-register-the-function/124006 "2024-12-20T04:36:35Z")\
**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:** [December 21, 2024, 12:01am UTC](https://discourse.julialang.org/t/jump-unable-to-register-the-function/124006/2 "2024-12-21T00:01:30Z")

</div>

Hi @jgr, I’ve moved this to the optimisation section.

At a guess (I can’t run your code so I can’t confirm), you need `params::Vector{<:Real}` instead of `params::Vector{Real}`. The distinction is subtle, see:

```Julia
julia> x = [1.0, 2.0]
2-element Vector{Float64}:
 1.0
 2.0

julia> x isa Vector{Real}
false

julia> x isa Vector{<:Real}
true

```

If that doesn’t work, you need to ensure that your function can be differentiated with ForwardDiff.jl.

I’d also encourage you to adopt the newer syntax for nonlinear modelling: [Nonlinear Modeling · JuMP](https://jump.dev/JuMP.jl/stable/manual/nonlinear/#jump_user_defined_operators)

For details, see [ANN: JuMP v1.15 is released](https://discourse.julialang.org/t/ann-jump-v1-15-is-released/103875)

---

_[View the full topic](https://discourse.julialang.org/t/jump-unable-to-register-the-function/124006)._
