I am trying to plot the parametric phase diagram with bar legend in the form of a rainbow. I have asked one similar question before in which I have shown the region plot. But equations are different there. Here I have simplified the equations. I have written this code for getting the plot but not showing any color phase diagram as I want. If anyone can resolve this it will be appreciated.
k1 = 0.1;
kexc = .2;
ome = .4;
kL = (k1 + kexc)/2 - del0*(k1 - kexc)/(2*ome);
g0 = 0.3;
ome1 = 5.5;
a1 = 0.1;
A1 = 1;
B1 = 0;
gma = 0.0001;
delta = -1.5;
Y1 = (k1 - kexc)*g0^2*B1*ome1*(1 - del0/ome)*A1;
M1 = (gma^2/4 + ome1^2);
X1 = kL/2 + (k1 - kexc)/(ome^2*Sqrt[2]*M1)*g0^2*B1^2*ome1*P0*a1;
Z1 = delta + g0^2*(1 - del0/ome)*A1/Sqrt[2]*ome1/ome*P0*B1*a1/M1;
K1 = g0^2/2 (1 - del0/ome)^2*A1^2*ome1/M1;
S1 = g0^2/(2*Sqrt[2]*ome)*B1*ome1*(1 - del0/ome)*A1/M1;
O1 = (1 - del0/(2*ome))/Sqrt[2] + P0*g0^2*B1^2*ome1*a1/(2*ome^2*M1);
F11 = NSolve[
r1^3*(Y1^2 + K1^2) + r1^2*(2*X1*Y1 + 2*Z1*K1) +
r1*(X1^2 + Z1^2 + P0^2*S1 + 2*P0^2*O1*S1) + P0^2*O1 == 0, r1]
CounterPlot[{r1}, {P0, 0, 2.5}, {del0, 0, 3},
BarLegend["Rainbow", {0, 6}]]
NSolve
andContourPlot
incorrectly. (1)NSolve
generates a list of rules that need to be applied tor1
; replacer1
withr1 /. F11
if you want to plot the solutions to the functions found byNSolve
. (2) The syntax for a legend isPlotLegends->
(something). (3) You misspelledContourPlot
. $\endgroup$