# Does Ipopt have the option to do numerical derivatives for non-differentiable function?

**URL:** <https://discourse.julialang.org/t/does-ipopt-have-the-option-to-do-numerical-derivatives-for-non-differentiable-function/35887>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [March 12, 2020, 3:56pm UTC](https://discourse.julialang.org/t/does-ipopt-have-the-option-to-do-numerical-derivatives-for-non-differentiable-function/35887 "2020-03-12T15:56:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxjroger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zxjroger/32/11826_2.png) [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Post date:** [March 12, 2020, 3:56pm UTC](https://discourse.julialang.org/t/does-ipopt-have-the-option-to-do-numerical-derivatives-for-non-differentiable-function/35887/1 "2020-03-12T15:56:26Z")

</div>

I am trying to compare different solvers/routines on minimizing the objective function of simulated method of moments. This objective function is non-differentiable. I wonder if there is a setting in Ipopt to do numerical derivatives?

The method of differentiation in Ipopt is automatic differentiation. My understanding is that it does not apply to non-differentiable functions. So should I code the numerical Jacobian and Hessian by myself using the package [FiniteDiff.jl](https://johnmyleswhite.github.io/FiniteDiff.jl/), then register these functions as described in [JuMP documents](https://www.juliaopt.org/JuMP.jl/stable/nlp/#User-defined-Functions-1)?

In general, my question is similar to this [post](https://discourse.julialang.org/t/latest-recommendations-for-global-optimization/17718).
