I have an objective function $f(x_1,x_2)$ which should be minimized while a function $g(x,x_1,x_2)$ MUST be greater than 0.8 for ALL x in an intervall $x=[0,10]$. As you can see, the constraint has a design variable from function $f$ and at the same time it has a "normal" variable. How can one define a mathematical problem for that? If the constraint would only contain design variables, I would know how to do it.

Notice: the functions are a bit simplified. The objective function and the constraint are non-linear.

EDIT: Since the original functions were requested, here they are: $f(x_1,x_2)=150 - \frac{x_2\cdot(5\cdot x_1 - 20)}{5} - 25\cdot2^{0.5}\cdot pi^{0.5}\cdot2\cdot erf(\frac{3\cdot 50^{1/2}}{10}) - \frac{c}{5}$

$g(x,x_1,x_2)=-\frac{1+x_1}{x_2}*x+x_1+5*exp(-\frac{(x-15)^2}{50}) \leqq 0.8$

  • $\begingroup$ So $x$ in $g$ is different than $x_1$ in $f$? Which of $x, x_1, x_2$ are inputs to the problem (given) and which are being optimized (minimized subject to constraint(s)? Are you saying that $g(x,x_2) \ge 0$ for all x in [0,10]? If so, that is equivalent to $x_2 \ge 1$. Well, you do say the functions are simplified, so we might have to see the unsimplified version. $\endgroup$ – Mark L. Stone Apr 21 at 23:14
  • $\begingroup$ @MarkL.Stone I added the functions. Yes, the $x$ and the $x1$ are different. $\endgroup$ – Loeli Apr 21 at 23:32
  • $\begingroup$ Other than constant terms, which don't affect the optimal solution (argmin), the objective function = $-x_2 * x_1$. Does $g \ge 0.8$ have to hold for all x in [0,10]? If so, put that explicitly in your formulation. $\endgroup$ – Mark L. Stone Apr 21 at 23:42
  • $\begingroup$ @MarkL.Stone yes, $g\geqq$ has to hold for all x in [0,10]. I added this in the description $\endgroup$ – Loeli Apr 21 at 23:51
  • $\begingroup$ You still don't have a clear and consistent description. The x in [0,10] is stated in the first sentence as applying to a (simplified) g which must be greater than 1. $\endgroup$ – Mark L. Stone Apr 21 at 23:54

In general, you have a bilevel optimization problem in which the inner problem is maximum of g with respect to x, subject to 0≤x≤10, is ≤ 0.8. If you want to read all about bilevel optimization, here is an expensive book "Practical Bilevel Optimization" by Bard https://www.springer.com/us/book/9780792354581 .

One easy but not completely rigorous way to deal with this is to make the g constraint into n constraints, one for each of n grid points for x in [0,10]. For instance, with grid spacing of 0.01, there are 1001 such constraints. And also −10 ≤ x1 ≤ −0.5 and 0 ≤ x2 ≤ 20. The objective function is −x1∗x2. This is a non-convex optimization problem, so you'll have to use a global optimizer to ensure finding the global minimum.

You could use FMINCON to solve this formulation, but that is a local optimizer, so you might not find the global optimum. You could install YALMIP. then use BMIBNB (global optimizer which comes with YALMIP), specifying FMINCON as the upper solver.

Here is the YALMIP code your example in the comment:

x1 = sdpvar; 
x2 = sdpvar; 
x = 0:.01:10; 
Con = [-10<=x1<=-0.5,0<=x2<=20,-(1+x1)/x1.*x+x1+5*exp(-(x-15).^2/50)<=0.8];
disp(value([x1 x2]

This example is quickly solved, with resulting optimal x1 = -10, x2 = 0. Actually any x1 in the range $-10 \le x1 \le -1.125$, which are the feasible values of x1, is optimal in conjunction with x2 = 0. This is a very easy problem to solve to global optimality. A little theoretical analysis could probably arrive at this solution for this example without the need for numerical optimization.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.