#

Electron universe test

This test checks that in the electron universe:

  • $a \propto t^{2/3}$

Log file

There is a discrepancy in the scaling law of about $13 \%$ related to the change of the electron regime.

TODO: why is aT not conserved?

from particles import Particle
from library import StandardModelParticles as SMP
from evolution import Universe
from common import PARAMS, UNITS


PARAMS.T_initial = 100 * UNITS.MeV
PARAMS.T_final = 0.1 * UNITS.MeV
PARAMS.dx = 1e-2 * UNITS.MeV
PARAMS.infer()


Particles = []
electron = Particle(**SMP.electron)
Particles.append(electron)

universe = Universe(Particles, logfile="tests/electron_universe/log.txt")
universe.evolve()

initial_aT = universe.data['aT'][0]
print "a * T is conserved: {}".format(all([initial_aT == value for value in universe.data['aT']]))
initial_a = universe.data['a'][len(universe.data['a'])/2]
initial_t = universe.data['t'][len(universe.data['a'])/2] / UNITS.s
last_a = universe.data['a'][-1]
last_t = universe.data['t'][-1] / UNITS.s

print "a scaling discrepancy is: {:.2f}%"\
    .format(100 * (last_a / initial_a - (last_t / initial_t) ** (2./3.))
            / (last_t / initial_t) ** (2./3.))

universe.graphics.save(__file__)

raw_input("...")