ClearAll[\[Phi]x, \[Phi]y, \[Theta], J2, H, f, f1, f2, f3, f4, e2, \
e3, e4, e1, e0]
f[\[Phi]x_, \[Phi]y_, \[Theta]_, J1_, J2_, H_] :=
J1 ((Sin[\[Theta]]^2)*Cos[\[Phi]x] + (Sin[\[Theta]]^2)*
Cos[\[Phi]y] + 2*Cos[\[Theta]]^2) +
J2*0.25*((Sin[\[Theta]]^2)*Cos[\[Phi]x + \[Phi]y] +
Cos[\[Theta]]^2) +
J2*0.25*((Sin[\[Theta]]^2)*Cos[\[Phi]y - \[Phi]x] +
Cos[\[Theta]]^2) - H*Cos[\[Theta]];
e0[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
MinValue[{f[\[Phi]x, \[Phi]y, \[Theta], J1, J2, H],
0 <= \[Phi]x <= 2*Pi, 0 <= \[Phi]y <= 2*Pi,
0 <= \[Theta] <= Pi}, {\[Phi]x, \[Phi]y, \[Theta]}];
f1[J1_, J2_, \[Theta]_,
H_] := (2*J1) + (0.5*J2) - (H* Cos[\[Theta]]);
e1[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
MinValue[{f1[J1, J2, \[Theta], H], 0 <= \[Theta] <= Pi}, {\[Theta]}];
f2[J1_, J2_, \[Theta]_,
H_] := (2*J1*Cos[2*\[Theta]]) + (0.5*J2) - (H*Cos[\[Theta]]);
e2[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
MinValue[{f2[J1, J2, \[Theta], H], 0 <= \[Theta] <= Pi}, {\[Theta]}];
f3[J1_, J2_, \[Theta]_,
H_] := (2*J1*Cos[\[Theta]]^2) + (0.5*J2*Cos[2*\[Theta]]) - (H*
Cos[\[Theta]]);
e3[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
MinValue[{f3[J1, J2, \[Theta], H], 0 <= \[Theta] <= Pi}, {\[Theta]}];
f4[J1_, J2_, \[Theta]_,
H_] := (2*J1*Cos[\[Theta]]^2) + (0.5*J2*Cos[\[Theta]]^2) - (H*
Cos[\[Theta]]);
e4[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
MinValue[{f4[J1, J2, \[Theta], H], 0 <= \[Theta] <= Pi}, {\[Theta]}];
g[J1_?NumericQ, J2_?NumericQ, H_?NumericQ] :=
If [e0[J1, J2, H] < e1[J1, J2, H] &&
e0[J1, J2, H] < e2[J1, J2, H] &&
e0[J1, J2, H] < e3[J1, J2, H] &&
e0[J1, J2, H] < e4[J1, J2, H], 0.0,
If [e1[J1, J2, H] < e0[J1, J2, H] &&
e1[J1, J2, H] < e2[J1, J2, H] &&
e1[J1, J2, H] < e3[J1, J2, H] &&
e1[J1, J2, H] < e4[J1, J2, H], 0.2,
If[e2[J1, J2, H] < e0[J1, J2, H] &&
e2[J1, J2, H] < e1[J1, J2, H] &&
e2[J1, J2, H] < e3[J1, J2, H] &&
e2[J1, J2, H] < e4[J1, J2, H], 0.4,
If[e3[J1, J2, H] < e0[J1, J2, H] &&
e3[J1, J2, H] < e1[J1, J2, H] &&
e3[J1, J2, H] < e2[J1, J2, H] &&
e3[J1, J2, H] < e4[J1, J2, H], 0.6,
If[e4[J1, J2, H] < e0[J1, J2, H] &&
e4[J1, J2, H] < e1[J1, J2, H] &&
e4[J1, J2, H] < e2[J1, J2, H] &&
e4[J1, J2, H] < e3[J1, J2, H], 0.8, 1.]]]]];
J2 = 1.0;
J1 = 1.0;
q1 = Plot[{e0[J1, J2, H], e1[J1, J2, H], e2[J1, J2, H], e3[J1, J2, H],
e4[J1, J2, H]}, {H, -1, 1},
PlotStyle -> {{Black, Thick}, {Red, Thick}, {Green, Thick}, {Blue,
Thick}, {Magenta, Thick}},
PlotLegends -> {"Spiral", "FM", "AFM", "Stripe", "Ortho"},
Frame -> True, FrameStyle -> Directive[Black, 18],
FrameLabel -> {"H" , "Energy"}, RotateLabel -> True,
LabelStyle -> Directive[Black, 22]]
Clear[J2, H]
p4 = ContourPlot[g[J1, J2, H], {H, -1, 1}, {J2, -1, 1},
PlotPoints -> 30, ColorFunction -> "Rainbow",
ColorFunctionScaling -> False, Frame -> True,
FrameStyle -> Directive[Black, 18],
PlotLabel ->
Style[Framed["\!\(\*SubscriptBox[\(J\), \(1\)]\)=1.0"], 18, Black,
Background -> Lighter[Gray]],
FrameLabel -> {"H" , "\!\(\*SubscriptBox[\(J\), \(\"\<2\>\"\)]\)"},
RotateLabel -> False, LabelStyle -> Directive[Black, 26]]
Attachments: