restart;
with(plots):
#
# Define the Lane-Emden equation and its
# "standard" boundary condition
#
LE1:= (1/xi^2)* diff( xi^2*diff(theta(xi),xi), xi)+theta(xi)^n=0;
BCs:= theta(0)=1, D(theta)(0)=0;
#
# Numerically solve the Lane-Emden equation for
# n=0..5
#
cList:=[ black, red, green, blue, brown, cyan]:
PL:= [ seq
( odeplot
( dsolve( {subs(n=j, LE1), BCs},
numeric
),
xi = 0..10,
color = cList[j+1],
view = [0..10, -0.5..1]
),
j = 0..5
)
]:
display(PL);