For the following matrix
$$M = \begin{pmatrix} f1[x,y,z] & f2[x,y,z]\\ g1[x,y,z] & g2[x,y,z]\\ h1[x,y,z] & h2[x,y,z] \end{pmatrix} $$
with
f1[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - z] + 0.1 Sqrt[z]]^2)
g1[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - z] + 0.1 I Sqrt[z]]^2)
h1[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - z] + Sqrt[z]]^2)
f2[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - z]])
g2[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - x]])
h2[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - y]])
Now I want to optimise the value of:
P = f1[x,y,z] pos[1] + f2[x,y,z] pos[2]
where pos[j]
returns the row corresponding to the highest value in column j
. However, I don't know how to define pos[j]
. I currently have
MWE
pos[1] = Position[{f1[x,y,z], g1[x,y,z], h1[x,y,z]]}, Max[f1[x,y,z], g1[x,y,z], h1[x,y,z]]]
pos[2] = Position[{f2[x,y,z], g2[x,y,z], h2[x,y,z]]}, Max[f2[x,y,z], g2[x,y,z], h2[x,y,z]]]
Poptimized = Maximize[P, {x, y, z}]
But this is not working. This is since pos[1]
and pos[2]
return empty lists. I thought that wrapping it inside the Maximize
would have it evaluate. I want something structured as follows:
Maximize[f1[x,y,z] pos[1] + f2[x,y,z] pos[2],{x,y,z}]
where pos[1]
and pos[2]
both also depend on x,y,z
and so need to be optimised too.
f1[x_,y_,z_] := ...
? $\endgroup$f2=g2=h2
?.... $\endgroup$Im[x]=0
and sof1[x_,y_,z_] := E^(-E^(2 Im[x]) Abs[y Sqrt[1 - z] + 0.1 Sqrt[z]]^2)= f1[x_,y_,z_] := E^(-Abs[y Sqrt[1 - z] + 0.1 Sqrt[z]]^2)
$\endgroup$