HorizonMath / numerics /feigenbaum_delta.py
anonymousAIresearcher's picture
Add data, numerics, and validators
848d4b7
"""
Reference numerical computation for: Feigenbaum Constant δ
The Feigenbaum constant δ is computed via the period-doubling bifurcation cascade.
We find successive bifurcation points r_n of the logistic map f(x) = rx(1-x) and
compute δ = lim (r_{n-1} - r_{n-2}) / (r_n - r_{n-1}).
For higher precision, we use the renormalization group approach.
"""
from mpmath import mp, mpf, sqrt
# Set precision to 110 decimal places
mp.dps = 110
def find_period_doubling_points(max_period_power=15):
"""
Find the parameter values r_n where 2^n-periodic orbits first appear
in the logistic map f(x) = rx(1-x).
"""
bifurcation_points = []
# r_1 = 3 (period-2 appears)
# We find these by solving for when the periodic orbit becomes stable
def logistic(x, r):
return r * x * (1 - x)
def iterate(x, r, n):
for _ in range(n):
x = logistic(x, r)
return x
def find_bifurcation(r_low, r_high, period):
"""Find where period-period orbit bifurcates to period-2*period."""
# At bifurcation, the derivative of f^period at fixed point = -1
# Use bisection to find the bifurcation point
for _ in range(200): # High precision bisection
r_mid = (r_low + r_high) / 2
# Find the periodic orbit
x = mpf("0.5")
for _ in range(1000): # Iterate to attractor
x = iterate(x, r_mid, period)
# Check stability by computing derivative of f^period
x0 = x
deriv = mpf(1)
for _ in range(period):
deriv *= r_mid * (1 - 2 * x)
x = logistic(x, r_mid)
if deriv < -1:
r_high = r_mid
else:
r_low = r_mid
return (r_low + r_high) / 2
# Known approximate bifurcation points to seed the search
r_approx = [
mpf("3"), # 2-cycle
mpf("3.449489742783178"), # 4-cycle
mpf("3.544090359551568"), # 8-cycle
mpf("3.564407266095291"), # 16-cycle
mpf("3.568759419544629"), # 32-cycle
mpf("3.569691609801538"), # 64-cycle
mpf("3.569891259378826"), # 128-cycle
mpf("3.569934018702598"), # 256-cycle
mpf("3.569943176523345"), # 512-cycle
mpf("3.569945137342347"), # 1024-cycle
mpf("3.569945557035068"), # 2048-cycle
mpf("3.569945646923247"), # 4096-cycle
]
# Refine each bifurcation point
for i, r_init in enumerate(r_approx[:10]):
period = 2 ** i
r_low = r_init - mpf("0.01")
r_high = r_init + mpf("0.01")
if i > 0:
r_low = bifurcation_points[-1]
r_bif = find_bifurcation(r_low, r_high, period)
bifurcation_points.append(r_bif)
return bifurcation_points
def compute():
"""
Compute the Feigenbaum constant δ from period-doubling bifurcations.
δ = lim_{n→∞} (r_{n-1} - r_{n-2}) / (r_n - r_{n-1})
For high precision, we use the published value computed via renormalization
group methods to 1000+ digits.
"""
# The period-doubling approach gives limited precision
# For ground truth, we use the high-precision published value
# Feigenbaum δ computed to 100+ digits
# Source: K. Briggs (1997), D. Broadhurst (1999)
# Available here: https://oeis.org/A006890
delta = mpf(
"4.66920160910299067185320382046620161725818557747576863274565134300"
"4134330211314737138689744023948013817165984855189815134408627142027"
)
return delta
if __name__ == "__main__":
result = compute()
print(str(result))