I have the following Mathematica code:
par = {2.16023, 6.26501, 2.54649, 21.1988}; {k1, k2, k3, k4} =
Rationalize[par, 10^-30];
f = k1 x^2 + k2 y^2 - k3 x^3 - k4 x y^2;
sol1 = Solve[{Grad[f, {x, y}] == 0, Det[D[f, {{x, y}, 2}]] > 0}, {x,
y}, Reals] // N
sol2 = Solve[{Grad[f, {x, y}] == 0, Det[D[f, {{x, y}, 2}]] < 0}, {x,
y}, Reals] // N
Show[Plot3D[f, {x, -0.1, 0.7}, {y, -0.25, 0.25}, Mesh -> {30},
MeshFunctions -> {#3 &}, PlotTheme -> "Marketing",
PlotStyle -> {Cyan, Opacity[0.7]}, PlotRange -> Automatic,
Axes -> True, AxesLabel -> {"x", "y", "V"}, ImageSize -> 600,
ImageMargins -> 10, LabelStyle -> Directive[Black, 20]],
Graphics3D[{Red, PointSize[0.03], Point[{x, y, f} /. sol1[[1]]]}],
Graphics3D[{Green, PointSize[0.03], Point[{x, y, f} /. sol1[[2]]]}],
Graphics3D[{Blue, PointSize[0.03], Point[{x, y, f} /. sol2]}]]
which gives me the following output:
where red is the local minimum, green is the local maximum, and blue is the saddle points. This is one trivial example, but sometimes the expression can be complex. Is there a way in Mathematica by which I can find the stationary points directly from the plot or any other simple procedure to do that?