I have a system of differential equations where I want to get a numerical plot for certain initial conditions. I want to keep A2 and M2 as constants but see how its values changes my plot. However I am getting errors and Mathematica always crushes when I try to plot. I have tried several methods, but for a0 it gives wrong plot.
Thanks!
eqn = {r0[t] == 3 /a0[t]^3,
r2[t] == (5 (M2* a0[t] - 3 *a2[t]))/(
2 a0[t]^3 Derivative[1][a0][t]^2),
Derivative[1][a0][t]^2 == 1 + 1/a0[t],
Derivative[1][a2][t] == (M2 *a0[t] - a2[t])/(
2 a0[t]^2 Derivative[1][a0][t]),
a0[1] == 1,
a2[1] == A2,
r0[1] == 3,
r2[1] == (5 (-3 A2 + M2))/4};
X = ParametricNDSolveValue[eqn, {a0, r0, a2, r2}, {t, 0, 2}, {M2, A2}]
Manipulate[
ParametricPlot[Evaluate@Through[X[M2, A2][[1]][t]], {t, 0, 2}], {M2,
0, 1}, {A2, 0, 1}]
X = ParametricNDSolveValue[{a0'[t] == Sqrt[M01/a0[t] + 1],
a0[1] == 1}, a0, {t, 0, 2}, {M01}]
Manipulate[Plot[X[M01][t], {t, 0, 2}, PlotRange -> All], {M01, 0, 2}]
UPDATE!!! When I run proposed solution I got this plot: