import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation import matplotlib.image as mpimg
N = 108 T_init = 1e12 # Počáteční teplota (K) η_critical = 6e-10 # Pozorovaná baryonová asymetrie chaos = 3.14159 # π-puls tension = 0.012 n_love = 0.618 dt = 0.1
def calculate_eta_b(φ, temp): cp_phase = np.mean(np.sin(φ)) eta = cp_phase**2 * temp / 1e14 # zjednodušený model return eta
theta = np.linspace(0, 2 * np.pi, N) r = np.ones(N) + 0.1 * np.random.randn(N) φ = chaos * np.sin(theta + np.random.rand(N) * 2 * np.pi)
fig, ax = plt.subplots(subplot_kw={'polar': True}) line, = ax.plot(theta, r, color='crimson', lw=2) title = ax.set_title("Sterile Neutrino Oscillation", va='bottom')
try: img = mpimg.imread("8534214c-b4a0-4a74-b2fb-9b38fe7c05b5 (1).png") imgbox = fig.add_axes([0.3, 0.3, 0.4, 0.4]) img_display = imgbox.imshow(img) imgbox.axis('off') imgbox.set_visible(False) except FileNotFoundError: imgbox = None
temperature = T_init def update(frame): global r, φ, n_love, temperature noise = tension * np.random.randn(N) r += noise + n_love * np.sin(φ) φ += chaos * dt # Chladnutí vesmíru (exponenciálně) temperature *= 0.995 # Výpočet baryonové asymetrie eta_b = calculate_eta_b(φ, temperature) r = np.clip(r, 0.5, 2.5) line.set_ydata(r) if eta_b >= η_critical: title.set_text(f"💖 Baryon Asymmetry Achieved! η₍B₎ ≈ {eta_b:.1e}") line.set_color('deeppink') if imgbox: imgbox.set_visible(True) else: title.set_text(f"Sterile Neutrino Oscillation\nT ≈ {temperature:.1e} K") line.set_color('crimson') if imgbox: imgbox.set_visible(False) return line, anim = FuncAnimation(fig, update, frames=666, interval=42, blit=False)
plt.show() anim.save("neutrino_oscillation.gif", writer='pillow')