sample phase diagram

I am trying to plot like the diagram given above. I have two nonlinear equations that I have separated in imaginary and complex forms (u1,v1, and x1,y1). As shown in the figure in the x-axis I want 'p0' which varies from (0,2.5*10^3) and in the y-axis, I want 'del0' which varies from (0,3) and inside the plot where rectangular color region box it is 'NL=u1^2+v1^2'which varies from (0,6*10^7). I am trying this but unable to plot this type of diagram and gives me an error: "solve was unable to solve the system with inexact coefficients. The \ the answer was obtained by solving a corresponding exact system and \ numericizing the result. >>" Should I give another command to get this type of plot or anything else? If anyone can short it out will be appreciated.

A1 = 1;
B1 = 0;
delta = -1.5;(*Subscript[Δ, L] ; Laser-Lower polariton \
g0 = .315; (* Subscript[g, 0] ; vacuum optomechanical strength *)
ome = 3.014; (* Ω ; Rabi splitting *)
ome1 = .125; (* Subscript[Ω, m] ; mechanical \
resonator's frequency *)
kexc = 0.002;  (* Subscript[κ, exc  ;  ]exciton decay rate*)
kk = .2;   (* κ; cavity decay rate *)
gma = 0.00001;  (* Γ ; phonon dcay rate *)
ka = (kk + kexc)/2 - del0*(kk - kexc)/(2*ome);
Sol = NSolve[{-delta*v1 - ka*u1/2 - (kk - kexc)*B1*g0*x1*u1/ome == 0, 
    delta*u1 + g0*(1 - del0/ome)*A1*x1*u1 + 
      p0*(1 - del0/(2*ome))/Sqrt[2] + p0*g0*B1*x1/(Sqrt[2]*ome) - 
      ka*v1/2 - (kk - kexc)*g0*x1*B1*v1/ome == 0, 
    ome1*y1 - gma*x1/2 == 
     0, -ome1*x1 + g0/2*(1 - del0/ome)*A1*(u1^2 + v1^2) + 
      p0*g0*u1*B1/(Sqrt[2]*ome) - gma*y1/2 == 0}, {u1, v1, x1, y1}, 
ContourPlot[{Evaluate[(u1^2 + v1^2)] /. Sol}, {p0, 0, 5}, {del0, 0, 
  3}, PlotLegends -> BarLegend[{"LakeColors", {0, 6}}]]

After running this code I am getting the plot. Which is not the same as above. I don't know what the problem with it?

enter image description here

  • 1
    $\begingroup$ This is practically the same code and, I assume, the same problem you posted in your previous question (222245), with the exception that you are now using ParametricRegionPlot. Note that the message you get is a warning, not an error. You should still have received an answer. I also noticed that you wrote NSolve[equations, {variables}, del0] it seems to me that you are trying to solve by eliminating del0 from your equations, and yet later you want to obtain a plot of the solutions as a function of del0. That may not work. $\endgroup$
    – MarcoB
    Commented May 21, 2020 at 4:31
  • 1
    $\begingroup$ You should also indicate specifically where your code fails. Do you get a reasonable solution from NSolve? Also, if NSolve works, it will return a number. What does it mean to plot a number as a function of p0 and del0? Or perhaps you meant to use Solve instead? $\endgroup$
    – MarcoB
    Commented May 21, 2020 at 4:34
  • 1
    $\begingroup$ ParametricRegionPlot is not a built-in function for version 12.1. What code are you using for this? $\endgroup$
    – Bob Hanlon
    Commented May 21, 2020 at 4:46
  • 1
    $\begingroup$ @vini Well, do like we all do: scour the documentation, read the examples, look at other questions on this site.... until you find something that at least works in principle. As you can see, you were clearly not providing enough information on where you encountered a problem. More info, more details, better answers. $\endgroup$
    – MarcoB
    Commented May 21, 2020 at 4:57
  • 1
    $\begingroup$ @vini you only show one plot. How can we compare to what is expected or desired if you do not provide this? Kindly show this new plot. Further, there are many specifics you mention, kindly generalize this and separate out the question by bolding it or making it larger in size? $\endgroup$ Commented May 22, 2020 at 20:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.