Skip to content

Commit

Permalink
Formal integral documentation (#1921)
Browse files Browse the repository at this point in the history
* creating file

* rough draft minus I_nu(p) calculation

* typo fix

* adding ggb file

* adding images

* typo fix

* changing images

* very rough draft

* fixing link

* making edits

* fixing links

* fixing equation

* fix docstring
  • Loading branch information
isaacgsmith authored May 23, 2022
1 parent 0cd46f5 commit 9f6d855
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 195 deletions.
4 changes: 2 additions & 2 deletions docs/physics/est_and_conv/estimators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"\n",
"</div>\n",
"\n",
"These estimators allow us to calculate the [radiative temperature](../setup/model.ipynb#Radiative-Temperature) $T_\\mathrm{rad}$ and [dilution factor](../setup/model.ipynb#Dilution-Factor) $W$ in each shell using\n",
"These estimators allow us to calculate the [radiative temperature](../setup/model.ipynb#Temperatures) $T_\\mathrm{rad}$ and [dilution factor](../setup/model.ipynb#Dilution-Factor) $W$ in each shell using\n",
"\n",
"$$T_{\\mathrm{rad}} = \\frac{h}{k_{\\mathrm{B}}} \\frac{\\pi^4}{360 \\zeta(5)} \\frac{\\bar \\nu}{J}$$\n",
"\n",
Expand Down Expand Up @@ -86,7 +86,7 @@
"\n",
"</div>\n",
"\n",
"If set to detailed mode (see [plasma configuration](../../io/configuration/components/plasma.rst)), the `J_blue` plasma property will will be replaced with the value of the $J^b_{lu}$ estimator (the raw estimator times the factor of $\\frac{ct_\\mathrm{explosion}}{4\\pi V \\Delta t}$). Otherwise, the `J_blue` in the plasma are calculated as they typically are in the plasma calculations, and the $J^b_{lu}$ estimator is only used for the [formal integral](../spectrum/sourceintegration.rst)."
"If set to detailed mode (see [plasma configuration](../../io/configuration/components/plasma.rst)), the `J_blue` plasma property will will be replaced with the value of the $J^b_{lu}$ estimator (the raw estimator times the factor of $\\frac{ct_\\mathrm{explosion}}{4\\pi V \\Delta t}$). Otherwise, the `J_blue` in the plasma are calculated as they typically are in the plasma calculations, and the $J^b_{lu}$ estimator is only used for the [formal integral](../spectrum/formal_integral.rst)."
]
},
{
Expand Down
Binary file added docs/physics/images/formal_integral_2d.ggb
Binary file not shown.
Binary file added docs/physics/images/formal_integral_2d_above.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/physics/images/formal_integral_2d_below.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/physics/images/formal_integral_sphere.ggb
Binary file not shown.
Binary file added docs/physics/images/formal_integral_sphere.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/physics/montecarlo/propagation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ When a packet is moved into a new cell, as mentioned before, it is moved to the
boundary, the plasma properties are recalculated, and the propagation direction of the packet is updated (using
:math:`\mu_f = \frac{l + r_i \mu_i}{r_f}`).

.. _physical-interactions:

Physical Interactions
---------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/physics/spectrum/basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
"source": [
"You may notice that the bins are not uniformly spaced with respect to wavelength. This is because we use the same bins for both wavelength and frequency, and thus the bins which are uniformly spaced with respect to frequency are not uniformly spaced with respect to wavelength. This is okay though, since luminosity density allows us to alter the bins without significantly altering the graph!\n",
"\n",
"Another thing you may notice in these graphs is the lack of a smooth curve. This is due to **noise**: the effects of the random nature of Monte Carlo simulations. This makes it very difficult to get a precise spectrum without drastically increasing the number of Monte Carlo packets. To solve this problem, TARDIS uses [virtual packets](virtualpackets.rst) and [the formal integral method](sourceintegration.rst) to generate a spectrum with less noise."
"Another thing you may notice in these graphs is the lack of a smooth curve. This is due to **noise**: the effects of the random nature of Monte Carlo simulations. This makes it very difficult to get a precise spectrum without drastically increasing the number of Monte Carlo packets. To solve this problem, TARDIS uses [virtual packets](virtualpackets.rst) and [the formal integral method](formal_integral.rst) to generate a spectrum with less noise."
]
}
],
Expand Down
150 changes: 150 additions & 0 deletions docs/physics/spectrum/formal_integral.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/physics/spectrum/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ below.
.. toctree::
basic
virtualpackets
sourceintegration
formal_integral
191 changes: 0 additions & 191 deletions docs/physics/spectrum/sourceintegration.rst

This file was deleted.

1 change: 1 addition & 0 deletions tardis/montecarlo/montecarlo_numba/formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def numba_formal_integral(
intensities at each p-ray multiplied by p
frequency x p-ray grid
"""

# todo: add all the original todos
# Initialize the output which is shared among threads
L = np.zeros(inu_size, dtype=np.float64)
Expand Down

0 comments on commit 9f6d855

Please sign in to comment.