Difference between revisions of "Talk:2853: Redshift"
(→Calculation: it's obviously not a constant lol) |
(→Calculation: a few formatting tweaks) |
||
Line 45: | Line 45: | ||
z1 = 0.00000000038 | z1 = 0.00000000038 | ||
look_back_time_years_z1 = zt(z1, H0, OL, Om, age0) * 1e9 # from Gyr to years | look_back_time_years_z1 = zt(z1, H0, OL, Om, age0) * 1e9 # from Gyr to years | ||
− | print("Look-back time for z =" | + | print("Look-back time for z=" + |
f"{format_float_positional(z1)}: {look_back_time_years_z1:.1f} years") | f"{format_float_positional(z1)}: {look_back_time_years_z1:.1f} years") | ||
Line 51: | Line 51: | ||
z2 = -0.000000000000045 | z2 = -0.000000000000045 | ||
look_back_time_hours_z2 = zt(z2, H0, OL, Om, age0) * 1e9 * 365.25 * 24 | look_back_time_hours_z2 = zt(z2, H0, OL, Om, age0) * 1e9 * 365.25 * 24 | ||
− | print("Look-back time for z =" | + | print("Look-back time for z=" + |
f"{format_float_positional(z2)}: {look_back_time_hours_z2:.1f} hours") | f"{format_float_positional(z2)}: {look_back_time_hours_z2:.1f} hours") | ||
</nowiki></pre></tt> | </nowiki></pre></tt> | ||
Line 58: | Line 58: | ||
<tt><pre><nowiki> | <tt><pre><nowiki> | ||
− | Look-back time for z = 0.00000000038: 5.4 years | + | Look-back time for z=0.00000000038: 5.4 years |
− | Look-back time for z = -0.000000000000045: -5.5 hours | + | Look-back time for z=-0.000000000000045: -5.5 hours |
</nowiki></pre></tt> | </nowiki></pre></tt> | ||
Line 78: | Line 78: | ||
plt.grid(True, color='lightgray') | plt.grid(True, color='lightgray') | ||
− | for t in range(0, | + | for t in range(0,1 3): |
z = redshifts[min(range(len(look_back_times)), | z = redshifts[min(range(len(look_back_times)), | ||
− | key=lambda i: abs(look_back_times[i]-t))] | + | key=lambda i: abs(look_back_times[i] - t))] |
plt.text(z, t, f" z = {z:.2f}", ha='left', va='center') | plt.text(z, t, f" z = {z:.2f}", ha='left', va='center') | ||
− | for z in range(6,21,2): | + | for z in range(6, 21, 2): |
t = zt(z, H0, OL, Om, age0) | t = zt(z, H0, OL, Om, age0) | ||
plt.text(z, t, f"{t:.2f}", ha='center', va='bottom') | plt.text(z, t, f"{t:.2f}", ha='center', va='bottom') |
Revision as of 12:09, 12 November 2023
Does it make any sense to try and relate the two Z values to a more "normal" time? MAP (talk) 21:08, 10 November 2023 (UTC)
I have added exactly that, using `astropy.cosmology` for the calculations Juandesant (talk) 21:16, 10 November 2023 (UTC)
There is a big error in the current explanation, saying it means they were interested in this since the early universe, but that would only be true if the z value was much closer to 1. I'm not exactly sure as I haven't done the math, but with that many decimal places of zero's it is probably near enough history to be during their lifetime. So the joke isn't being interested in the early universe since the early universe, but rather so interested in it that they talk about other things with the same terminology.--172.70.126.142 21:18, 10 November 2023 (UTC)
Why aren't these values expressed in scientific notation? Separately, do they make sense logarithmically? JohnHawkinson (talk) 07:12, 11 November 2023 (UTC)
- Part of the joke is that the values are unwieldy to use compared to everyday language and units. The scientific notation would have lessened this. However they are given in a universal standard time instead of some solar system or human related units, so they generally should be clearly preferred. Sebastian --172.68.110.188 15:37, 11 November 2023 (UTC)
I feel like the Earth's gravitational field would affect the answer as z goes to zero? 172.69.22.210 06:57, 12 November 2023 (UTC)
Calculation
Thanks to ChatGPT-4 and the Fortran-90 code from arxiv:1303.5961 (which please see, it's really cool) here's how to get the look-back time from redshift in Python:
from scipy.integrate import quad from numpy import format_float_positional # Cosmological parameters from the Fortran params.f90 header #H0 = 67.15 # Hubble parameter in km/s/Mpc (or, 73.5: the "crisis in cosmology") H0 = 69.32 # from Explainxkcd for 2853: Redshift; seems a consensus compromise OL = 0.683 # Density parameter for dark energy Om = 0.317 # Density parameter for matter # Define the integrand function def agef(z, OL, Om): return 1 / ((1 + z) * ((OL + Om * (1 + z)**3)**0.5)) # Function to calculate the age of the universe at redshift z in Gyr def age_z(z, H0, OL, Om): integral, _ = quad(agef, z, 1000, args=(OL, Om)) return integral * 977.8 / H0 # Current age of the universe at redshift 0 in Gyr age0 = age_z(0, H0, OL, Om) # Function to calculate the look-back time at redshift z in Gyr def zt(z, H0, OL, Om, age0): return age0 - age_z(z, H0, OL, Om) # For z = 0.00000000038 z1 = 0.00000000038 look_back_time_years_z1 = zt(z1, H0, OL, Om, age0) * 1e9 # from Gyr to years print("Look-back time for z=" + f"{format_float_positional(z1)}: {look_back_time_years_z1:.1f} years") # For z = -0.000000000000045 z2 = -0.000000000000045 look_back_time_hours_z2 = zt(z2, H0, OL, Om, age0) * 1e9 * 365.25 * 24 print("Look-back time for z=" + f"{format_float_positional(z2)}: {look_back_time_hours_z2:.1f} hours")
The output being:
Look-back time for z=0.00000000038: 5.4 years Look-back time for z=-0.000000000000045: -5.5 hours
And should you wish to make this quick reference chart for interpreting observations in the JWST era:
import matplotlib.pyplot as plt redshifts = [z * 20 / 299 for z in range(300)] # 300 steps, 0 to 20 look_back_times = [zt(z, H0, OL, Om, age0) for z in redshifts] plt.plot(redshifts, look_back_times) plt.title('Look-back Time by Redshift') plt.xlabel('z') plt.ylabel('Billion Years Ago') plt.xticks(range(21)) plt.yticks(range(15)) plt.grid(True, color='lightgray') for t in range(0,1 3): z = redshifts[min(range(len(look_back_times)), key=lambda i: abs(look_back_times[i] - t))] plt.text(z, t, f" z = {z:.2f}", ha='left', va='center') for z in range(6, 21, 2): t = zt(z, H0, OL, Om, age0) plt.text(z, t, f"{t:.2f}", ha='center', va='bottom') plt.show()
172.69.22.12 08:50, 12 November 2023 (UTC)