# Find instance of equation that also minimizes one variable

I want to find an instance of solution of a very complicated equation like

func[a, x, y, w, z] == c


that is a global minimum (within the solution set) of a.

Below is a minimum working example

Alfa = 1/137;
sw = Sqrt[0.23152];
mμ = 105.658*10^-3 (*GeV*);

Γμ = 1/(3.34*10^18);

gs = 1;
gU = 1/Sqrt Sqrt[4  Pi Alfa]/sw;

BRfunction[MU_, Ms_, VU11_, VU12_, VU21_, O11_, O12_, O21_] :=
(1/Γμ)*
(mμ^5 (1/
5 gs^4 MU^4 O11^2 (15 Ms^2 - 2 mμ^2) (O12^2 + O21^2) +
4 gs^2 gU^2 Ms^4 MU^2 O11 VU11 (O12 VU21 + O21 VU12) +
2 gU^4 Ms^6 VU11^2 (VU12^2 + VU21^2)))/(6144 π^3 Ms^6 MU^4);

FindInstance[
BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] == 10^(-12) &&
MU > 100 && MU < 100000 && Ms > 100 && Ms < 100000 && O11 > -1 &&
O11 < 1 && O12 > -1 && O12 < 1 && O21 > -1 && O21 < 1 && O11 != 0 &&
VU11 > -1 && VU11 < 1 && VU11 != 0 && VU12 > -1 && VU12 < 1 &&
VU21 > -1 && VU21 < 1 && VU21 <= Sqrt[1 - VU11^2] &&
VU12 <= Sqrt[1 - VU11^2],
{MU, Ms, VU11, VU12, VU21, O11, O12, O21}]


But I don't want to find any instance, as the code would output, I want to find the instance that minimizes MU.

What is the most efficient way to do this?

Edit:

Following the first answer suggestion, I have done

FindInstance[
BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] == 10^(-12) &&
MU > 100 && MU < 100000 && Ms > 100 && Ms < 100000 && O11 > -1 &&
O11 < 1 && O12 > -1 && O12 < 1 && O21 > -1 && O21 < 1 && O11 != 0 &&
VU11 > -1 && VU11 < 1 && VU11 != 0 && VU12 > -1 && VU12 < 1 &&
VU21 > -1 && VU21 < 1 && VU21 <= Sqrt[1 - VU11^2] &&
VU12 <= Sqrt[1 - VU11^2],
{MU, Ms, VU11, VU12, VU21, O11, O12, O21}]


but evaluating

  BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21]


using the set of variables given as solution by NMinimize with Method -> Automatic and PrecisionGoal -> 20 (and a little different constraints such as Abs[VU11]>0.1 which are definitely not relevant to the problem) I don't get the expected result of 10^(-12), but rather, at best, something to the order of 10^(-9).

• Far too few details to even give you a suggestion. Can you make a simpler example (a Minimal Working Example, MWE) that represents what you are trying to do? Jan 6, 2021 at 22:27
• func[a_, x_, y_, w_, z_, c_] = a*x*y*w*z - c; NMinimize[{a, func[a, x, y, w, z, c] == 0}, {a, x, y, z, w, c}, Method -> Automatic] Jan 6, 2021 at 22:52
• @MarcoB I have added a MWE! Jan 6, 2021 at 22:58
• Is there any reason not to use NMinimize or FindMinimum, specifying the "instance" qualifications as constraints? Jan 6, 2021 at 23:38
• @Daniel Lichtblau Thanks for the suggestion! I have tried it, but then the required equation (enforced as a constraint) does not hold as expected. The issue is a little more detailed in the edited question. Jan 9, 2021 at 20:53

Maybe as below.

NMinimize[{MU,
BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] == 10^(-12) &&
MU > 100 && MU < 100000 && Ms > 100 && Ms < 100000 && O11 > -1 &&
O11 < 1 && O12 > -1 && O12 < 1 && O21 > -1 && O21 < 1 && O11 != 0 &&
VU11 > -1 && VU11 < 1 && VU11 != 0 && VU12 > -1 && VU12 < 1 &&
VU21 > -1 && VU21 < 1 && VU21 <= Sqrt[1 - VU11^2] &&
VU12 <= Sqrt[1 - VU11^2]}, {MU, Ms, VU11, VU12, VU21, O11, O12,
O21}]

• I had to unaccept your answer by the reason added to the question. I upliked it for now! Jan 9, 2021 at 4:09
• To @GaloisFan and @cvgmt Do your NMinimize with eqs// Rationalize[#, 0] &  and , WorkingPrecision -> 40, MaxIterations -> 1000  to get BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] /. %[]  (* 1.*10^-12 *)  Jan 10, 2021 at 7:17
• sol = NMinimize[{MU, (BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] == 10^(-12) // Rationalize[#, 0] &) && MU > 100 && MU < 100000 && Ms > 100 && Ms < 100000 && O11 > -1 && O11 < 1 && O12 > -1 && O12 < 1 && O21 > -1 && O21 < 1 && O11 != 0 && VU11 > -1 && VU11 < 1 && VU11 != 0 && VU12 > -1 && VU12 < 1 && VU21 > -1 && VU21 < 1 && VU21 <= Sqrt[1 - VU11^2] && VU12 <= Sqrt[1 - VU11^2]}, {MU, Ms, VU11, VU12, VU21, O11, O12, O21}, WorkingPrecision -> 40, MaxIterations -> 1000] BRfunction[MU, Ms, VU11, VU12, VU21, O11, O12, O21] /. sol[] Jan 10, 2021 at 8:07