# Ploting solution to a differential equation with different parameters

I want to plot the solution to the following differential equation with different values of parameters. What is the best way to do it instead of solving the equation individually by inserting the parameters?

1/xi^2 D[xi^2 D[theta[xi],xi],xi] == - theta[xi]^n
xi = {0,10}
n = 0,1,1.5,3


n is the parameter that takes all these above values. And theta needs to be solved as a function of xi.

• You need to give initial conditions also. Jun 21 at 1:01

Something to get you started,. You can use Manipulate ClearAll[theta, xi, n];
ode = 1/xi^2 D[xi^2 D[theta[xi], xi], xi] == -theta[xi]^n
ic = {theta[$$MachineEpsilon] == 1, (D[theta[xi], xi] == 1) /. xi ->$$MachineEpsilon};
Manipulate[
sol = NDSolveValue[{ode /. {n -> n0}, ic},
theta, {xi, \$MachineEpsilon, 10}, Method -> {"StiffnessSwitching"}];
Plot[sol[xi], {xi, 0, 10}, PlotRange -> All, PlotStyle -> Red,
GridLines -> Automatic, GridLinesStyle -> LightGray]
,
{{n0, 0, "n"}, {0, 1, 1.5, 3}},
TrackedSymbols :> {n0}
]