0
$\begingroup$

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.

$\endgroup$

1 Answer 1

1
$\begingroup$

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]
$\endgroup$
9
  • $\begingroup$ May you please elaborate this? $\endgroup$
    – vini
    May 1, 2020 at 3:37
  • $\begingroup$ Sorry it is not giving me bistable plot. $\endgroup$
    – vini
    May 1, 2020 at 4:06
  • 1
    $\begingroup$ This plots a1 Conjugate[a1] of the function you wrote above, as you asked. $\endgroup$
    – bill s
    May 1, 2020 at 11:34
  • $\begingroup$ @ bill s well, so where should I put this code in the main code as you write above? $\endgroup$
    – vini
    May 1, 2020 at 12:10
  • $\begingroup$ Run/evaluate your first block of code (that defines your function). Then evaluate my code above to plot. $\endgroup$
    – bill s
    May 1, 2020 at 13:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.