# Finding local minimum of a 2D potential

I tried to find a local minimum point of a 2D potential U[\[Chi],\[CurlyPhi]] with both FindMinimum and NMinimize function. But both gave me similar error, something like:

FindMinimum::nrnum: The function value U[0.3,0.1] is not a real number at {\[Chi],\[CurlyPhi]} = {0.3,0.1}.


I also tried to put my potential like U[\[Chi]_?NumericQ, \[CurlyPhi]_?NumericQ], but it wouldn't work as well. Ideally, the local minimum should be either around {\[Chi]=0.9,\[CurlyPhi]=0.2}, or does not exist when both \[Chi]>0 && \[CurlyPhi]>0.

I'll attach my code below and I'd appreciate if someone could take a look at it!

\[Xi] = 79;
M = 4.2*10^-5;
Subscript[M, pl] = 1;
Subscript[\[Lambda], min] = 4.10614*10^-6;
\[Lambda][\[CurlyPhi]_] =
Subscript[\[Lambda], min] +
0.5/(16*\[Pi]^2)^2*(Log[\[CurlyPhi]/(0.15*Subscript[M, pl])])^2;
U[\[Chi]_?NumericQ, \[CurlyPhi]_?NumericQ] = \[Lambda][\[CurlyPhi]]/
4 \[CurlyPhi]^4 Exp[-2 Sqrt[2/3] \[Chi]/Subscript[M, pl]] +
3/4*(Subscript[M, pl]*M)^2*
Exp[-2 Sqrt[2/3] \[Chi]/Subscript[M,
pl]] (Exp[Sqrt[2/3] \[Chi]/Subscript[M, pl]] - 1 -
1/Subscript[M, pl]^2 \[Xi]*\[CurlyPhi]^2)^2;

NMinimize[{U[\[Chi], \[CurlyPhi]] >= 0 && 0 <= \[Chi] <= 1 &&
0 <= \[CurlyPhi] <= 0.2}, {\[Chi], \[CurlyPhi]},
MaxIterations -> 500]

• The result of Plot3D[U[\[Chi], \[CurlyPhi]], {\[Chi], 0, 1}, {\[CurlyPhi], 0, 0.2}, PlotRange -> All] clearly shows no local extremum. May 17 at 9:28
• Thanks for the comment. I've also attached the figure in my question. You could have a look at the point where the blue line ends, does that look like a local minimum? May 17 at 11:08
• See that. In fact, the plot is almost flat and this implies artefacts. May 17 at 11:40
• The objective function must evaluate to a numeric value. U[\[Chi], \[CurlyPhi]] >= 0 will evaluate to True or False. Your argument to NMinimize should be {U[\[Chi], \[CurlyPhi]], U[\[Chi], \[CurlyPhi]] >= 0 && 0 <= \[Chi] <= 1 && 0 <= \[CurlyPhi] <= 0.2} May 17 at 15:22
• @Jerry , you seem to be not very interessted about an answer to your question. Getting a good answer, but giving no upvote or accept or even a comment is not very polite. May 19 at 12:12

There is a local minimum. Rationalize parameter and first search for minimum curve with respect to chi. This can be achieved by intermediate substitution of exp term.

\[Xi] = 79;
M = 4.2*10^-5 // Rationalize[#, 0] &;
Subscript[M, pl] = 1;
Subscript[\[Lambda], min] = 4.10614*10^-6 // Rationalize[#, 0] &;
\[Lambda][\[CurlyPhi]_] =
Subscript[\[Lambda], min] +
0.5/(16*\[Pi]^2)^2*(Log[\[CurlyPhi]/(0.15*Subscript[M, pl])])^2 //
Rationalize[#, 0] &;
U[\[Chi]_, \[CurlyPhi]_] = \[Lambda][\[CurlyPhi]]/
4 \[CurlyPhi]^4 Exp[-2 Sqrt[2/3] \[Chi]/Subscript[M, pl]] +
3/4*(Subscript[M, pl]*M)^2*
Exp[-2 Sqrt[2/3] \[Chi]/
Subscript[M, pl]] (Exp[Sqrt[2/3] \[Chi]/Subscript[M, pl]] -
1 - 1/Subscript[M, pl]^2 \[Xi]*\[CurlyPhi]^2)^2 // Together

sol = First@Solve[E^(Sqrt[2/3] \[Chi]) == k, \[Chi]]

kmin[\[CurlyPhi]_] =
k /. Minimize[U[\[Chi], \[CurlyPhi]] /. sol, k][[2]] // Simplify

pl = Plot3D[
U[\[Chi], \[CurlyPhi]], {\[Chi], 1/2, 1}, {\[CurlyPhi], 0, 1/5},
PlotRange -> {5 10^-11, 10^-10}, PlotPoints -> 100];

pp = ParametricPlot3D[{Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi],
U[Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi]]}, {\[CurlyPhi],
0, .13}, AspectRatio -> 1.3, PlotRange -> All, PlotPoints -> 100,
PlotStyle -> {Thickness[.01], Red}];

Show[pl, pp]


min = Minimize[{U[Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi]],
1/10 < \[CurlyPhi]}, \[CurlyPhi]] // FullSimplify

(*   {(1323 (2779978537932271 +
13574950000000000 Log[
20/3 Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]]^2) Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]^4)/(200000000000 (17914204609119 +
2830444328240802 Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]^2 +
2 (62851221827586517 +
33937375000000000 Log[
20/3 Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]]^2) Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]^4)), {\[CurlyPhi] ->
Root[{2779978537932271 +
6787475000000000 Log[(20 #1)/
3] (1 + 2 Log[(20 #1)/3] + 79 #1^2) &,
0.112590521985889151866}]}}   *)

Sqrt[3/2] Log[kmin[\[CurlyPhi]]] /. min[[2]] // N

(*   0.902127   *)

Plot[U[Sqrt[3/2]
Log[kmin[\[CurlyPhi]]], \[CurlyPhi]], {\[CurlyPhi], .10, .12},
PlotRange -> All,
Epilog -> {Red, PointSize[.03],
Point[{\[CurlyPhi],
U[Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi]]} /. min[[2]]]}]


NMinimize[{U[\[Chi], \[CurlyPhi]],
0 <= \[Chi] <= 1 &&
0 <= \[CurlyPhi] <= 2/10}, {\[Chi], {\[CurlyPhi], 1/10, 2/10}},
MaxIterations -> 500, WorkingPrecision -> 30]


\$Version "8.0 for Microsoft Windows (32-bit) (December 9, 2010)"

• Executing \[Xi] = 79; M = 4.2*10^-5 // Rationalize[#, 0] &; Subscript[M, pl] = 1; Subscript[\[Lambda], min] = 4.10614*10^-6 // Rationalize[#, 0] &; \[Lambda][\[CurlyPhi]_] = Subscript[\[Lambda], min] + ... - 1 - 1/Subscript[M, pl]^2 \[Xi]*\[CurlyPhi]^2)^2 // Together sol = First@Solve[E^(Sqrt[2/3] \[Chi]) == k, \[Chi]] kmin[\[CurlyPhi]_] = k /. Minimize[U[\[Chi], \[CurlyPhi]] /. sol, k][[2]] // Simplify on a fresh kernel, I obtain "ReplaceAll::reps: {k} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing." and May 17 at 12:29
• {\[Chi] -> ConditionalExpression[ Sqrt[3/2] (2 I \[Pi] ConditionalExpression[1, \[Placeholder]] + Log[k]), ConditionalExpression[1, \[Placeholder]] \[Element] Integers]} and k /. k. May 17 at 12:30
• Also I don't see any local minimum in the result of Plot3D[U[\[Chi], \[CurlyPhi]], {\[Chi], 0, 1}, {\[CurlyPhi], 0, 1/5}, PlotRange -> {0, 10^-10}, PlotPoints -> 100] May 17 at 13:23
• U[Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi]] depends on \[CurlyPhi]]. Its local minimum at Point[{\[CurlyPhi], U[Sqrt[3/2] Log[kmin[\[CurlyPhi]]], \[CurlyPhi]]} /. min[[2]]] may be not a local minimum of the function of two variables U[\[Chi], \[CurlyPhi]] at this point. May 17 at 15:22
• NMinimize[{U[\[Chi], \[CurlyPhi]], 0 <= \[Chi] <= 1 && 0 <= \[CurlyPhi] <= 2/10}, {\[Chi], {\[CurlyPhi], 1/10, 2/10}}, MaxIterations -> 500, WorkingPrecision -> 60]  finds the same local minimum. May 17 at 15:41