|
|
import numpy as np |
|
|
import pandas as pd |
|
|
import json |
|
|
import os |
|
|
|
|
|
|
|
|
c = 299792458 |
|
|
E_mc2 = c**2 |
|
|
TSR = E_mc2 / (1.38e-23) |
|
|
alpha = 1.0 |
|
|
Q = 2 ** (1 / 12) |
|
|
dark_energy_density = 5.96e-27 |
|
|
dark_matter_density = 2.25e-27 |
|
|
collision_distance = 1e-10 |
|
|
Hubble_constant = 70.0 |
|
|
Hubble_constant_SI = Hubble_constant * 1000 / 3.086e22 |
|
|
|
|
|
|
|
|
temperature_initial = 1.0 |
|
|
particle_density_initial = 5.16e96 |
|
|
particle_speed_initial = TSR * temperature_initial |
|
|
|
|
|
|
|
|
t_planck = 5.39e-44 |
|
|
t_simulation = t_planck * 1e5 |
|
|
|
|
|
|
|
|
particle_masses = { |
|
|
"up": 2.3e-3, |
|
|
"down": 4.8e-3, |
|
|
"charm": 1.28, |
|
|
"strange": 0.095, |
|
|
"top": 173.0, |
|
|
"bottom": 4.18, |
|
|
"electron": 5.11e-4, |
|
|
"muon": 1.05e-1, |
|
|
"tau": 1.78, |
|
|
"photon": 0, |
|
|
"electron_neutrino": 0, |
|
|
"muon_neutrino": 0, |
|
|
"tau_neutrino": 0, |
|
|
"W_boson": 80.379, |
|
|
"Z_boson": 91.1876, |
|
|
"Higgs_boson": 125.1, |
|
|
"gluon": 0, |
|
|
"proton": 0.938, |
|
|
"neutron": 0.939, |
|
|
"pion_plus": 0.140, |
|
|
"pion_zero": 0.135, |
|
|
"kaon_plus": 0.494, |
|
|
"kaon_zero": 0.498 |
|
|
} |
|
|
|
|
|
|
|
|
GeV_to_J = 1.60217662e-10 |
|
|
|
|
|
|
|
|
num_steps = int(t_simulation / t_planck) |
|
|
|
|
|
|
|
|
tunneling_probabilities = np.arange(0.1, 1.5, 0.1) |
|
|
|
|
|
|
|
|
data_dir = "big_bang_simulation_data" |
|
|
os.makedirs(data_dir, exist_ok=True) |
|
|
|
|
|
|
|
|
def relativistic_energy(particle_speed, particle_mass): |
|
|
epsilon = 1e-15 |
|
|
return particle_mass * c**2 / np.sqrt(max(1e-15, 1 - (particle_speed / c) ** 2 + epsilon)) |
|
|
|
|
|
def relativistic_momentum(particle_speed, particle_mass): |
|
|
epsilon = 1e-15 |
|
|
return particle_mass * particle_speed / np.sqrt(max(1e-15, 1 - (particle_speed / c) ** 2 + epsilon)) |
|
|
|
|
|
def update_speed(current_speed, current_temperature, particle_mass): |
|
|
"""Update the speed of a particle based on temperature and mass.""" |
|
|
return TSR * current_temperature |
|
|
|
|
|
def check_collision(particle_speeds, collision_distance): |
|
|
epsilon = 1e-15 |
|
|
for j in range(len(particle_speeds)): |
|
|
for k in range(j+1, len(particle_speeds)): |
|
|
if np.abs(particle_speeds[j] - particle_speeds[k]) < collision_distance + epsilon: |
|
|
return True, j, k |
|
|
return False, -1, -1 |
|
|
|
|
|
def handle_collision(particle_speeds, particle_masses, idx1, idx2, current_step): |
|
|
"""Handle a collision between two particles.""" |
|
|
if particle_masses[idx1] == 0 or particle_masses[idx2] == 0: |
|
|
|
|
|
return |
|
|
|
|
|
p1 = relativistic_momentum(particle_speeds[idx1, current_step], particle_masses[idx1]) |
|
|
p2 = relativistic_momentum(particle_speeds[idx2, current_step], particle_masses[idx2]) |
|
|
|
|
|
|
|
|
total_momentum = p1 + p2 |
|
|
total_mass = particle_masses[idx1] + particle_masses[idx2] |
|
|
v1_new = (total_momentum / total_mass) * (particle_masses[idx1] / total_mass) |
|
|
v2_new = (total_momentum / total_mass) * (particle_masses[idx2] / total_mass) |
|
|
|
|
|
particle_speeds[idx1, current_step], particle_speeds[idx2, current_step] = v1_new, v2_new |
|
|
|
|
|
|
|
|
|
|
|
for tunneling_probability in tunneling_probabilities: |
|
|
print(f"Simulating for tunneling probability: {tunneling_probability}") |
|
|
|
|
|
|
|
|
num_particles = len(particle_masses) |
|
|
particle_speeds = np.zeros((num_particles, num_steps)) |
|
|
particle_temperatures = np.zeros((num_particles, num_steps)) |
|
|
particle_masses_evolution = np.zeros((num_particles, num_steps)) |
|
|
tunneling_steps = np.zeros((num_particles, num_steps), dtype=bool) |
|
|
particle_momentum = np.zeros((num_particles, num_steps)) |
|
|
total_energy = np.zeros(num_steps) |
|
|
redshifts = np.zeros((num_particles, num_steps)) |
|
|
entanglement_entropies = np.zeros((num_particles, num_steps)) |
|
|
particle_states = np.random.rand(num_particles, num_steps) |
|
|
|
|
|
|
|
|
particle_masses_array = np.array([mass * GeV_to_J for mass in particle_masses.values()]) |
|
|
|
|
|
for j, (particle, mass) in enumerate(particle_masses.items()): |
|
|
particle_speeds[j, 0] = particle_speed_initial |
|
|
particle_masses_evolution[j, 0] = mass * GeV_to_J |
|
|
|
|
|
for current_step in range(1, num_steps): |
|
|
for j in range(num_particles): |
|
|
|
|
|
particle_temperatures[j, current_step] = particle_temperatures[j, current_step-1] * (1 - Hubble_constant_SI * t_planck) |
|
|
|
|
|
|
|
|
particle_speeds[j, current_step] = update_speed(particle_speeds[j, current_step-1], particle_temperatures[j, current_step], particle_masses_array[j]) |
|
|
|
|
|
|
|
|
if np.random.rand() < tunneling_probability: |
|
|
particle_speeds[j, current_step] = particle_speeds[j, 0] |
|
|
tunneling_steps[j, current_step] = True |
|
|
|
|
|
|
|
|
redshifts[j, current_step] = (1 + particle_speeds[j, current_step] / c) |
|
|
|
|
|
|
|
|
entanglement_entropies[j, current_step] = -np.sum(particle_states[j, current_step] * np.log(particle_states[j, current_step])) |
|
|
|
|
|
|
|
|
particle_masses_evolution[j, current_step] = particle_masses_evolution[j, current_step-1] * (1 - dark_energy_density * t_planck) |
|
|
|
|
|
|
|
|
collision_detected, idx1, idx2 = check_collision(particle_speeds[:, current_step], collision_distance) |
|
|
if collision_detected: |
|
|
handle_collision(particle_speeds, particle_masses_array, idx1, idx2, current_step) |
|
|
|
|
|
|
|
|
print(f"Calculated masses at the end of the simulation (Tunneling Probability: {tunneling_probability}):") |
|
|
for j, particle in enumerate(particle_masses.keys()): |
|
|
print(f"{particle}: {particle_masses_evolution[j, -1] / GeV_to_J:.4e} GeV") |
|
|
|
|
|
|
|
|
data_filename = os.path.join(data_dir, f"big_bang_simulation_data_{tunneling_probability:.2f}.json") |
|
|
data = { |
|
|
"tunneling_probability": tunneling_probability, |
|
|
"particle_masses_evolution": particle_masses_evolution.tolist(), |
|
|
"particle_speeds": particle_speeds.tolist(), |
|
|
"particle_temperatures": particle_temperatures.tolist(), |
|
|
"tunneling_steps": tunneling_steps.tolist(), |
|
|
"redshifts": redshifts.tolist(), |
|
|
"entanglement_entropies": entanglement_entropies.tolist() |
|
|
} |
|
|
with open(data_filename, "w") as f: |
|
|
json.dump(data, f) |