Two changes in your code: (1) made sol
a two-parameter function and evaluate it outside Manipulate
, (2) used {sol[a,b][[1]],sol[a,b][[2]]}
as the first argument in Plot
:
sol = ParametricNDSolveValue[{s'[t] == -a*c*d[t], d'[t] == +c*s[t]c*s[t],
s[0] == 100, d[0] == 0}, {s[7], d[7]}, {t, 0, 20}, {a, c}];
Manipulate[Plot[{sol[a, b][[1]], sol[a, b][[2]]}, {a, 1/10, 10},
PerformanceGoal -> "Speed", ImageSize -> 400,
PlotStyle -> {Black, Blue}],
{{b, 1, "b"}, .1, 10, Appearance -> "Open"}]
Note: If we use sol[a,b]
or Evaluate@sol[a,b]
instead of {sol[a, b][[1]], sol[a, b][[2]]}
we get two curves with the same color.