# Formalization of one optimization problem or solution of inequalities - Part №2

Continuing the question: Formalization of one optimization problem or solution of inequalities

Let's consider a more complex problem. We have two polynomial:

$$p_1=A_2t^2+A_1t+A_0$$

$$p_2=B_2t^2+B_1t+B_0$$

$$p=p_1p_2$$

$$A_0=(x^2-y^2-z^2-w^2-v^2-u^2)+xzy+wvu$$

$$A_1=x^2+y^2+z^2+w^2+\sin(x)\cos(w)\cos(u)$$

$$A_2=x^4+y^3+z^2-w^4-v^4-u^4$$

$$B_0=(x^2+y^2+z^2+w^2)+(x+y+z+w)^2+u^2$$

$$B_1=x^2+y^2+z^2+w^4+v^2+u^2$$

$$B_2=x^4+y^3+z^2+w^3+v^2+u^3$$

$$x,y,z,w,v,u$$ - parameters, moreover $$w,v,u$$ - the value of which varies in the range $$[-1,1]$$.

Polynomial $$p$$ has all real solutions if and only if:

$$d_1=A_1^2-4A_0A_2>0$$

$$d_2=B_1^2-4B_0B_2>0$$

There are known bounds:

$$-8.5

$$-1

Task: find the intervals for the parameters $$x,y,z$$ at which the polynomial $$p_1$$ and $$p_2$$ has only real solutions, i.e. the inequality $$d_1>0$$ and $$d_2>0$$ (taking into account the existing bounds) for any $$w,v,u$$ from the specified range $$[-1,1]$$.

Problem: In this problem, the number of parameters complicates visualization and analytical research, as does the number of free parameters $$w,v,u$$.

How to solve the problem and get the required intervals for $$x,y,z$$ out of the box? I.e. the answer should be something like:

x=[?;?] and y=[?;?] and z=[?;?]


Assumptions: maybe we need to choose a random combination of free parameters $$w,v,u$$ and find a solution for this random combination? And do it repeatedly?

My code:

Clear["Derivative"]; ClearAll["Global "];

Remove[A, B, d, x, y, z, w, v, u]

Subscript[A, 0] = (x^2 - y^2 - z^2 - w^2 - v^2 - u^2) + x y z + w v u;

Subscript[A, 1] = x^2 + y^2 + z^2 + w^2 + Sin[x] Cos[w] Cos[u];

Subscript[A, 2] = x^4 + y^3 + z^2 - w^4 - v^4 - u^4;

Subscript[B, 0] = (x^2 + y^2 + z^2 + w^2) + (x + y + z + w)^2 + u^2;

Subscript[B, 1] = x^2 + y^2 + z^2 + w^4 + v^2 + u^2;

Subscript[B, 2] = x^4 + y^3 + z^2 + w^3 + v^2 + u^3;

Subscript[d, 1] =
Subscript[A, 1]^2 - 4 Subscript[A, 0] Subscript[A, 2];

Subscript[d, 2] =
Subscript[B, 1]^2 - 4 Subscript[B, 0] Subscript[B, 2];

NMinimize[{x, Subscript[d, 1] > 0,
Subscript[d, 2] > 0, -8.5 < Subscript[A, 0] < 1, -0.2 <
Subscript[A, 1] < 6.7, -3 < Subscript[A, 2] < 5,
0 < Subscript[B, 0] < 27.5,
0 < Subscript[B, 1] < 8.25, -2 < Subscript[B, 2] < 8, -1 < x <
1, -1 < y < 1, 0 < z < 1, -1 < w < 1, -1 < v < 1, -1 < u < 1}, {x,
y, z, w, v, u}, Method -> {"RandomSearch", "SearchPoints" -> 3}];


NMinimize[{x, Subscript[d, 1] > 0, Subscript[d, 2] > 0, -8.5 < Subscript[A, 0] < 1, -0.2 <
Subscript[A, 1] < 6.7, -3 < Subscript[A, 2] < 5, 0 < Subscript[B, 0] < 27.5,
0 < Subscript[B, 1] < 8.25, -2 < Subscript[B, 2] < 8, -1 < x < 1, -1/2 < y < 1/2,
0 < z < 1, -1 < w < 1, -1 < v < 1, -1 < u < 1}, {x, y, z, w, v, u},
Method -> "DifferentialEvolution"]


{-1., {x -> -1., y -> 0.5, z -> 0., w -> -0.969478, v -> 0.666549, u -> -0.892578}}

and with -1<y<1

{-1., {x -> -1., y -> -1., z -> 1., w -> -0.94647, v -> 0.597063, u -> -0.970962}}

Addition. The following works.

Table[{ Subscript[d, 1] > 0, Subscript[d, 2] > 0, -8.5 < Subscript[A, 0] < 1,
-0.2 <  Subscript[A, 1] < 6.7, -3 < Subscript[A, 2] < 5,
0 < Subscript[B, 0] < 27.5,  0 < Subscript[B, 1] < 8.25, -2 < Subscript[B, 2] < 8},
{x, 0, 0.3, 0.05}, {y, 0,0.3, 0.05}, {z, 0, 0.3, 0.05}]


The output of Trues may be visualized as PointPlot3D.

• This is the same line that is in my code. It minimizes $x$. The difference is in the optimization method. This is the lower bound for $x$ only. I don't quite understand how to get the intervals for all three parameters $x,y,z$ so that an arbitrary triple would satisfy the inequalities?
– dtn
Jan 10, 2022 at 8:29
• @dtn: Even u = 1/2; v = -1/3; w = 1/10; FindInstance[{ Subscript[d, 1] > 0, Subscript[d, 2] > 0, -8.5 < Subscript[A, 0] < 1, -0.2 < Subscript[A, 1] < 6.7, -3 < Subscript[A, 2] < 5, 0 < Subscript[B, 0] < 27.5, 0 < Subscript[B, 1] < 8.25, -2 < Subscript[B, 2] < 8}, {x, y, z}, Reals] fails. Jan 10, 2022 at 11:03
• I'm not surprised. Because this is a command from a group of analytical tools. Maybe try to run the optimization many times and build a picture that will show the area of feasible solutions? Ideally, the program should provide such information in some way.
– dtn
Jan 10, 2022 at 11:22
• @dtn: Disagree concerning FindInstance. This command sometimes works when Solve/Reduce` fails. Jan 10, 2022 at 11:41
• Have you tried this command for one triple of free parameters $w,v,u$. How to make a calculation for any combination of triplets?
– dtn
Jan 10, 2022 at 11:46