Nonlinear expression without scalar expressions

Hi, I’ve read that nonlinear optimization has limited support. Unfortunately, my objective function cannot be written with scalar expressions and my matrix variable is at least 1000x1000 and I need to call several functions to build my objective function (the variable is a support function, that I need to differentiate, and construct a parametric function that I have to integrate…). The code required to compute aireSurface(h) or volumeSurface(h) has 200 lines.

My code is something like that

    model = Model(Ipopt.Optimizer)
    register(model, :aireSurface, 1, aireSurface; autodiff = true)
    set_optimizer_attribute(model, "print_level", 1)
    @variables(
        model,
        begin
        h[1:N,1:M]<=b/2.0
        end
    )
    @NLobjective( 
        model,
        Max,
        aireSurface(h)
    )
    @constraint(
        # convexity
        model,
        convexity(h) .>= 0
    )
    @constraint(
        # volume
        model,
        volumeSurface(h) == lambdaI*4.0/3.0*pi*((b/2.0)^3),
    )

Is there any workaround to do that ? Thanks

No, there is no work-around for JuMP.

You might want to try Nonconvex.jl instead: Getting started · Nonconvex.jl

But I will say, you have a black-box function with 1,000,000 variables. That’s going to be challenging to solve. Have you considered alternative approaches?