Hi all,

I know that it is possible to use Ipopt in Julia without using JumP. For this the user has to define eval_f (objective function), eval_g (nonlinear constraints), eval_grad_f (gradient of the objective function) and eval_jac_g (jacobian of the nonlinear constriants).

Well, defining eval_f and eval_g is not a problem. Also I use “forwardDiff.gradient” to evaluate eval_grad_f, which has worked okay. Is there a way to define eval_jac_g (ofcourse without doing it analytically) with syntax and arguments that fits Ipopt? Let us assume we have two nonlinear constraints.

For example:

function eval_jac_g(x, mode, rows, cols, values)

if mode == :Structure

# Constraint

rows[xx] = 1; cols[xx] = 1

and so on…

else

# Constraint

values[xx] = x[2]*x[3]*x[4] # just an example

and so on…

end

end

Is there a way to use “forwardDiff.hessian” to fill up rows and cols and values?

Thanks.