0
$\begingroup$

I am trying to plot between (mod[E01])^2 and (mod[as])^2 and for that using the following code as seen below. But not getting any plot. If anyone knows this, is welcome.

 d12 = 1;
 g1 = 0.14;
 wm = 1;
 eta = 0.1;
 C1 = 0;
 kk1 = 0.1;
 chi = 0;
 Func1 = Abs[as]^2;
 bs = -I*g1*(Func1 + C1)/(I*wm);
 sol = Solve[(I*d12 - kk1)*as - I*g1*as*(bs + Conjugate[bs]) - 
     2*I*eta*Conjugate[as]*as^2 - I*chi*Conjugate[as] + E01 == 0, as1];
Plot[{Func1 /. sol}, {E01^2, 0, 8}]
$\endgroup$
  • $\begingroup$ Change as1 to as in your Solve command! $\endgroup$ – Ulrich Neumann Apr 17 at 10:29
1
$\begingroup$
d12 = 1;
g1 = 7/50;
wm = 1;
eta = 1/10;
C1 = 0;
kk1 = 1/10;
chi = 0;
Func1 = Abs[as]^2;
bs = -I*g1*(Func1 + C1)/(I*wm);

Since you are plotting on the range 0 <= E01 <= Sqrt[8] include this as a constraint to limit the solutions returned by Solve to those defined in the range of interest.

Length@Solve[(I*d12 - kk1)*as - I*g1*as*(bs + Conjugate[bs]) - 
    2*I*eta*Conjugate[as]*as^2 - I*chi*Conjugate[as] + E01 == 0, as]

(* 9 *)

sol = Solve[{(I*d12 - kk1)*as - I*g1*as*(bs + Conjugate[bs]) - 
       2*I*eta*Conjugate[as]*as^2 - I*chi*Conjugate[as] + E01 == 0, 
     0 <= E01 <= Sqrt[8]}, as] // Simplify;

Length@sol

(* 5 *)

You cannot use E01^2 as the Plot variable

Plot[Evaluate[Func1 /. sol], {E01, 0, Sqrt[8]},
 PlotLegends -> Placed[Automatic, {0.8, 0.4}]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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