# How to plot the roots of two complex equations?

I have these two equations as two variables '$$a1$$' and '$$b1$$', mentioned below and I want to plot the roots of $$a1^{\dagger}*a1$$ with respect to P0, which will give me bistable plot with three values. I have tried this given code but not getting three roots of $$a1^{\dagger}*a1$$, which I want to plot. If anyone can resolve this, must be appreciated.

 ClearAll["Global*"]
A1 = 0;
B1 = 1;
del = -1.5;
g0 = 4.8;
del0 = 1.5;
ome = 40;
k1 = 0.1;
kex = 0.1;
kL = (k1 + kex)/2 - del0*(k1 - kex)/(2*ome);
Gma = 0.5;
sol = Values@
Flatten@Solve[{I*del*a1 + I*g0*(1 - del/ome)*A1*b1*a1 +
I*P0*(1 - del0/(2*ome))/Sqrt[2] + I*P0*g0*B1*b1/(Sqrt[2]*ome) -
kL/2*a1 - (k1 - kex)*g0/ome*B1*b1*a1 ==
0, -I*ome*b1 + I*g0*(1 - del0/ome)*A1*Abs[a1]^2/2 +
I*P0*g0*B1*a1/(Sqrt[2]*ome) - Gma*b1/2 == 0}, {a1, b1}]


{a1→−(3854.71−24.092i)P01.P02−(8331.6−329.861i),b1→−8.17708P021.P02−(8331.6−329.861i)}

a1 = sol[[1]] /. P0 -> Subdivide[3, 100];
pts0 = a1 Conjugate[a1] // Chop;
pts = Transpose[{Subdivide[3, 100], pts0}];

ListLinePlot[pts, Frame -> True,
FrameLabel -> {Style["P0", Bold, 20], Style[" N", Bold, 20]},
FrameTicksStyle -> Directive[FontSize -> 20], PlotLegends -> {"a1"}]


I think this code is giving me only the value of '$$a1$$' but I want to plot the roots of $$a1^{\dagger}*a1$$ with respect to P0, which will give be a bistable plot. Note that the values of the parameters can be changed to get bistable type behavior.

One way to handle it is to define a function of P0 and plot that function. After running the code in your first block:

a1[P0_] = sol[[1]];
a = a1[#] & /@ Subdivide[3, 100];
ListPlot[a Conjugate[a] // Chop]
`
• May you please elaborate this?
– vini
May 1, 2020 at 3:37
• Sorry it is not giving me bistable plot.
– vini
May 1, 2020 at 4:06
• This plots a1 Conjugate[a1] of the function you wrote above, as you asked. May 1, 2020 at 11:34
• @ bill s well, so where should I put this code in the main code as you write above?
– vini
May 1, 2020 at 12:10
• Run/evaluate your first block of code (that defines your function). Then evaluate my code above to plot. May 1, 2020 at 13:25