Temporal Evolution — flaremodel 0.2.0 documentation

# Temporal Evolution

We provide two special cases of temporal evolution for electrons. These are built around `cool_onestep()`. Although the function itself fast, temporal evolution requires many iterations using it. But, python is very slow and iterations requiring python operations can introduce huge performance hit. Source code for these avialable in flaremodel/temporal.py for guidance.

Note

If `dt` is not small enough, these will produce garbage results. Need to add a warning mechanism when it is the case (TBD).

class vdLEdist(g_min=1.0, g_max=100000.0, g_steps=50, sync_cool=True)

  Numerical simulation of adiabatic cooling for a spherical source. Gamma array can be obtained with vdLEdist._gamma.

  Parameters

    - g_min (float, default=1) – Minimum gamma of the grid

    - g_max (float, default=1e5) – Maximum gamma of the grid

    - g_steps (float, default=50) – Gamma steps per decade in logspace

    - sync_cool (boolean, default=True) – Whether to enable/disable synchrotron cooling

  get_ngamma(ts, N_e, B, R, exp_b, dt)

    Return electron distribution for array of ts

    Parameters

      - ts (np.ndarray) – 1-D time stamps to request electron distribution [s]

      - N_e (float) – Initial number of electrons

      - B (float) – Initial magnetic field [G]

      - R (float) – Initial size of the “blob” [cm]

      - exp_b (float) – Fixed expansion speed in units of c

      - dt (float) – Time resolution [s]

    Returns

      - Rs (np.ndarray) – 1-D array of R(ts) [cm]

      - Bs (np.ndarray) – 1-D array of B(ts) with B(R)~R^-2 [G]

      - Ne_t (np.ndarray) – 2-D array Ne_t(ts, gamma)

class GaussianInjectionEdist(sig_inj, t_peak_inj, t_esc=1e+99, g_min=1, g_max=100000.0, g_steps=50)

  Numerical simulation of particle injection with Gaussian profile including synchrotron cooling and particle escape. Gamma array can be obtained with GaussianInjectionEdist._gamma.

  Parameters

    - sig_inj (float) – Sigma of the particle injection profile [s]

    - t_peak_inj (float) – Peak time of the injection profile [s]

    - g_min (float, default=1) – Minimum gamma of the grid

    - g_max (float, default=1e5) – Maximum gamma of the grid

    - g_steps (float, default=50) – Gamma steps per decade in logspace

  get_ngamma(ts, N_e, B, dt)

    Return electron distribution for array of ts

    Parameters

      - ts (np.ndarray) – 1-D time stamps to request electron distribution [s]

      - N_e (float) – Total number of injected electrons

      - B (float) – Initial magnetic field [G]

      - dt (float) – Time resolution [s]

    Returns

      Ne_t – 2-D array Ne_t(ts, gamma)

    Return type

      np.ndarray