I'm trying to solve the Friedmann equation as is given by:
$$ H^{2}=\Big(\frac{\dot{a}}{a}\Big)^{2}=H_{0}^{2}\big(\Omega_{m,0}a^{-3}+\Omega_{r,0}a^{-4}+\Omega_{\Lambda,0}a^{2.3}+\Omega_{k}a^{-2}\big),$$
with the following values of certain parameters $$\Omega_{m,0}=0.3, \,\Omega_{r,0}=0.001, \,\Omega_{\Lambda,0}=0.6, \, \Omega_{k}=1-\Omega_{r,0}-\Omega_{m,0}-\Omega_{\Lambda, 0} $$
and $w=-0.9$ where $w$ determines the peculiar $2.3$ from the equation above. To solve, naturally, I used Mathematica's NDSolve function:
m = 0.3;
r = 0.001;
d = 0.6;
k = 1 - m - r - d;
Hubble = 2.33*10^-18; age = 1/Hubble;
scale = NDSolve[{a'[t]/a[t] ==
Hubble*Sqrt[m*a[t]^-3 + r*a[t]^-4 + d*a[t]^-0.6 + k*a[t]^-2],
a[0] == 10^-10}, a[t], {t, 0, 300*age}]
Plotting this with Plot[Evaluate[{a[t], a'[t]} /. scale2], {t, 0, age}]
I get the bottom left picture. Trying to draw the derivative of this function results in failure (following the GetHelp section and the numerous answers to variants of this question on this board did not help) which is shown on the bottom right. However, my endgoal isn't just to draw the derivative, I want to plot how the Hubble parameter $H(t)=\frac{\dot{a}}{a}$ varies with time.
My attempts at solving:
Drawing just the derivative:
Plot[Evaluate[{a'[t]} /. scale2], {t, 0, age}, PlotStyle -> Blue]
Trying to plot the Hubble parameter:
Plot[Evaluate[{a'[t]/a[t]} /. scale2], {t, 0, age}]
which results in the same "empty" picture when trying to plot the derivative by itself. The blue above was added so I might hopefully notice it somewhere on the graph but to no avail. I've also tried using and ignoring Evaluate but no option worked. Also, is it possible to work with $a(t)$ now inside an integral, i.e. integrate an equation of the form $\int f\big(a(t)\big)\,dt$?
a
not the valuea[t]
and then remove the extra{}
withFirst
:scale = First@NDSolve[..., a, {t, 0, 300*age}]
. Does it work? $\endgroup$ – Michael E2 Jul 3 '19 at 1:13a[t]
witha
everywhere it shows up inscale
or? If I've understood correctly, I've tried that but then nothing plots at all, not even the solution $a(t)$. $\endgroup$ – Kandrax Jul 3 '19 at 1:24{t, 0, 300*age}
$\endgroup$ – Michael E2 Jul 3 '19 at 1:31{{a[t] -> ...}}
, which replaces onlya[t]
, nota'[t]
. If you make the two changes, it will become{a -> ...}
, which will replacea
in botha[t]
anda'[t]
by the solution function. $\endgroup$ – Michael E2 Jul 3 '19 at 1:37