-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhubble-radius-4.py
More file actions
72 lines (58 loc) · 2.72 KB
/
Copy pathhubble-radius-4.py
File metadata and controls
72 lines (58 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import scipy.constants as const
import numpy as np
# Constants (CODATA 2018/2022 values for consistency)
hbar = const.hbar # Reduced Planck constant (J·s)
G = const.G # Gravitational constant (m^3·kg^−1·s^−2)
m_e = const.electron_mass # Electron mass (kg)
m_p = const.proton_mass # Proton mass (kg)
m_n = const.neutron_mass # Neutron mass (kg)
alpha = const.alpha # Fine-structure constant (dimensionless)
# Conversion constants
meters_per_lightyear = 9.461e15 # Approximate meters in one light-year
meters_to_gly = 1 / (meters_per_lightyear * 1e9) # Convert meters to gigalight-years
# JWST measured value (placeholder, in meters)
jwst_measured_value = 1.308e+26 # Approximate JWST value (corresponding to 13.81 Gly)
# Ratio of Compton wavelength to Planck length
lambda_e = hbar / (m_e * const.c) # Electron Compton wavelength (m)
L_planck = np.sqrt(hbar * G / const.c**3) # Planck length (m)
P = lambda_e / L_planck
# Precision formula
def precision_formula(P, alpha, lambdabare):
"""
Precision theory formula for calculation.
P: Ratio of Compton wavelength to Planck length
alpha: Fine-structure constant
lambdabare: Bare constant input
"""
term1 = np.e**(4 * np.e - 1 / alpha)
term2 = np.log(P**4 / alpha**3)**2
exponent = np.sqrt((term1 - term2) / 2)
return np.exp(exponent) * lambdabare
# Corrected formula: R = 2 * hbar^2 / (G * m_e * m_n * m_p)
def corrected_formula(hbar, G, m_e, m_p, m_n):
"""
Calculates the Hubble radius using the corrected formula.
"""
return 2 * hbar**2 / (G * m_e * m_n * m_p)
# Adjusted lambdabare value for scaling
lambdabare = 1e-5 # Example value in meters
# Calculate corrected formula result
corrected_result = corrected_formula(hbar, G, m_e, m_p, m_n)
corrected_result_gly = corrected_result * meters_to_gly # Convert to gigalight-years
# Calculate precision formula result
precision_result = precision_formula(P, alpha, lambdabare)
precision_result_gly = precision_result * meters_to_gly # Convert to gigalight-years
# Calculate precision difference (JWST deviation)
precision_difference = abs(corrected_result_gly - 13.81) / 13.81
# Output results
print("Hubble Radius Calculation:")
print(f"Corrected Formula:")
print(f"R (meters) = {corrected_result:.3e} m")
print(f"R (gigalight-years) = {corrected_result_gly:.3f} Gly")
print("\nPrecision Formula Calculation:")
print(f"R (meters) = {precision_result:.3e} m")
print(f"R (gigalight-years) = {precision_result_gly:.3f} Gly")
print("\nJWST Measured Value:")
print(f"JWST Value (meters) = {jwst_measured_value:.3e} m")
print(f"JWST Value (gigalight-years) = {jwst_measured_value * meters_to_gly:.3f} Gly")
print(f"\nPrecision Difference (Relative Error): {precision_difference:.5%}")