Ejemplo n.º 1
0
universe.interactions += (
    SMI.neutrino_interactions(
        leptons=[electron],
        neutrinos=[neutrino_e]
    ) +
    NuI.sterile_leptons_interactions(
        thetas=thetas, sterile=sterile,
        neutrinos=[neutrino_e],
        leptons=[electron]
    )
    + NuI.sterile_hadrons_interactions(
        thetas=thetas, sterile=sterile,
        neutrinos=[neutrino_e],
        leptons=[electron],
        hadrons=[neutral_pion]
    )
)

universe.evolve(T_final)


""" ## Plots for comparison with articles """

""" ### JCAP10(2012)014, Figure 9
    <img src="figure_9.svg" width=100% /> """

""" ### JCAP10(2012)014, Figure 10
    <img src="figure_10.svg" width=100% />
    <img src="figure_10_full.svg" width=100% /> """
Ejemplo n.º 2
0
            leptons=[electron, muon, tau],
            hadrons=[neutral_pion, charged_pion]
        )
    )

universe.init_kawano(electron=electron, neutrino=neutrino_e)
universe.init_oscillations(SMP.leptons.oscillations_map(), (neutrino_e, neutrino_mu, neutrino_tau))

if universe.graphics:
    from plotting import (MassiveParticleMonitor, AbundanceMonitor)
    universe.graphics.monitor([
        (sterile, MassiveParticleMonitor),
        (sterile, AbundanceMonitor)
    ])

universe.evolve(T_final)

"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
<img src="figure_10_full.svg" width=100% />
"""

if universe.graphics:
    from tests.plots import articles_comparison_plots
    articles_comparison_plots(universe, [neutrino_e, neutrino_mu, neutrino_tau, sterile])
Ejemplo n.º 3
0
                f.write('{a:e}\t{t:e}\t{T:e}\t{aT:e}\t{rho:e}\t{n:e}\n'.format(
                    a=universe.params.a,
                    t=universe.params.t / UNITS.s,
                    T=universe.params.T / UNITS.MeV,
                    aT=universe.params.aT / UNITS.MeV,
                    rho=particle.energy_density / (UNITS.MeV)**4,
                    n=universe.params.a**3 * particle.density /
                    (UNITS.MeV)**3))
        with open(op.join(folder, "rho_nu.txt"), 'a') as f:
            f.write('{:e}'.format(universe.params.a) + '\t' + '{:e}'.format(
                sum(particle.energy_density / UNITS.MeV**4
                    for particle in [neutrino_e, neutrino_mu])) + '\n')


universe.step_monitor = step_monitor

universe.evolve(T_interactions_freeze_out, export=False)
# sterile._distribution *= 0
universe.interactions = tuple()
universe.evolve(T_final)
"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
<img src="figure_10_full.svg" width=100% />
"""
Ejemplo n.º 4
0
universe.interactions += (
    SMI.neutrino_interactions(leptons=[electron],
                              neutrinos=[neutrino_e, neutrino_mu])
)

universe.init_kawano(electron=electron, neutrino=neutrino_e)

if universe.graphics:
    universe.graphics.monitor([
        (neutrino_e, RadiationParticleMonitor),
        (neutrino_mu, RadiationParticleMonitor)
    ])


universe.evolve(T_interaction_freezeout, export=False)
universe.interactions = tuple()
universe.params.dy = 0.00625
universe.evolve(T_final)


"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
<img src="figure_10_full.svg" width=100% />
"""
Ejemplo n.º 5
0
    photon,
    neutron,
    proton,
    neutrino_e,
    neutrino_mu,
    neutrino_tau,
    electron,
    muon,
    tau
]

universe = Universe(params=params, folder=folder)
universe.add_particles(Particles)
universe.init_kawano(electron=electron, neutrino=neutrino_e)
universe.step_monitor = step_monitor

T_final = 3 * UNITS.MeV
universe.evolve(T_final, export=False)
T_final = 0.0008 * UNITS.MeV
params.dy = 0.003125
universe.evolve(T_final)

from tests.plots import cosmic_neutrino_temperature
cosmic_neutrino_temperature(universe)

print """
    Cosmic photon background temperature is {:.3f} times bigger than cosmic neutrinos temperature.
    Relative error is {:.3f} %
    """.format(universe.params.aT / UNITS.MeV,
               (universe.params.aT / UNITS.MeV - 1.401) / 1.401 * 100)
Ejemplo n.º 6
0
            with open(op.join(folder, particle.name.replace(' ', '_') + ".rho.txt"), 'a') as f:
                f.write(
                    '{a:e}\t{t:e}\t{T:e}\t{aT:e}\t{rho:e}\t{n:e}\n'.format(
                        a=universe.params.a,
                        t=universe.params.t / UNITS.s,
                        T=universe.params.T / UNITS.MeV,
                        aT=universe.params.aT / UNITS.MeV,
                        rho=particle.energy_density / UNITS.MeV**4,
                        n=universe.params.a**3 * particle.density / UNITS.MeV**3
                    )
                )


universe.step_monitor = step_monitor

universe.evolve(T_weak_decoupling, export=False)
universe.params.dy = 0.003125
universe.params.infer()
universe.evolve(T_washout, export=False)
sterile._distribution *= 0
universe.interactions = tuple()
universe.evolve(T_final)

"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
Ejemplo n.º 7
0
    neutron,
    proton
])

# angles=(0.5905, 0.805404, 0.152346)
universe.init_oscillations(SMP.leptons.oscillations_map(angles=(0.5905, 0.805404, 0)),
                           (neutrino_e, neutrino_mu_tau))

universe.interactions += (
    SMI.neutrino_interactions(leptons=[electron],
                              neutrinos=[neutrino_e, neutrino_mu_tau])
)

universe.init_kawano(electron=electron, neutrino=neutrino_e)

universe.evolve(T_simple, export=False)
universe.interactions = tuple()
universe.evolve(T_final)

"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
<img src="figure_10_full.svg" width=100% />
"""
Ejemplo n.º 8
0
neutron = Particle(**SMP.hadrons.neutron)
proton = Particle(**SMP.hadrons.proton)

universe.add_particles(
    [photon, electron, neutrino_e, neutrino_mu_tau, neutron, proton])

# angles=(0.5905, 0.805404, 0.152346)
universe.init_oscillations(
    SMP.leptons.oscillations_map(angles=(0.5905, 0.805404, 0)),
    (neutrino_e, neutrino_mu_tau))

universe.interactions += (SMI.neutrino_interactions(
    leptons=[electron], neutrinos=[neutrino_e, neutrino_mu_tau]))

universe.init_kawano(electron=electron, neutrino=neutrino_e)

universe.evolve(T_simple, export=False)
universe.interactions = tuple()
universe.evolve(T_final)
"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10
<img src="figure_10.svg" width=100% />
<img src="figure_10_full.svg" width=100% />
"""
Ejemplo n.º 9
0
    # Output the density and energy density of sterile neutrino
    if universe.step % 10 == 0:
        with open(os.path.join(folder,"sterile_densities.txt"), 'a') as f:
            f.write('{:e}'.format(universe.params.a) + '\t' + '{:e}'.format(universe.params.T/UNITS.MeV) + '\t'+'{:e}'.format(universe.params.aT/UNITS.MeV) + '\t'+'{:e}'.format(sterile.energy_density/(UNITS.MeV)**4) + '\t')
            f.write('{:e}'.format(sterile.density/(UNITS.MeV)**3) + '\n')
        with open(os.path.join(folder, "sterile_distribution.txt"), 'a') as f:
            f.write('{:e}'.format(universe.params.a) + '\t'+'{:e}'.format(universe.params.T/UNITS.MeV) + '\t')
            f.write('\t'.join([
                '{:e}'.format(x)
                for x in sterile._distribution
            ]) + '\n')


universe.step_monitor = step_monitor

universe.evolve(5 * UNITS.MeV, export=False)
universe.params.dy = 0.003125
universe.params.infer()

universe.evolve(T_washout, export=False)
universe.interactions = tuple()
universe.evolve(T_final)


"""
### Plots for comparison with articles

### JCAP10(2012)014, Figure 9
<img src="figure_9.svg" width=100% />

### JCAP10(2012)014, Figure 10