Spectrum Generation with the Formal Integral

[Lucy99b] describes an alternative method for calculating the TARDIS spectrum while eliminating nearly all Monte Carlo noise. Instead of calculating the spectrum directly from the Monte Carlo (or virtual) packets, we use information from the Monte Carlo simulation to build an analytical solution for the supernova spectrum.

Warning

The current implementation of the formal integral has several limitations. Please consult the corresponding section below to ensure that these limitations do not apply to your TARDIS.

Deriving the Integral

The spectrum generated by TARDIS includes light that is released in all directions. However, we approximate the supernova as spherically symmetric, meaning the light is released isotropically (equally in all directions). Thus, it will suffice to calculate the spectrum of light propagating in a single direction, call it the positive z-direction, and then sum over every direction. Specifically, we have

\[L_\nu = \int L_{\nu z} d\Omega = L_{\nu z} \int d\Omega = 4\pi L_{\nu z}\]

where \(L_\nu\) is the luminosity density at a frequency \(\nu\), \(L_{\nu z}\) is the luminosity density at a frequency \(\nu\) for light propagating in the positive z-direction, and \(\Omega\) is the solid angle.

We now must calculate \(L_{\nu z}\), starting with more symmetry considerations. The figures below show various rays of light (in black) coming out of the supernova at various values of \(p\), the impact parameter (defined as the distance from the x-axis, and can be seen as the value along the blue \(p\)-axis). By symmetry, the intensity \(I_\nu\) (luminosity density per unit area) along the ray will be identical anywhere on the blue circles shown (each of which has a constant impact parameter). Each circle has a circumference of \(2\pi p\). The luminosity density per unit distance on any given circle would then be \(I_\nu(p)\times 2\pi p\) (specifically, we are integrating the constant intensity around the circumference of the circle). Finally, to get \(L_{\nu z}\), we must integrate \(I_\nu(p)\times 2\pi p\) over every possible impact parameter, whose values range from zero to the outer radius of the supernova, \(r_\mathrm{boundary\_outer}\). So,

\[L_{\nu z} = \int_0^{r_\mathrm{boundary\_outer}} I_\nu(p)\times 2\pi p dp = 2\pi \int_0^{r_\mathrm{boundary\_outer}} I_\nu(p) p dp.\]

Putting this all together, we get

\[L_\nu = 8\pi^2 \int_0^{r_\mathrm{boundary\_outer}} I_\nu(p) p dp.\]

Note

A separate integral must be done for each frequency.

../../_images/formal_integral_sphere.jpg

Summary of Implementation

Since there is a continuum of frequencies represented in a spectrum, the formal integral cannot calculate the luminosity density at every frequency. Instead, we calculate \(L_\nu\) at a finite number of frequencies between the start and stop wavelengths provided in the Spectrum Configuration (converting between frequency and wavelength using \(\nu=\frac{c}{\lambda}\) where \(\lambda\) is wavelength and \(c\) is the speed of light) to give us an approximate spectrum. The number of frequencies we use is the num argument in the configuration. The frequencies are evenly spaced in wavelength space (exactly like histogram bins in Basic Spectrum Generation – see near the bottom of that page for more information).

Similarly, when doing the integral for a particular frequency, there is a continuum of impact parameters, so we cannot calculate \(I_\nu(p)\) for every single one. We instead use a finite list of impact parameters between 0 and the supernova’s outer boundary. The number of impact parameters we use is the value of points provided in the integrated section of the spectrum configuration.

For each frequency in our list of frequencies, TARDIS calculates \(I_\nu(p)\) for each \(p\) in the list of impact parameters, and then performs the integral \(\int_0^{r_\mathrm{boundary\_outer}} I_\nu(p) p dp\) using trapezoid integration. Our result is then multiplied by \(8\pi^2\) to get the correct luminosity density. The most involved part of the calculation is calculating \(I_\nu(p)\) for every combination of \(\nu\) in the list of frequencies and \(p\) in the list of impact parameters. This step is described in detail in the following section:

Calculating \(I_\nu(p)\)

Setting Up

We now calculate \(I_\nu(p)\), which is the intensity of the light with a lab frame (see Reference Frames) frequency \(\nu\) exiting a the supernova along a ray with impact parameter \(p\), as shown in the diagram below (we use the lab frame frequency as that is the frame in which the spectrum is observed). Specifically, we are looking for the intensity of light with a frequency \(\nu\) traveling to the right on the right side of the ray. We start by discussing the case where \(p>r_\mathrm{boundary\_inner}\) (where the ray does not intersect the photosphere). After, we will comment on what occurs when \(p<r_\mathrm{boundary\_inner}\).

../../_images/formal_integral_2d_above.png

Since every point on the ray has the same lab frame frequency, the co-moving frequency will vary along the ray. Specifically, at the point \(z_k\), we have

\[\nu_{\mathrm{co-moving},k}=(1-\beta_k \mu_k)\nu = \left( 1-\frac{r_k \cos(\theta)}{ct_\mathrm{explosion}}\right) \nu.\]

But, \(\cos(\theta)=\frac{z_k}{r_k}\), so

\[\nu_{\mathrm{co-moving},k}= \left( 1-\frac{z_k}{ct_\mathrm{explosion}}\right) \nu.\]

Notice that the co-moving frequency decreases as you move farther to the right, i.e. as the z-coordinate increases. With this, we can see where along the ray each line resonance occurs – a line with a frequency \(\nu_\mathrm{line}\) (which comes into resonance in the co-moving frame) will come into resonance at \(z=ct_\mathrm{explosion}\left(1-\frac{\nu_\mathrm{line}}{\nu}\right)\). The highest line frequency that can resonate on our ray is \(\nu_\mathrm{max}=\left(1-\frac{z_\mathrm{min}}{ct_\mathrm{explosion}}\right)\nu\), and the lowest line frequency that can resonate on our ray is \(\nu_\mathrm{min}=\left(1-\frac{z_\mathrm{max}}{ct_\mathrm{explosion}}\right)\nu\), where \(z_\mathrm{max}=\sqrt{r_\mathrm{boundary\_outer}^2-p^2}\) and by symmetry \(z_\mathrm{min}=-z_\mathrm{max}\). Every line between those frequencies will resonate on our ray – the points at which each line resonates is shown on the diagram (though in reality there are far more resonances than in this shown in this example diagram). The line resonating at the point \(z_0\) has the highest frequency of any line with a frequency below \(\nu_\mathrm{max}\), and the line resonating at the point \(z_{N-1}\) (the Nth line) has the highest frequency of any line with a frequency above \(\nu_\mathrm{min}\). Finally, we denote the intensity along the ray directly to the left of a point \(z_k\) as \(I_k^b\) with “b” for blue, as it has a slightly higher (“bluer”) frequency than the line resonating at \(z_k\). Similarly, we denote the intensity along the ray directly to the right of a point \(z_k\) as \(I_k^r\) with “r” for red, as it has a slightly lower (“redder”) frequency than the line resonating at \(z_k\).

Our goal is to find \(I_{N-1}^r\), as this is the light that will exit the supernova. We start with \(I_0^b=0\) (as we assume no light is entering the supernova externally). We then increment the intensity along the ray. To do this, we will need the line source function.

Constructing the Source Function

Our problem is to determine the intensity that is added to the ray at a line resonance \(l\rightarrow u\) based on the Monte Carlo packets.

Consider another transition \(i\rightarrow u\). We know (see \dot{E}_{lu} Estimator) that the rate at which energy density interacts with the transition is \(\dot{E}_{iu}\), i.e. the Edotlu estimator for the transition \(i\rightarrow u\). Now, sum up these estimators for every level \(i\) that can be excited to the level \(u\) – this will give us the rate at which energy density is added to the level \(u\) from all line transitions that can be excited to \(u\):

\[\dot{E}_u = \sum_{i < u} \dot E_{iu}.\]

The rate at which energy density is then de-excited from \(u\rightarrow l\) (and thus be deposited into the ray’s intensity at the resonance point of \(l\rightarrow u\)) is \(q_{ul}\dot{E}_u\), where \(q_{ul}\) is the fraction of energy at the level \(u\) which de-excites in the transition \(u\rightarrow l\). To turn this into the intensity added to the ray at a resonance point, for reasons presented in [Lucy99b], we include a factor of \(\frac{\lambda_{ul} t_\mathrm{explosion}}{4 \pi}\) where \(\lambda_{ul}\) is the wavelength of the light released in the transition \(u\rightarrow l\). So, the intensity that is added to our ray at the resonance point of \(l\rightarrow u\), which we will label as \(\left( 1- e^{-\tau_{lu}}\right) S_{ul}\), is

\[\left( 1- e^{-\tau_{lu}}\right) S_{ul} = \frac{\lambda_{ul} t}{4 \pi} q_{ul}\dot E_u.\]

Here, \(S_{ul}\) is the source function – interpret it as the intensity that is eligible to interact and end up on our ray (i.e. the source of the intensity that ends up on our ray). The actual intensity that ends up being added to the ray is the source function times the probability of the transition \(l\rightarrow u\), which is \(\left( 1- e^{-\tau_{lu}}\right)\).

Incrementing the Intensity

With this, we can now show how the intensity along our ray is incremented. First, at the kth line resonance there is an \(e^{-\tau_{k}}\) probability that light does not interact with the line. So, on the red side of the line we only have \(e^{-\tau_k}\) times the intensity on the blue side. But, we also have an intensity \(\left(1- e^{-\tau_k}\right) S_k\) that is added to the ray at the line resonance, so in total we have

\[I_k^r = I_k^b e^{-\tau_k} + \left( 1- e^{-\tau_k}\right) S_{k}.\]

If there is no electron scattering, this would be it; we would have \(I^b_{k+1}=I^r_k\) (the intensity on the left of a line would be the intensity on the right of the next line, since no interactions would take place between the locations of line resonances). However, with electron scattering, this is not the case. In between line resonances, light has a probability of \(e^{-\Delta \tau_e}\) of not scattering, where \(\Delta \tau_e=\sigma_{\mathrm{T}} n_e \Delta z\) is the electron scattering optical depth (see Physical Interactions). So, we would have \(I^b_{k+1}=I^r_ke^{-\Delta \tau_e}\). But, light can also scatter onto the ray. The intensity is increased by the mean intensity between the two resonance points times the probability of light scattering (and thus ending up on the ray), this probability being \(1-e^{-\Delta \tau_e}\). For the intensity between \(z_k\) and \(z_{k+1}\) we use the average of the mean intensity to the right of \(z_k\) and the mean intensity to the left of \(z_{k+1}\), which is \(\frac{1}{2}\left(J_k^r+J_{k+1}^b\right)\). Here, \(J^b_{k}\) is calculated from the j_blue estimator for the kth line transition (see J^b_{lu} Estimator), and then

\[J_k^r = J_k^b e^{-\tau_k} + \left( 1- e^{-\tau_k}\right) S_{k}\]

for the same reasoning as before (since \(J\), like \(I\), is an intensity and thus by identical logic is increased by \(\left( 1- e^{-\tau_k}\right) S_{k}\) at line resonances).

This gives us

\[I_{k+1}^b = I_k^r e^{-\Delta \tau_e} + (1-e^{-\Delta \tau_e})*\frac{1}{2}\left(J_k^r+J_{k+1}^b\right).\]

Note that here the mean intensity is acting as the source function. The final step, for computational ease, approximates \(e^{-\Delta \tau_e}\approx 1-\Delta \tau_e\) since the resonance points will be so close together that \(\Delta \tau_e << 1\). Our final result is then

\[I_{k+1}^b = I_k^r + \Delta \tau_e \left[ \frac{1}{2}\left(J_k^r + J_{k+1}^b\right) - I_k^r \right].\]

In summary, when calculating \(I_\nu(p)\) for some ray, we start with \(I_0^b=0\) and then calculate \(I_0^r\), then \(I_1^b\), then \(I_1^r\), etc. via the relations

\[I_k^r = I_k^b e^{-\tau_k} + \left( 1- e^{-\tau_k}\right) S_{k}\]
\[I_{k+1}^b = I_k^r + \Delta \tau_e \left[ \frac{1}{2}\left(J_k^r + J_{k+1}^b\right) - I_k^r \right]\]

until we get to \(I_{N-1}^r\), which is then used as the value of \(I_\nu(p)\) that goes into the integral \(L_\nu = 8\pi^2 \int_0^{r_\mathrm{boundary\_outer}} I_\nu(p) p dp\).

Note

The values for the source function (and the quantities and estimators used to calculate it), Sobolev optical depths, electron densities, the mean intensity, and all other non-constant quantities are taken in the cell in which the line resonance takes place. However, to improve results, TARDIS breaks down the model into more cells than used in the rest of the simulation and interpolates the values of these quantities. The number of shells TARDIS uses for this interpolation process is specified in the spectrum configuration.

Rays Intersecting the Photosphere

Since the photosphere is modeled as being optically thick, if a ray intersects the photosphere, anything that happens prior to the photosphere does not matter – the photosphere absorbs all light that hits it. Because of this, to calculate \(I_\nu(p)\) over a ray that starts by exiting the photosphere, we must slightly adjust our approach, as shown in the diagram below. In this case, we now have that the minimum z-coordinate is \(z_\mathrm{min}=\sqrt{r_\mathrm{boundary\_inner}^2-p^2}\), and we use this to determine the lowest possible resonant frequency on the ray as before, which will then give us \(z_0\), as it did before. Finally, since light along this ray is released from the photosphere, we have

\[I_0^b = B_\nu(T_\mathrm{inner})= \frac{2h}{c^2}\frac{\nu^3}{e^{h\nu/k_BT}-1}.\]

which is the Planck function (see Energy Packet Initialization). After making those small adjustments, we increment the intensity exactly as in the other case.

../../_images/formal_integral_2d_below.png

Current Limitations

The current implementation of the formal integral has some limitations:

  • Once electron scattering is included, the scheme only produces accurate results when many resonances occur on the rays. This is simply because otherwise the average of \(J^b\) and \(J^r\) does not provide an accurate representation of the mean intensity between successive resonance points. Also, \(d\tau\) can become large which can create unphysical, negative intensities.

It is always advised to check the results of the formal integration against the spectrum constructed from the emerging Monte Carlo packets.