Skip to content

Commit

Permalink
grammar and other small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacgsmith committed Aug 2, 2022
1 parent 3e9e30f commit 65ea85b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/physics/montecarlo/estimators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ Implementation

As previously discussed, a major component of each Monte Carlo iteration is the packet propagation process. During the packet propagation process this step, the :math:`J` and :math:`\bar \nu` estimators are updates every time a packet is moved to the next event location. Specifically, every time a packet is moved, :math:`\varepsilon l` is added to the "running total" :math:`J` estimator in the shell where the packet is, and :math:`\varepsilon \nu l` is added to the "running total" :math:`\bar\nu` estimator in the shell where the packet is (where :math:`l` is the distance the packet is moved, and :math:`\varepsilon` and :math:`\nu` are respectively the packet's co-moving energy and frequency at the beginning of the packet's path). The factor of :math:`\frac{1}{4\pi V\Delta t}`, for computational ease, is not attached to the estimators but is included during any calculations using these estimators, see :doc:`../update_and_conv/update_and_conv`.

Additionally, during the propagation process, every time a packet passes through a Sobolev point, meaning it reaches a co-moving frequency of :math:`nu_{lu}` for some transition :math:`l\rightarrow u` and thus comes in resonance with an atomic line, the :math:`J^b_{lu}` for that atomic transition in the shell it is in is incremented by :math:`\frac{\varepsilon}{\nu_\mathrm{lab}}`, where :math:`\varepsilon` is the packet's energy and :math:`\nu_\mathrm{lab}` is the packet's lab-frame frequency. As before, for computational ease, the factor :math:`\frac{ct_\mathrm{explosion}}{4\pi V \Delta t}` is included in calculations involving the estimator (such as when `updating <../update_and_conv/update_and_conv.ipynb#updating-other-quantities>`_ :math:`J^b_{lu}` in the plasma or in the :ref:`formal integral <formal_integral>`). Similarly, when a packet passes through a Sobolev point, the :math:`\dot{E}_{lu}` for that atomic transition in the shell it is in is incremented by :math:`\varepsilon`, and once again, for computational ease, the term :math:`\frac{1}{\Delta t V} \left( 1- e^{-\tau_{lu}}\right)` is not included until calculations involving the estimator are performed (specifically in the :ref:`formal integral <formal_integral>`).
Additionally, during the propagation process, every time a packet passes through a Sobolev point, meaning it reaches a co-moving frequency of :math:`\nu_{lu}` for some transition :math:`l\rightarrow u` and thus comes in resonance with an atomic line, the :math:`J^b_{lu}` for that atomic transition in the shell it is in is incremented by :math:`\frac{\varepsilon}{\nu_\mathrm{lab}}`, where :math:`\varepsilon` is the packet's energy and :math:`\nu_\mathrm{lab}` is the packet's lab-frame frequency. As before, for computational ease, the factor :math:`\frac{ct_\mathrm{explosion}}{4\pi V \Delta t}` is included in calculations involving the estimator (such as when `updating <../update_and_conv/update_and_conv.ipynb#updating-other-quantities>`_ :math:`J^b_{lu}` in the plasma or in the :ref:`formal integral <formal_integral>`). Similarly, when a packet passes through a Sobolev point, the :math:`\dot{E}_{lu}` for that atomic transition in the shell it is in is incremented by :math:`\varepsilon`, and once again, for computational ease, the term :math:`\frac{1}{\Delta t V} \left( 1- e^{-\tau_{lu}}\right)` is not included until calculations involving the estimator are performed (specifically in the :ref:`formal integral <formal_integral>`).

.. note:: Since the ``j_blue`` and ``Edotlu`` estimators are updated every time a packet comes into resonance with an atomic line (not necessarily going through a line interaction), these estimators are equal to zero in some shell for a specific line if (and only if) no packet comes into resonance with that line within the shell.
10 changes: 5 additions & 5 deletions docs/physics/update_and_conv/update_and_conv.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"get an accurate spectrum). This is done in an iterative process. After each [Monte Carlo iteration](../montecarlo/index.rst) (which sends light through the supernova ejecta), TARDIS uses the [Monte Carlo estimators](../montecarlo/estimators.rst)\n",
"how the propagating light affects the plasma state, after which the plasma state is updated (as will be explained below and demonstrated in the code example). We do this many times, and attempt to have the plasma state converge\n",
"to the steady-state we are looking for. In fact, all but the last Monte Carlo iteration is used for this purpose\n",
"(after which TARDIS will have the needed plasma state for its last iteration which calculates the spectrum).\n",
"(after which TARDIS will have the necessary plasma state for its last iteration which calculates the spectrum).\n",
"\n",
"<div class=\"alert alert-info\">\n",
"\n",
Expand Down Expand Up @@ -123,7 +123,7 @@
"\n",
"TARDIS also allows users to stop the simulation if the simulation reaches a certain level of convergence, which is checked upon the call of the ``advance_state`` method. To enable this, users must set ``stop_if_converged=True`` in the convergence configuration. Also in the configuration, the quantities ``hold_iterations``, ``threshold``, and ``fraction`` are be specified to determine convergence as follows:\n",
"\n",
"For the simulation to be considered to have converged, for ``hold_iterations`` successive iterations, the estimated values of $T_\\mathrm{rad}$, $W$, and $T_\\mathrm{inner}$ may differ from the previous value by a fraction of at most ``threshold`` in at least ``fraction`` fraction of the shells (for $T_\\mathrm{inner}$, since there is only one value, the ``fraction`` part does not apply). For example, if ``hold_iterations=3``, ``threshold=0.05`` for all three quantities, and ``fraction=.8``, the simulation will be considered to have converged if for 3 successive iterations the estimated values of $T_\\mathrm{rad}$ and $W$ differ from the current respective values by at most 5% in at least 80% of the shells, *and* the estimated $T_\\mathrm{inner}$ differs by at most 5%. See the [convergence configuration schema](../../io/configuration/components/montecarlo.rst#damped-convergence-strategy) for default values of these quantities.\n",
"For the simulation to be considered to have converged, for ``hold_iterations`` successive iterations, the estimated values of $T_\\mathrm{rad}$, $W$, and $T_\\mathrm{inner}$ may differ from the previous value by a fraction of at most ``threshold`` in at least ``fraction`` fraction of the shells (for $T_\\mathrm{inner}$, since there is only one value, the ``fraction`` part does not apply). For example, if ``hold_iterations=3``, ``threshold=0.05`` for all three quantities, and ``fraction=0.8``, the simulation will be considered to have converged if for 3 successive iterations the estimated values of $T_\\mathrm{rad}$ and $W$ differ from the current respective values by at most 5% in at least 80% of the shells, *and* the estimated $T_\\mathrm{inner}$ differs by at most 5%. See the [convergence configuration schema](../../io/configuration/components/montecarlo.rst#damped-convergence-strategy) for default values of these quantities.\n",
"\n",
"<div class=\"alert alert-info\">\n",
"\n",
Expand All @@ -144,7 +144,7 @@
"\n",
"## Updating Other Quantities\n",
"\n",
"Other quantities in the plasma state can depend on other estimators. Currently, this is only implemented for the ``j_blue`` estimator: If ``radiative_rates_type`` in the [plasma configuration](../../io/configuration/components/plasma.rst) is set to ``detailed``, the `j_blues` plasma property will will be replaced with the value of the [$J^b_{lu}$ estimator](../montecarlo/estimators.rst#j-blue) (the raw estimator times the factor of $\\frac{ct_\\mathrm{explosion}}{4\\pi V \\Delta t}$, once again see [Implementation](../montecarlo/estimators.rst#implementation)), which would then affect other plasma properties that depend on the `j_blues` values (see [Plasma](../setup/plasma/index.rst)). Otherwise, the `j_blues` values 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). Even in the former case, while the estimator does contribute to the updating of the plasma when the ``advance_state`` method is called, it does **not** contribute to the determination of if the simulation has converged, and it does **not** show up in the convergence logging or convergence plots."
"Other quantities in the plasma state can depend on other estimators. Currently, this is only implemented for the ``j_blue`` estimator: If ``radiative_rates_type`` in the [plasma configuration](../../io/configuration/components/plasma.rst) is set to ``detailed``, the `j_blues` plasma property will will be replaced with the value of the $J^b_{lu}$ [estimator](../montecarlo/estimators.rst#j-blue) (the raw estimator times the factor of $\\frac{ct_\\mathrm{explosion}}{4\\pi V \\Delta t}$, once again see [Implementation](../montecarlo/estimators.rst#implementation)), which would then affect other plasma properties that depend on the `j_blues` values (see [Plasma](../setup/plasma/index.rst)). Otherwise, the `j_blues` values 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). Even in the former case, while the estimator does contribute to the updating of the plasma when the ``advance_state`` method is called, it does **not** contribute to the determination of if the simulation has converged, and it does **not** show up in the convergence logging or convergence plots."
]
},
{
Expand All @@ -154,7 +154,7 @@
"source": [
"## Code Example\n",
"\n",
"We now show a detailed example of how the plasma is updated using the estimators after a Monte Carlo iteration. First, we import the needed packages and set up a simulation (see [Setting Up the Simulation](../setup/index.rst)):"
"We now show a detailed example of how the plasma is updated using the estimators after a Monte Carlo iteration. First, we import the necessary packages and set up a simulation (see [Setting Up the Simulation](../setup/index.rst)):"
]
},
{
Expand Down Expand Up @@ -513,7 +513,7 @@
"id": "9619477d",
"metadata": {},
"source": [
"Finally, we show the full updated $T_\\mathrm{rad}$, $W$, $T_\\mathrm{inner}$, as well as the updated electron densities which were updated along with the rest of the plasma based on the new values for $T_\\mathrm{rad}$, $W$, $T_\\mathrm{inner}$. Compare these with our calculations above and with the initial values at the beginning of the code example!"
"Finally, we show the full updated $T_\\mathrm{rad}$, $W$, and $T_\\mathrm{inner}$, as well as the updated electron densities which were updated along with the rest of the plasma based on the new values for $T_\\mathrm{rad}$, $W$, and $T_\\mathrm{inner}$. Compare these with our calculations above and with the initial values at the beginning of the code example!"
]
},
{
Expand Down

0 comments on commit 65ea85b

Please sign in to comment.