Need to solve a constrained optimization problem but lacks the software to do so

90 Views Asked by At

I need someone to compute a constrained optimization problem. I couldn't find any software that could handle an optimization problem as long as this one is, and I don't want to resort to hand calculating it just yet. Here's the problem:

Maximize $$\frac{fz+p^2+q^2z^2+bz-\left(\left(f+c+q^2\right)z+p^2+d+b\right)\left(\left(q^2+a+b\right)z+f+g+p^2\right)}{\sqrt{\left[\left(f+c+q^2\right)z^2+p^2+d+b-\left(\left(f+c+q^2\right)z+p^2+d+b\right)^2\right]\left[\left(q^2+a+b\right)z^2+f+g+p^2-\left(\left(q^2+a+b\right)z+f+g+p^2\right)^2\right]}}$$

Subject to $$a, b, c, d, f, g, p, q \geq 0, \\ p+q\leq1,\\ a+c=2(1-p-q)q, \\ b+f=2pq, \\d+g=2(1-p-q)p, \\z<0$$.

If this isn't possible, I am okay with turning the constraint of $z<0$ into $z\leq0$. If that doesn't work, then I am okay with giving $z$ a lower bound of -1000. If that doesn't work, then I am okay with just maximizing the numerator of the fraction and minimizing the denominator of the fraction and seeing how that works out.

1

There are 1 best solutions below

0
On

This is essentially a comment that guides the new OP on how to proceed with their problem, but was too long (and cluttered) to write as a comment.

Questions you need to answer to answer your question.

My starting assumption is that: it is important to you to answer this question. I state this at the outset because you will have to do some work and learn some tools in order to get this answer.

  1. [done] Re-write your equation in LaTeX, and then double-check it. Right now it looks quickly written, and there could easily be a mistake that changes the whole problem. Try to edit this post afterwards and see how to write your objective function (and constraints) in LaTeX.
  2. Your objective function seems to be roughly of the form $$ f(x) = \frac{\sum_i \alpha_i x_1^{a_i^1} \dots x_9^{a_i^9}}{\left(\sum_i \beta_i x_1^{b_i^1}\dots x_i^{b_i^9}\right)\sqrt{\sum_i \gamma_i x_1^{c_i^1}\dots x_9^{c_i^9}}},\tag{1}$$ where $x_1, \dots, x_9 = a, b, c, d, f, g, p, q, z$, the $\alpha_i,\beta_i$ and $\gamma_i$ are integer coefficients, the $a_i^j, b_i^j, c_i^j$, $j=1, \dots, 9$ are integer exponents (each $\leq 5$ or so) once you have multiplied everything out, and the sum over $i$ is the sum over all the monomials in $x_1, \dots, x_9$ variables of some finite degree. Note that most $\alpha_i, \beta_i, \gamma_i = 0$. You also have three (independent) equality constraints and one inequality constraint (aside from the non-negativity constraints), so you have a 6-dimensional problem with inequality constraints. You also seem more interested in the variable $x_9 = z$.

The good news so far is that this shouldn't be a difficult problem to find an approximate near- minimizer for. You should certainly be able to determine whether $z > -1000$.

The bad thing is that you need to do some work. You need to decide exactly what you want and how much work you're willing to do to get it. At least,

  • do you want a value of $x^* = (x_1^*, \dots, x_9^*)$ that gives you a "large enough" objective function, and then you want to know that at least $x_9^* = z^* > 0?$
  • do you want to know whether there is a unique optimum?
  • do you want to know whether an optimal finite value exists? It could be that the maximum value of the objective function is $+\infty$.
  • do you even care about the optimizer $x^*$, or do you just need to know its ''value'' $f(x^*)$ (here $f$ is your nasty objective function of $x = (a, b, ..., z)$) ?

If you want to know all of the above, how precisely do you want to know it? For instance, let's say an exact, unique maximum value $x^*$ exists (again, it could be $\infty$, and there could be multiple minimizing points). Do you...

  • want to know $x^*$ precisely?
  • want to know $f(x^*)$?
  • do you just want to know $z^* \geq 0?$
  • maybe it would be enough to know there is some $x' \neq x^*$ such that $x'_9 \geq 0$ and $f(x^*) - f(x') < \Delta$ for some acceptable value $\Delta > 0$? In other words, maybe you just want to know there is some $x_9' = z'$ that is "good enough" for which $z' > 0$?

Tasks

In order of increasing difficulty, here is what you should do:

  1. Square your function to get rid of the square root in the denominator, and then multiply out the numerator and denominator. Squaring won't hurt your answer because you are looking for the maximum of a function, and the square function is monotonic. Then you will get an expression like my equation (1), but without the square root. Mathematica, MATLAB, or any symbolic manipulator can do this for you easily.
  2. Study the behavior at infinity, i.e. send $x_i \rightarrow \infty$ and make sure that $|f(x)| < \infty$ for the domain you care about, otherwise you might have an easy answer to your question. Depending on how complicated the expressions are you may have to be careful, since you will have to send various combinations of $x_i$ to $\infty$ to satisfy your constraints.
  3. If you do have a well-behaved optimization problem, then maybe a first step is to evaluate the gradient and study $\nabla f(x) = 0$. If you square $f$ then this may be a reasonable system of polynomial equations that gives finitely many solutions, or sets of solutions. You may also need to use Lagrange multipliers to impose the constraints, but you shouldn't do that at first since some of your inequality constraints may be automatically satisfied.
  4. If it turns out you have a legitimate numerical optimization problem, then you will probably have to massage your expression (make some substitutions based on your equality constraints, e.g. $b+f = 2pq$). There are ways to make the function more "numerically friendly". Then use an optimization function in any general purpose software such as MATLAB's fmincon or Scipy's scipy.optimize.minimize. Depending your familiarity with these languages this may be a significant time investment.