{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "4d53d061", "metadata": {}, "source": [ "# Updating Plasma and Convergence\n", "\n", "As light travels through a real plasma, it has effects on the properties of the plasma due to light-matter\n", "interactions as well as the presence of extra energy from the light. Additionally, as [previously discussed](../montecarlo/propagation.rst), properties of the plasma affect how light travels through it. This is a typical equilibrium problem. We solve for the plasma properties by finding a steady-state solution; that is, the actual plasma will be in a state such that the plasma state will not change as\n", "light propagates through it, because the effects of the light on the plasma and the effects of the plasma on the\n", "light are in equilibrium.\n", "\n", "One of TARDIS's main goals is to determine this plasma state (as we need the actual plasma properties in order to\n", "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 necessary plasma state for its last iteration which calculates the spectrum).\n", "\n", "
\n", "\n", "Note\n", "\n", "For all but the last iteration, TARDIS uses the number of Monte Carlo packets specified in the\n", "[Monte Carlo configuration](../../io/configuration/components/montecarlo.rst) under the ``no_of_packets`` argument. This is because\n", "a different number of packets may be necessary to calculate the spectrum as opposed to calculate the\n", "plasma state.\n", "\n", "
\n", "\n", "After each iteration the values for radiative temperature and dilution factor are updated by calling the ``advance_state`` method on a ``Simulation`` object as will be shown below in the code example. The goal of this is to eventually have the radiative temperature and dilution factor converge to a single value so that the steady-state plasma state can be determined. To ensure that the simulation converges, TARDIS employs a convergence strategy. Currently, only one convergence strategy is available: damped convergence. This will be described in the following sections.\n", "\n", "
\n", "\n", "Note\n", " \n", "Unless otherwise noted, all user-supplied quantities mentioned on this page are supplied in the [convergence section of the Monte Carlo configuration](../../io/configuration/components/montecarlo.rst#damped-convergence-strategy), which will be referenced as the convergence configuration.\n", "\n", "
" ] }, { "attachments": {}, "cell_type": "markdown", "id": "8ffc4479", "metadata": {}, "source": [ "## $T_\\mathrm{rad}$ and $W$\n", "\n", "The main way in which the plasma state is updated is by using the ``j`` and ``nu_bar`` estimators (see [here](../montecarlo/estimators.rst#j-and-bar-nu-estimators)) to update two of the key plasma inputs (see [Plasma](../setup/plasma/index.rst)): the radiative temperature $T_\\mathrm{rad}$ and dilution factor $W$. Recall that each of these quantities takes on a different value in each shell.\n", "\n", "Using the estimators $J$ and $\\bar \\nu$, we estimate these quantities using\n", "\n", "$$T_{\\mathrm{rad\\ estimated}} = \\frac{h}{k_{\\mathrm{B}}} \\frac{\\pi^4}{360 \\zeta(5)} \\frac{\\bar \\nu}{J}$$\n", "\n", "and\n", "\n", "$$W_\\mathrm{estimated} = \\frac{\\pi J}{\\sigma_{\\mathrm{R}} T_{\\mathrm{rad\\ estimated}}^4}$$\n", "\n", "where $h$ is Planck's constant, $k_{\\mathrm{B}}$ is Boltzmann's constant, $\\sigma_{\\mathrm{R}}$ is the Stefan–Boltzmann constant, and $\\zeta$ is the Riemann zeta function. The equation for $W$ comes from the fact that the dilution factor is the ratio of the actual mean intensity to that of a blackbody, which is $J_{\\mathrm{blackbody}}=\\frac{\\sigma_{\\mathrm{R}} T^4}{\\pi}$.\n", "\n", "Recall (see [Implementation](../montecarlo/estimators.rst#implementation)), however, that when TARDIS stores these estimators, it leaves out the prefactor of $\\frac{1}{4\\pi V\\Delta t}$ for computational ease. That is, $J=\\frac{1}{4\\pi V\\Delta t}\\sum_i \\varepsilon_i l_i=\\frac{1}{4\\pi V\\Delta t}*\\mathrm{real\\ j\\ estimator}$, and $\\bar \\nu=\\frac{1}{4\\pi V\\Delta t}\\sum_i \\varepsilon_i \\nu_i l_i=\\frac{1}{4\\pi V\\Delta t}*\\mathrm{real\\ nu\\_ bar\\ estimator}$. These factors are then included in our calculations; specifically, using the previous relations we have\n", "\n", "$$T_\\mathrm{rad\\ estimated}= \\frac{h}{k_{\\mathrm{B}}} \\frac{\\pi^4}{360 \\zeta(5)} \\frac{\\sum_i \\varepsilon_i \\nu_i l_i}{\\sum_i \\varepsilon_i l_i} = \\frac{h}{k_{\\mathrm{B}}} \\frac{\\pi^4}{360 \\zeta(5)} \\frac{\\mathrm{real\\ nu\\_ bar\\ estimator}}{\\mathrm{real\\ j\\ estimator}}$$\n", "and\n", "$$W_\\mathrm{estimated} = \\frac{\\sum_i \\varepsilon_i l_i}{4\\sigma_{\\mathrm{R}} T_{\\mathrm{rad\\ estimated}}^4V\\Delta t} = \\frac{\\mathrm{real\\ j\\ estimator}}{4\\sigma_{\\mathrm{R}} T_{\\mathrm{rad\\ estimated}}^4V\\Delta t}.$$\n", "\n", "While TARDIS can then update the plasma state using the estimated values, there is a good chance that these estimated values would “overshoot” the true value we want to converge to (for example, if the current value of the dilution factor in some cell the dilution factor is 0.4, and the true steady-state value TARDIS wants to find is 0.45, there is a good chance that the estimated value will be greater than 0.45). This could make the simulation take longer to converge or, at worst, make it so the simulation does not converge at all. To account for this, users can set (in the convergence configuration) a \"damping constant\" for both the radiative temperature ($d_{T_\\mathrm{rad}}$) and the dilution factor ($d_W$). When ``advance_state`` is called, these quantities update as follows:\n", "\n", "$$T_\\mathrm{rad\\ updated} = T_\\mathrm{rad\\ current} + d_{T_\\mathrm{rad}}(T_\\mathrm{rad\\ estimated}-T_\\mathrm{rad\\ current})$$\n", " \n", "and\n", " \n", "$$ W_\\mathrm{updated} = W_\\mathrm{current} + d_W(W_\\mathrm{estimated}-W_\\mathrm{current}).$$\n", "\n", "This means, for example, if the damping constant is 0.5, the updated value is halfway between the current value and the estimated value. If the damping constant is 0.7, the updated value is 70% of the way between the current value and the estimated value, and so on. **If the damping constant is 1, then the updated value is exactly the estimated value, and if the damping constant is zero, the value stays the same throughout the simulation and is not updated.**\n", "\n", "The updated $T_\\mathrm{rad}$ and $W$ are then used as inputs to the updated [plasma calculations](../setup/plasma/index.rst) which account for the effect of the Monte Carlo packets on the plasma state." ] }, { "attachments": {}, "cell_type": "markdown", "id": "f346fb77", "metadata": {}, "source": [ "## $T_\\mathrm{inner}$\n", "\n", "The temperature of the inner boundary, $T_\\mathrm{inner}$, plays a unique role in the simulation, as it is the primary determiner of the output luminosity. This is because the the luminosity of the inner boundary is proportional to $T_\\mathrm{inner}^4$ (see [Energy Packet Initialization](../montecarlo/initialization.ipynb)). Thus, $T_\\mathrm{inner}$ is updated throughout the simulation in order to match the output luminosity to the requested luminosity specified in the [supernova configuration](../../io/configuration/components/supernova.rst) between the bounds specified in the supernova configuration. However, there is not necessarily a quartic relationship between $T_\\mathrm{inner}$ and the output luminosity, as changing $T_\\mathrm{inner}$ also changes the frequency distribution of the initialized packets (once again see [Energy Packet Initialization](../montecarlo/initialization.ipynb)). This then affects the light-matter interactions, affecting which packets make it to the outer boundary, which also affects the output luminosity. Because of this, there is not an exact way to estimate $T_\\mathrm{inner}$. To do this estimation, we use\n", "\n", "$$T_\\mathrm{inner\\ estimated} = T_\\mathrm{inner\\ current} * \\left(\\frac{L_\\mathrm{output}}{L_\\mathrm{requested}}\\right)^{\\mathrm{t\\_inner\\_update\\_exponent}}$$\n", " \n", "where $L_\\mathrm{output}$ is the output luminosity calculated by adding up the luminosity of each packet (see [Basic Spectrum Generation](../spectrum/basic.ipynb)) between the bounds specified in the [supernova configuration](../../io/configuration/components/supernova.rst), $L_\\mathrm{requested}$ is the luminosity requested also in the supernova configuration (requested between those bounds previously mentioned), and ``t_inner_update_exponent`` is provided by the user in the convergence configuration. Note that what we are doing is \"correcting\" the previous value of the inner temperature by a factor of $\\left(\\frac{L_\\mathrm{output}}{L_\\mathrm{requested}}\\right)^{\\mathrm{t\\_inner\\_update\\_exponent}}$. Note that if $\\frac{L_\\mathrm{output}}{L_\\mathrm{requested}}$ is greater than 1, we want to lower $T_\\mathrm{inner}$ as the output luminosity is too high, and vice versa if the ratio is less than 1. Thus ``t_inner_update_exponent`` should be negative. Naively one might set ``t_inner_update_exponent=-0.25``, however as a default TARDIS uses ``t_inner_update_exponent=-0.5`` as -0.25 may undershoot the correct $T_\\mathrm{inner}$ because of its previously mentioned effects on the initial frequency distribution.\n", "\n", "After calculating the estimated $T_\\mathrm{inner}$, the quantity is updated using damped convergence with its own damping constant (once again set in the convergence configuration):\n", "\n", "$$T_\\mathrm{inner\\ updated} = T_\\mathrm{inner\\ current} + d_{T_\\mathrm{inner}}(T_\\mathrm{inner\\ estimated}-T_\\mathrm{inner\\ current}).$$\n", "\n", "Once again, If the damping constant is 1, then the updated value is exactly the estimated value, and if the damping constant is zero, the value stays the same throughout the simulation and is not updated.\n", "\n", "Additionally, because of the vast impact of $T_\\mathrm{inner}$ on the simulation, one may want to update it less frequently -- i.e. allow $W$ and $T_\\mathrm{rad}$ to reach a steady-state value for a particular $T_\\mathrm{inner}$ before updating $T_\\mathrm{inner}$. To do this, in the convergence configuration we set ``lock_t_inner_cycles``, which is the number of iterations to wait before updating $T_\\mathrm{inner}$. It is set to 1 by default, meaning $T_\\mathrm{inner}$ would be updated every iteration." ] }, { "attachments": {}, "cell_type": "markdown", "id": "9a3bee0e", "metadata": {}, "source": [ "## Convergence Information\n", "\n", "During the simulation, information about the how $T_\\mathrm{rad}$, $W$, and $T_\\mathrm{inner}$ are updated as well as a comparison of the total output luminosity and the requested luminosity are logged at the INFO level (see [Configuring the Logging Output for TARDIS](../../io/optional/tutorial_logging_configuration.ipynb)) as shown in the code below, to give users a better idea of how the convergence process is working.\n", "\n", "In addition, TARDIS allows for the displaying of convergence plots, which allows users to visualize the convergence process for $T_\\mathrm{rad}$, $W$, $T_\\mathrm{inner}$, and the total luminosity of the supernova being modeled. For more information, see [Convergence Plots](../../io/visualization/tutorial_convergence_plot.ipynb)." ] }, { "attachments": {}, "cell_type": "markdown", "id": "3bc752ec", "metadata": {}, "source": [ "## Convergence Criteria\n", "\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=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", "
\n", "\n", "Note\n", " \n", "To determine convergence, we compare the estimated value, **not** the updated value (which is related to the estimated value via the damping constant), with the previous value. If $T_\\mathrm{inner}$ is locked (see the previous section), the estimated value will still be calculated so convergence can be checked as usual.\n", "\n", "
\n", "\n", "
\n", "\n", "Note\n", " \n", "``hold_iterations`` and ``fraction`` are universal quantities, i.e. they are each a single value that applies to $T_\\mathrm{rad}$ and $W$, and for ``hold_iterations`` also $T_\\mathrm{inner}$. ``threshold``, on the other hand, is supplied for each quantity separately, so for instance you could require $T_\\mathrm{rad}$ to differ by less than 1%, $W$ to differ by less than 3%, and $T_\\mathrm{inner}$ to differ by less than 5% for convergence to be reached.\n", "\n", "
\n", "\n", "\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-b-lu-estimator) (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." ] }, { "attachments": {}, "cell_type": "markdown", "id": "127746c2", "metadata": {}, "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 necessary packages and set up a simulation (see [Setting Up the Simulation](../setup/index.rst)):" ] }, { "cell_type": "code", "execution_count": null, "id": "7a8bd905", "metadata": {}, "outputs": [], "source": [ "from tardis.io.configuration.config_reader import Configuration\n", "from tardis.simulation import Simulation\n", "from tardis.io.atom_data.util import download_atom_data\n", "import numpy as np\n", "from scipy.special import zeta\n", "\n", "from astropy import units as u, constants as const\n", "\n", "# We download the atomic data needed to run this notebook\n", "download_atom_data('kurucz_cd23_chianti_H_He')" ] }, { "cell_type": "code", "execution_count": null, "id": "259a7aa9", "metadata": {}, "outputs": [], "source": [ "tardis_config = Configuration.from_yaml('tardis_example.yml')\n", "\n", "# We manually put in the damping constants and t_inner_update_exponent for\n", "# illustrative purposes:\n", "damping_t_radiative = 0.5\n", "damping_dilution_factor = 0.3\n", "damping_t_inner = 0.7\n", "t_inner_update_exponent = -0.5\n", "\n", "# We set the above values into the configuration:\n", "tardis_config.montecarlo.convergence_strategy.t_rad.damping_constant = damping_t_radiative\n", "tardis_config.montecarlo.convergence_strategy.w.damping_constant = damping_dilution_factor\n", "tardis_config.montecarlo.convergence_strategy.t_inner.damping_constant = damping_t_inner\n", "tardis_config.montecarlo.convergence_strategy.t_inner_update_exponent = t_inner_update_exponent" ] }, { "cell_type": "code", "execution_count": null, "id": "bb37402c", "metadata": {}, "outputs": [], "source": [ "sim = Simulation.from_config(tardis_config)\n", "\n", "simulation_state = sim.simulation_state\n", "plasma = sim.plasma\n", "transport = sim.transport" ] }, { "attachments": {}, "cell_type": "markdown", "id": "cf13d946", "metadata": {}, "source": [ "We show the initial radiative temperature and dilution factor in each shell, the initial inner boundary temperature, and the initial electron densities in each shell:" ] }, { "cell_type": "code", "execution_count": null, "id": "e3f43f93", "metadata": {}, "outputs": [], "source": [ "simulation_state.t_radiative" ] }, { "cell_type": "code", "execution_count": null, "id": "90bb6147", "metadata": {}, "outputs": [], "source": [ "simulation_state.dilution_factor" ] }, { "cell_type": "code", "execution_count": null, "id": "66209ff7", "metadata": {}, "outputs": [], "source": [ "simulation_state.t_inner" ] }, { "cell_type": "code", "execution_count": null, "id": "7b2ae7b4", "metadata": {}, "outputs": [], "source": [ "plasma.electron_densities" ] }, { "attachments": {}, "cell_type": "markdown", "id": "a248ff2c", "metadata": {}, "source": [ "We set the number of packets and we run one iteration of the Monte Carlo simulation:" ] }, { "cell_type": "code", "execution_count": null, "id": "9f7eb44f", "metadata": { "scrolled": true }, "outputs": [], "source": [ "N_packets = 10000\n", "\n", "# Using the commented out code below, we can also get the number of packets\n", "# from the configuration -- try it out:\n", "#N_packets = tardis_config.montecarlo.no_of_packets\n", "\n", "sim.iterate(N_packets)" ] }, { "attachments": {}, "cell_type": "markdown", "id": "d3d0074d", "metadata": {}, "source": [ "We now show the values of the $J$ and $\\bar \\nu$ estimators, attaching their proper units (note that these are the raw estimators, and the factors of $\\frac{1}{4\\pi V \\Delta t}$ etc are not included):" ] }, { "cell_type": "code", "execution_count": null, "id": "21500ea8", "metadata": { "scrolled": false }, "outputs": [], "source": [ "j_estimator = transport.transport_state.j_estimator * (u.erg * u.cm) \n", "j_estimator" ] }, { "cell_type": "code", "execution_count": null, "id": "fac91ee2", "metadata": { "scrolled": true }, "outputs": [], "source": [ "nu_bar_estimator = transport.transport_state.nu_bar_estimator * (u.erg * u.cm * u.Hz)\n", "nu_bar_estimator" ] }, { "attachments": {}, "cell_type": "markdown", "id": "69c178d2", "metadata": {}, "source": [ "We show the values of $J$ and $\\bar \\nu$ including the prefactor:" ] }, { "cell_type": "code", "execution_count": null, "id": "9500e34b", "metadata": {}, "outputs": [], "source": [ "V = simulation_state.volume\n", "Delta_t = transport.transport_state.time_of_simulation\n", "prefactor = 1 / (4 * np.pi * V * Delta_t)\n", "J = prefactor * j_estimator\n", "J" ] }, { "cell_type": "code", "execution_count": null, "id": "a5720987", "metadata": {}, "outputs": [], "source": [ "nu_bar = prefactor * nu_bar_estimator\n", "nu_bar" ] }, { "attachments": {}, "cell_type": "markdown", "id": "28d69ca6", "metadata": {}, "source": [ "As mentioned [here](../montecarlo/estimators.rst#j-and-bar-nu-estimators), $\\bar \\nu$ is not truly the mean frequency (as you can see by units). We show the true mean frequency, which will, as expected, be in units of Hz." ] }, { "cell_type": "code", "execution_count": null, "id": "691cf2f6", "metadata": {}, "outputs": [], "source": [ "nu_bar/J" ] }, { "attachments": {}, "cell_type": "markdown", "id": "bcbf40d4", "metadata": {}, "source": [ "We show the calculations of the estimated and updated $T_\\mathrm{rad}$ and $W$. Note that the ``decompose()`` method is used to simplify the units:" ] }, { "cell_type": "code", "execution_count": null, "id": "50c639ea", "metadata": {}, "outputs": [], "source": [ "t_rad_estimated = ( (const.h.cgs / const.k_B.cgs) \n", " * (np.pi**4 / (360 * zeta(5, 1)))\n", " * (nu_bar_estimator / j_estimator) ).decompose()\n", "t_rad_estimated" ] }, { "cell_type": "code", "execution_count": null, "id": "b34674df", "metadata": {}, "outputs": [], "source": [ "t_rad_updated = simulation_state.t_radiative + damping_t_radiative * (t_rad_estimated - simulation_state.t_radiative)\n", "t_rad_updated" ] }, { "cell_type": "code", "execution_count": null, "id": "b48d8ada", "metadata": {}, "outputs": [], "source": [ "dilution_factor_estimated = ( j_estimator / (4 * const.sigma_sb.cgs * t_rad_estimated**4 * V * Delta_t) ).decompose()\n", "dilution_factor_estimated" ] }, { "cell_type": "code", "execution_count": null, "id": "22895e09", "metadata": {}, "outputs": [], "source": [ "dilution_factor_updated = simulation_state.dilution_factor + damping_dilution_factor * (dilution_factor_estimated - simulation_state.dilution_factor)\n", "dilution_factor_updated" ] }, { "attachments": {}, "cell_type": "markdown", "id": "7bfefce9", "metadata": {}, "source": [ "We show the output and requested luminosities, and use these to calculate the estimated and updated $T_\\mathrm{inner}$:" ] }, { "cell_type": "code", "execution_count": null, "id": "795dceb2", "metadata": {}, "outputs": [], "source": [ "# The output luminosity is calculated between the bounds specified below\n", "nu_lower = 0\n", "nu_upper = np.inf\n", "\n", "# Using the commented out code below, we can also get the frequency bounds\n", "# from the configuration -- try it out (note we convert between wavelength\n", "# and frequency, and thus the order switches):\n", "#nu_lower = tardis_config.supernova.luminosity_wavelength_end.to(u.Hz, u.spectral)\n", "#nu_upper = tardis_config.supernova.luminosity_wavelength_start.to(u.Hz, u.spectral)\n", "\n", "L_output = transport.transport_state.calculate_emitted_luminosity(0,np.inf)\n", "L_output" ] }, { "cell_type": "code", "execution_count": null, "id": "b7028da2", "metadata": {}, "outputs": [], "source": [ "L_requested = sim.luminosity_requested\n", "L_requested" ] }, { "cell_type": "code", "execution_count": null, "id": "4a14111a", "metadata": {}, "outputs": [], "source": [ "t_inner_estimated = simulation_state.t_inner * (L_output / L_requested)**t_inner_update_exponent\n", "t_inner_estimated" ] }, { "cell_type": "code", "execution_count": null, "id": "8bd1062f", "metadata": {}, "outputs": [], "source": [ "t_inner_updated = simulation_state.t_inner + damping_t_inner * (t_inner_estimated - simulation_state.t_inner)\n", "t_inner_updated" ] }, { "attachments": {}, "cell_type": "markdown", "id": "43b31d2f", "metadata": {}, "source": [ "We now advance the state of the simulation based on the estimators. This will also display a summary of the updated values of $T_\\mathrm{rad}$ and $W$. Additionally, the ``advance_state()`` method checks for convergence and returns the convergence status as shown below." ] }, { "cell_type": "code", "execution_count": null, "id": "9676b22b", "metadata": { "scrolled": true }, "outputs": [], "source": [ "sim.advance_state()" ] }, { "attachments": {}, "cell_type": "markdown", "id": "9619477d", "metadata": {}, "source": [ "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!" ] }, { "cell_type": "code", "execution_count": null, "id": "fe0b9f40", "metadata": {}, "outputs": [], "source": [ "simulation_state.t_radiative" ] }, { "cell_type": "code", "execution_count": null, "id": "8de89bb2", "metadata": { "scrolled": true }, "outputs": [], "source": [ "simulation_state.dilution_factor" ] }, { "cell_type": "code", "execution_count": null, "id": "4f78c4fe", "metadata": {}, "outputs": [], "source": [ "simulation_state.t_inner" ] }, { "cell_type": "code", "execution_count": null, "id": "fcaf08ff", "metadata": {}, "outputs": [], "source": [ "plasma.electron_densities" ] }, { "cell_type": "code", "execution_count": null, "id": "bd488259", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" }, "vscode": { "interpreter": { "hash": "c20eb03b6e6c860a5223c79131a5cfd0b7e61a9aa5d08c2b1400663bc6cc4e6d" } } }, "nbformat": 4, "nbformat_minor": 5 }