OFFSET
1,1
LINKS
Jon Borwein and Richard Crandall, Closed Forms: What they are and why they matter
Eric Weisstein's MathWorld, Lane-Emden differential equation
Wikipedia, Lane-Emden equation
FORMULA
chi(0) = 0, chi'(0) = 1, r*chi''(r) = -chi(r)^2.
EXAMPLE
4.352874595946124676973570...
MATHEMATICA
digits = 25; d = 70; eps = 10^-digits; z[r_] = chi[r] /. NDSolve[chi[eps] == eps && chi'[eps] == 1 && r*chi''[r] == -chi[r]^2, chi[r], {r, eps, 5}, WorkingPrecision -> digits + d, MaxSteps -> 5*10^4] // First; r0 = r /. FindRoot[z[r] == 0, {r, 4}, WorkingPrecision -> digits + d]; RealDigits[r0][[1, 1 ;; digits]]
(* Second program using a rational function approximant *)
digits = 25; Clear[f]; f[kmax_?EvenQ] := f[kmax] = Module[{chi, a, r, r0, coes, sol, z}, chi[r_] = (r + Sum[a[k]*r^k, {k, 3, kmax-1, 2}])/(1 + Sum[a[k]*r^k, {k, 2, kmax, 2}]); coes = r*chi''[r] + chi[r]^2 // Together // Numerator //
CoefficientList[#, r]& // DeleteCases[#, 0]&; sol = Solve[Thread[coes == 0][[1 ;; kmax-1]], Table[a[k], {k, 2, kmax}]]; z[r_] = chi[r] /. sol // First; r0 = r /. FindRoot[z[r] == 0, {r, 4}, WorkingPrecision -> digits + 5]; RealDigits[r0][[1]][[1 ;; digits]]]; f[20]; f[kmax = 24]; While[f[kmax] != f[kmax-4], Print[kmax]; kmax = kmax+4]; f[kmax]
CROSSREFS
KEYWORD
nonn,cons
AUTHOR
Jean-François Alcover, Jan 23 2015
STATUS
approved