I would like that, when finding the minimum, the FindMinimum analyzes the variables (x and y) each time and finds q, depending on the current values of x and y. Can I somehow write this condition into FindMinimum?
I have a function:
F[x_, y_] = (x - 3)^4 + y^2 + q;
where the value of q is determined from the condition:
If[x <= y, q = 10*y, q = 10*x]
How can I write this condition into a FindMinimum?
I am trying to do it in the following way:
FindMinimum[{F = F[x, y], If[x <= y, q = y, q = x]}, {{x, 1}, {y, 1}},
StepMonitor :> {Print[" Current x=", x, " y=", y, " q=", q, " F=",
F]}]
but Mathematica gives an error.
What is the correct form?
q
in the definition ofF[x, y]
? $\endgroup$