You might consider the following variant of cvgmtj's answer. It has some performance advantages.
Manipulate[
{aF, adF, bF, bdF} =
NDSolveValue[
{a'[t] == -I*a[t] (delta + g*Re[b[t]]) - a[t]*0.04/2,
b'[t] == -I (b[t]*delta + g*Abs[a[t]]^2) - a[t]*0.09/2, a[0] == 1,
b[0] == 1},
{a, a', b, b'}, {t, 0, 200}];
ParametricPlot[{Re[bdF[t]], Re[bF[t]]}, {t, 0, 200},
PerformanceGoal -> "Quality"],
{aF, None},
{adF, None},
{bF, None},
{bdF, None},
{g, 0., 0.0005, Appearance -> "Labeled"},
{delta, -0.823 - 0.25, -0.823 + 0.25, Appearance -> "Labeled"},
TrackedSymbols :> {g, delta}]
I might not have posted this variant because the performance improvement is not all that noticeable, except that I want you to bring a further variant, which eliminates g
, to your attention. I can see no visible difference in the plot produced from the following code form the plot produced by the preceding code. Can you?
Manipulate[
{aF, adF, bF, bdF} =
NDSolveValue[
{a'[t] == -I*a[t] delta - a[t]*0.04/2,
b'[t] == -I b[t] delta - a[t]*0.09/2,
a[0] == 1, b[0] == 1},
{a, a', b, b'}, {t, 0, 200}];
ParametricPlot[{Re[bdF[t]], Re[bF[t]]}, {t, 0, 200},
PerformanceGoal -> "Quality"],
{aF, None},
{adF, None},
{bF, None},
{bdF, None},
{delta, -0.823 - 0.25, -0.823 + 0.25, Appearance -> "Labeled"},
TrackedSymbols :> {delta}]
Makes me wonder if g
is actually a significant variable. Perhaps your mathematical model can be profitably simplified were you to eliminate g
.
Manipulate[sol=NDSolve[...];ParametricPlot[...],{delta,-1,0},{g,0,0.0005}]
and see what you get. $\endgroup$Clear
before the codes. You are right, thank you for your advice! $\endgroup$