EXAMPLES: THE LAME-EMDEN ORDINARY DIFFERENTIAL EQUATION (ODE) FOR POLYTROPIC STELLAR INTERIORS ----------------------------------------------------------------- The general Lane-Emden ODE (y is mass density divided by mass density at the center of the star; x is distance from the center of the star multiplied by a scaling factor): y''(x) + 2y'(x)/x + y^n = 0 Symbol "^" means y is raised to the power n. Boundary conditions: y(0) = 1 y'(0) = 0 The parameter n is defined from the relation GAMMA = 1+1/n, where Pressure = Constant * Density^GAMMA (1) EXAMPLE #1 - n=1.5 polytrope (i.e., GAMMA = 5/3): In the runge.f ODE solver program, try the following: Domain of integration, etc.: NUM = 10000 A = 0.00001 <== note: x yields a discontinuity at zero for this ODE B = 15 SKIP = 10 Initial boundary conditions: U(1) = 0 <== i.e., value of y'(x) at beginning U(2) = 1 <== value of y(x) at beginning Function declarations: F1 = -2*U1/X - U2*SQRT(ABS(U2)) F2 = U1 F3 = 0 F4 = 0 . . . F10 = 0 Meaningful values for the solution of y(x) are for x=0 extending to the first zero value for y(x) (maximum x value is about 3.65). (2) EXAMPLE #2 - n=3 polytrope (i.e., GAMMA = 4/3): Domain of integration, etc.: NUM = 10000 A = 0.00001 B = 15 SKIP = 10 Initial boundary conditions: U(1) = 0 U(2) = 1 Function declarations: F1 = -2*U1/X - U2*U2*U2 F2 = U1 F3 = 0 F4 = 0 . . . F10 = 0 Meaningful values for the solution of y(x) are for x=0 extending to the first zero value for y(x) (maximum x value is about 6.90).