# Manipulating the plots obtained from NDSolve

I am trying to manipulate my parameters eNA, eNM, eMA, eMN, eAM, eAN in the following plot obtained from using NDSolve on my set of differential equations. But I can't find a way to do it. The traditional syntax yields me a blank plot and using doing some modifications yields various errors which I am unable to comprehend. Someone below commented that I should include the code itself for people to copy and paste ! So, here it is :

ClearAll[M, A, Ne, t]
r = 0.2;
eMA = 1.5;
eMN = 2;
eAM = 1.7;
eAN = 0.8;
eNM = 2;
eNA = 2.6;

sol = NDSolve[{M'[t] ==
r*(M[t]*(1 - M[t]/1500) - eMA*M[t]*A[t]/1500 -
eMN*M[t]*Ne[t]/1500),
A'[t] ==
r*(A[t]*(1 - A[t]/1500) - eAM*A[t]*M[t]/1500 -
eAN*A[t]*Ne[t]/1500),
Ne'[t] ==
r*(Ne[t]*(1 - Ne[t]/1500) - eNM*Ne[t]*M[t]/1500 -
eNA*Ne[t]*A[t]/1500),
M == 400, A == 400, Ne == 400}, {M[t], A[t], Ne[t]}, {t,
0, 150}] // Quiet;
M[t_] = M[t] /. sol[][] // Quiet;
A[t_] = A[t] /. sol[][] // Quiet;
Ne[t_] = Ne[t] /. sol[][] // Quiet;
Plot[{M[t], A[t], Ne[t]}, {t, 0, 40}, PlotRange -> {0, 1600},
PlotLegends -> {"M", "A", "Ne"}]

• People here generally like users to post code as Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this meta Q&A helpful – Michael E2 Oct 30 '20 at 3:05

It is bad practice and dangerous to use the same symbol name in the ODE and for the solution function. Anyway, with the code below you can play with your parameters.

ClearAll[M, A, Ne, t]
r = 0.2;
Manipulate[
sol = NDSolve[{M'[t] ==
r*(M[t]*(1 - M[t]/1500) - eMA*M[t]*A[t]/1500 -
eMN*M[t]*Ne[t]/1500),
A'[t] ==
r*(A[t]*(1 - A[t]/1500) - eAM*A[t]*M[t]/1500 -
eAN*A[t]*Ne[t]/1500),
Ne'[t] ==
r*(Ne[t]*(1 - Ne[t]/1500) - eNM*Ne[t]*M[t]/1500 -
eNA*Ne[t]*A[t]/1500), M == 400, A == 400,
Ne == 400}, {M[t], A[t], Ne[t]}, {t, 0, 150}];
M1[t_] = M[t] /. sol[][] // Quiet;
A1[t_] = A[t] /. sol[][] // Quiet;
Ne1[t_] = Ne[t] /. sol[][] // Quiet;
Plot[{M1[t], A1[t], Ne1[t]}, {t, 0, 40}, PlotRange -> {0, 1600},
PlotLegends -> {"M", "A", "Ne"}]
, {{eMA, 1.5}, 1, 2}, {{eMN, 2}, 1, 3}, {{eAM, 1.7}, 1,
2}, {{eAN, 0.8}, 0.5, 1}, {{eNM, 2}, 1, 3}, {{eNA, 2.6}, 2, 3},
TrackedSymbols :> {eMA, eMN, eAM, eAN, eNM, eNA}] 