# A problem of nonlinear multi-objective optimization

I have two variables x1 and x2 and I use them to calculate 4 metrics y1,y2,y3, and y4. now I want to solve for the value of x1 and x2 so that these four metrics are as large as possible. Can anyone give me some hints? Any method or language is fine.

Subscript[y, 1] = Subscript[x, 1]
Subscript[y, 2] = 1/(1 + 1/Subscript[x, 2])
Subscript[y, 3] = (1 - 2*Subscript[x, 1])/(1 + Subscript[x, 2]) +
Subscript[x, 1]
Subscript[y, 4] = 2/((1 + 1/Subscript[x, 2]) + 1/Subscript[x, 1])


Boundaries:

0 < Subscript[x, 1] <=1
0 < Subscript[x, 2]
0 <= Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[y, 4] <= 1


• Please post the Mathematica code,not the picture. May 25 at 1:59
• Welcome to the Mathematica Stack Exchange. Please provide copy-paste-able code so that forum participants can experiment with it and assist you further. It is also a good idea to include details on what you have tried out so far.
– Syed
May 25 at 2:23
• This is my first time using Mathematica and I am not sure if my formula code is correct. May 25 at 2:33
• "so that these four metrics are as large as possible"??? What if the first metric is very very good and the other three are bad? Or the first three are good and the last is very very bad? Can you edit your question to describe exactly what single expression you want to maximize? That expression will include y1,y2,y3,y4 in some form. Given that expression people can try to maximize it. I can make y1=1 and y2,y3,y4 smaller and the total of the four is as big as I can find. But I do not know that is what you want.
– Bill
May 25 at 2:43
• I think the fourth metric y4 is the most important, and I hope that y1, y2, y3, and y4 are all greater than 0.5 May 25 at 2:50

Some posibilities to maximize

(eqs = {Subscript[y, 1] == Subscript[x, 1],
Subscript[y, 2] == 1/(1 + 1/Subscript[x, 2]),
Subscript[y, 3] == (1 - 2*Subscript[x, 1])/(1 + Subscript[x, 2]) +
Subscript[x, 1],
Subscript[y, 4] ==
2/((1 + 1/Subscript[x, 2]) + 1/Subscript[x, 1])}) // TableForm

Plot3D[eqs[[3, 2]], {Subscript[x, 1], 0, 1}, {Subscript[x, 2], 0,
100}]

cond = Flatten@{0 < Subscript[x, 1] <= 1, 0 < Subscript[x, 2],
Thread[0 <= {Subscript[y, 1], Subscript[y, 2], Subscript[y, 3],
Subscript[y, 4]} <= 1]}


Maximize everx yi independently

(max1 = Maximize[{#, cond}, {Subscript[x, 1], Subscript[x, 2],
Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[y,
4]}] & /@ {Subscript[y, 1], Subscript[y, 2], Subscript[y, 3],
Subscript[y, 4]}) // MatrixForm


Maximize sum of squared yi

sq = {Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[y,
4]}.{Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[
y, 4]}

(max2 = Maximize[{sq, cond}, {Subscript[x, 1], Subscript[x, 2],
Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[y,
4]}])

(*   {4, {Subscript[x, 1] -> 1/2, Subscript[x, 2] -> 1,
Subscript[y, 1] -> 1, Subscript[y, 2] -> 1, Subscript[y, 3] -> 1,
Subscript[y, 4] -> 1}}   *)


Maximize sum of yi

tot = Total@{Subscript[y, 1], Subscript[y, 2], Subscript[y, 3],
Subscript[y, 4]}

(max3 = Maximize[{tot, cond}, {Subscript[x, 1], Subscript[x, 2],
Subscript[y, 1], Subscript[y, 2], Subscript[y, 3], Subscript[y,
4]}])

(*   {4, {Subscript[x, 1] -> 1, Subscript[x, 2] -> 1, Subscript[y, 1] -> 1,
Subscript[y, 2] -> 1, Subscript[y, 3] -> 1, Subscript[y, 4] -> 1}}   *)


Your constraints limit each $$y_i$$ to be at most $$1$$.
By choosing $$x_1=1$$ and $$x_2$$ large all of them get arbitrarily close to $$1$$:

With[{x1 = 1, x2 = 10000000},
N[{x1, x2/(x2 + 1), x1 + (1 - 2 x1)/(1 + x2), (2 x1 x2)/(x1 x2 + x1 + x2)}]]
(* {1., 0.9999999, 0.9999999, 0.99999995} *)