Optimization with complex requirements

My optimization problem can be simplified as follows.
A vector of coefficients x has an upper an lower bound for each element.
μ is a function of the elements of x that itself has an upper and lower bound.
And μ has an error that is also a function of x that we want to minimize.

I’ve made an attempt with both Optim.jl and JuMP.jl with simplified versions of my problem since neither seems to easily accept complex objectives like μ needing to be in a certain range.

To be a little bit more specific regarding my problem, I’m designing a measurement device and the error of the resultant (μ) depends on the dimensions of the device and I’m trying to find the optimal values for these dimensions. The μ should be in a certain range since those are the requirements.

It feels like Optim and JuMP should work for this. Can you give more details, preferrably with code to go along with them.

Another note, if μ is a function of x, then the bounds on μ are redundant, since it is already determined. If the bounds are on a noisy μ' then it is probably a good idea to have μ' as a parameter and minimize the tension between μ and μ'

I don’t understand why the bounds on μ are redundant. In my case, the bounds on x can give μ significantly outside the desired range. Which is why I’m trying to optimize x.

I think Optim.jl can only minimize an objective function and thus can’t also “reject” an invalid μ. JuMP.jl may be able to do these things but my attempt seems to have failed because the solvers I tried can’t take multiple objectives. And I couldn’t figure out any other solvers.

I don’t know what it means to minimize the “tension” between μ and μ' but it sounds like we’re inserting a dependent parameter to optimize for? If so that might solve the problem.

A code example of what I’ve tried is something like

w_μ(x) = norm(dμdx(x) .* w_x)
lower = [0.001, 0.002, 0.003]
upper = [0.050, 0.012, 0.013]
opt = optimize(w_μ, lower, upper, [0.010, 0.005, 0.008])
Where w_x is the error of x and is constant.
I’ve been ignoring the constraint on μ since I don’t know how to implement them into Optim.jl.
JuMP.jl threw an error when I tried to give it the complex w_μ objective so none of that worked.

JuMP.jl threw an error when I tried to give it the complex . w_μ objective so none of that worked.

Can you share your example inn more detail? JuMP should work for this.