NLopt Constraint

mary
Tue, 28 May 2024 16:19:38 +0000
Optimization (Mathematical)

Hi, I am using Nlopt for optimization. my objective function depends on three variables like x1,x2,x3 also I have a constraint which depends on all three variable. I want to do the optimization just for x3 variable. should i include the gradients of the constraint wrt x1 and x2 in my constraint function or just wrt x3?

function wf_p(p0::Vector, gradw::Vector; r, β, η, fem_params)
    if length(gradw) > 0
        gradw[:] = #grad wrt x3
    end
    return wf
end

5 posts - 3 participants