0

Equations:

[x]'{t} == -g1 ι - ι (Δ1 - (γ ι/2 - J^2/(Δ2 - (γ ι)/2)) x[t] + (J^2 ι y[t])/(Δ2 - (γ ι)/2),

[y]'{t} == -g2 ι + (J^2 ι x[t])/(Δ2 - (γ ι)/ 2) - ι (Δ1 - (γ ι)/2 - J^2/(Δ2 - (γ ι)/2)) y[t], 

Solution:

sol = DSolve[system, {x, y}, t], 

For plot:

{xs[t_, Δ1_, Δ2_, ι_, m_, n_, γ_, J_, g1_, g2_],  ys[t_, Δ1_, Δ2_, ι_, m_,n_, γ_, J_, g1_, g2_]} = {x[t], y[t]} /. First@sol /. {C[1] -> a, C[2] -> b};

If I use Abs outside the Evaluate, I am getting only one common color i.e. last color for all lines using PlotStyle{colors}.

Plot[Abs[Evaluate[{xs[u], ys[u]} /. u -> Sequence[t, 1, 3, √-1, 1, 0, 0.1, 3, 0.1, 0.1]]], {t,0, 10}, PlotStyle -> {Red, Blue}].

However, if I use Abs after Evaluate, I am getting different color with PlotStyle{colors}.

Plot[Evaluate[Abs[{xs[u], ys[u]} /.u -> Sequence[t, 1, 3, √-1, 1, 0, 0.1, 3, 0.1, 0.1]]], {t,0, 10}, PlotStyle -> {Red, Blue}]

How can I get the desired color while using Abs before Evaluate line?

Feyre
  • 8,597
  • 2
  • 27
  • 46
Ani
  • 95
  • 5
  • 3
    Why don't you show a minimal workin example (mwe) that illustrates your problem? See here for general guidelines. – corey979 Nov 21 '16 at 07:40
  • You should be able to edit your question and to post a minimal working example. But as far as I can interpret your question, the problem is not the function Abs but the table / list you might be using within Plot. Check these expressions (1) Plot[Table[x^n, {n, 0, 2}], {x, 0, 2}, PlotStyle -> {Red, Blue, Green}] and (2) Plot[Evaluate@Table[x^n, {n, 0, 2}], {x, 0, 2}, PlotStyle -> {Red, Blue, Green}]. In (1) you will get the same behavior as in your problem, in (2) the functions are plotted in the colors you wanted. – Mauricio Fernández Nov 21 '16 at 10:14

0 Answers0