I'm trying to plot the solutions of the second order differential equation d^2R/dt^2 = GM/R^2 + Lz^2/R^3. I'm reducing this to a system of first order ODEs and then using RK4 to solve this system.
My code is given by
function RK4system()
Tsim = 10...
The stars in our Galaxy have luminosities ranging from $L_{\text{min}}$ to $L_{\text{max}}$. Suppose that the number of stars per unit volume with luminosities in the range of $L$, $L+dL$ is $n(L)dL$. The total number of stars per unit volume if clearly $$n = \int_{L_{min}}^{L_{max}} n(L)dL.$$...