Skip to content

yo3-sun/Magglow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Magglow" - Magnetic Bullet Afterglow

Image

Magglow is a Julia module to calculate Gamma-ray Burst (GRB) afterglow light curves and spectra based on Magnetic Bullet model Y. Kusafuka & K. Asano (2024). The framework implements semi-analytic models for forward and reverse shock dynamics propagating in a stratified CSM and leptonic (synchrotron with self-absorption and self-Compton scattering with Klein-Nishina corrections) and hadronic (pp colisions and photomeson interactions) multimessenger emission mechanisms observed from arbitrary viewing angle.

Details of the methods can be found in Y. Kusafuka, K. Obayashi, K. Asano, & R. Yamazaki (2025).


The Magnetic Bullet model used in this code is successfully applied several afterglows, some of which can be found in the following works.

Attribution

If you use this code in your research, please cite the relevant papers:

Features

Magglow computes leptonic & hadronic emission from both forward & reverse shocks of a relativistic magnetized jet based on Magnetic Bullet model.

It includes:

  • Relativistic forward and reverse shock evolution
  • Any stratified density medium
  • Equal arrival time surface
  • Arbitrary viewing angles
  • leptonic photon emission (synchrotron/SSC)
  • hadronic neutrino production (pp collision/photo-meson interaction)
  • Internal absorption processes (SSA/gg absorption)
  • Klien-Nishina effects

It does not include (yet):

  • Lateral spreading
  • Structured jet
  • Sedov-Taylor solution
  • Polarization
  • EBL absorption

Installation

If you are working on a local copy of this repo and would like to install from source, you can the run the following from the top level directory of the project.

$ git clone https://github.com/yo3-sun/Magglow.git

Usage

In your Julia code, import the library with

include("PATH to Magglow.jl")
using .Magglow  

The main function of interest is MagneticBulletAfterglow!(z,DL,t_in,nu_in,Input,Output).

See example/LC_sample.jl for a simple example.

z is a source redshift.

DL is a source luminosity distance.

t_in is an array of observed time.

nu_in is an array of observed frequency.

Input has 20 macro- and microphysics arguments.

parameters list (click to expand/collapse)
  • 1 E0 isotropic equivalent energy in erg
  • 2 G0 initial Loretnz factor
  • 3 S0 initial magnetization
  • 4 D0 initial thickness, in cm
  • 5 n0 CSM number density, in cm-3
  • 6 k density slope (ISM:0 --- 2:wind)
  • 7 ts Fiducial time-scale for energy injection, in seconds, typically 0.
  • 8 n0 Number density of ISM, in cm-3
  • 9 epsiron_e thermal energy fraction in electrons for FS
  • 10 epsilon_B thermal energy fraction in magnetic field for FS
  • 11 p particle spectral index for FS (p>2)
  • 12 fe fraction of electrons that get accelerated for FS
  • 13 theta_j opening angle, in rad
  • 14 theta_o viewing angle, in rad
  • 15 epsiron_e,RS thermal energy fraction in electrons for RS
  • 16 epsilon_B,RS thermal energy fraction in magnetic field for RS
  • 17 p_RS particle spectral index for RS (p>2)
  • 18 fe_RS fraction of electrons that get accelerated for RS
  • 19 epsiron_p,RS thermal energy fraction in protons for RS
  • 20 fp_RS fraction of protons that get accelerated for RS

Output is an array of output observed flux.

arguments list (click to expand/collapse)
  • 1 FS e-synchrotron
  • 2 FS p-synchrotron
  • 3 FS e-SSC
  • 4 RS e-synchrotron
  • 5 RS p-synchrotron
  • 6 RS e-SSC
  • 7 FS pp e-neutrino
  • 8 FS pp mu-neutrino
  • 9 FS pp pi0 gamma
  • 10 FS pg e-neutrino
  • 11 FS pg mu-neutrino
  • 12 FS pg pi0 gamma
  • 13 RS pp e-neutrino
  • 14 RS pp mu-neutrino
  • 15 RS pp pi0 gamma
  • 16 RS pg e-neutrino
  • 17 RS pg mu-neutrino
  • 18 RS pg pi0 gamma

is_calc expresses the radiation processes.

arguments list (click to expand/collapse)
  • 1 electron synchrotron
  • 2 proton synchrotron
  • 3 electron SSC
  • 4 pp collision
  • 5 photo-meson interaction

Parameter Estimation

You can estimate several parameters using Magglow by incorporated with statistical analysis tools such as Monte Carlo or nested sampling method. MagglowNest is a sample parameter estimation Bayesian interface by MultiNest. We provide some example data files in the data folder. Please keep your copy as the original repository to ensure all data paths work correctly. A sample job script file in example/MagglowNest_sample.sh may also be useful.

About

Multimessenger GRB afterglow simulator based on Magnetic Bullet model.

Topics

Resources

License

Stars

Watchers

Forks