vice.singlezone =============== An object designed to run simulations of chemical enrichment under the single-zone approximation for user-specified parameters. The parameters of the simulation are implemented as attributes of this class. **Signature**: vice.singlezone(\*\*kwargs) Parameters ---------- kwargs : varying types Every attribute of this class can be assigned via a keyword argument. Attributes ---------- name : ``str`` [default : "onezonemodel"] The name of the simulation. Output will be stored in a directory under this name. func : ```` [default : vice._globals._DEFAULT_FUNC_] A function of time describing some evolutionary parameter. Physical interpretation set by the attribute ``mode``. mode : ``str`` [default : "ifr"] The interpretation of the attribute ``func``. Either "ifr" for infall rate, "sfr" for star formation rate, or "gas" for the mass of gas. verbose : ``bool`` [default : False] Whether or not to print to the console as the simulation runs. .. versionadded:: 1.1.0 elements : ``tuple`` [default : ("fe", "sr", "o")] A tuple of strings holding the symbols of the elements to be simulated. IMF : ``str`` [case-insensitive] or ```` [default : "kroupa"] The stellar initial mass function (IMF) to adopt. Either a string denoting a built-in IMF or a function containing a user-constructed IMF. Recognized built-in IMFs: - "kroupa" [1]_ - "salpeter" [2]_ .. versionadded:: 1.2.0 Prior to version 1.2.0, only the built-in Kroupa and Salpeter IMFs were supported. eta : real number [default : 2.5] The mass-loading parameter: the ratio of outflow to star formation rates. This changes when the attribute ``smoothing`` is nonzero. enhancement : real number or ```` [default : 1] The ratio of outflow to ISM metallicities. Numbers are interpreted as constants. Functions must accept time in Gyr as a parameter. Zin : real number, ````, or ``dataframe`` [default : 0] The infall metallicity, which can be a constant, time-vary, or have element-by-element specifications. recycling : ``str`` [case-insensitive] or real number [default : "continuous"] Either the string "continuous" or a real number between 0 and 1. Denotes the prescription for recycling of previously produced heavy nuclei. bins : array-like [default : [-3.0, -2.95, -2.9, ... , 0.9, 0.95, 1.0]] The binspace within which to sort the normalized stellar metallicity distribution function in each [X/H] and [X/Y] abundance ratio measurement. delay : real number [default : 0.15] The minimum delay time in Gyr before the onset of type Ia supernovae associated with a single stellar population RIa : ``str`` [case-insensitive] or ```` [default : "plaw"] The SN Ia delay-time distribution (DTD) to adopt. Strings denote built-in DTDs and functions must accept time in Gyr as a parameter. Mg0 : real number [default : 6.0e+09] The initial gas supply of the galaxy in solar masses. This is only relevant when the simulation is ran in infall mode (i.e. mode == "ifr"). smoothing : real number [default : 0] The outflow smoothing timescale in Gyr. [3]_ tau_ia : real number [default : 1.5] The e-folding timescale of type Ia supernovae in gyr when the attribute ``RIa`` == "exp". tau_star : real number or ```` [default : 2.0] The star formation rate per unit gas mass in the galaxy in Gyr. This can be either a number which will be treated as a constant, or a function of time in Gyr, whose behavior can be modified when the attribute ``schmidt == True``. Can also be a function which accepts a second parameter in addition to time in Gyr; when ``mode == "ifr"`` or ``"gas"``, this will be interpreted as the gas mass in :math:`M_\odot`, and when ``mode == "sfr"``, it will be interpreted as the star formation rate in :math:`M_\odot/yr`. .. versionadded:: 1.2.0 Prior to version 1.2.0, functions could only accept time in Gyr as the new parameter. dt : real number [default : 0.01] The timestep size in Gyr. schmidt : ``bool`` [default : False] A boolean describing whether or not to implement a gas-dependent star formation efficiency. Overridden when the attribute ``tau_star`` is a function of two variables. schmidt_index : real number [default : 0.5] The power-law index of gas-dependent star formation efficiency. Overridden when the attribute ``tau_star`` is a function of two variables. MgSchmidt : real umber [default : 6.0e+09] The normalization of the gas-supply when the attribute ``schmidt = True``. Overridden when the attribute ``tau_star`` is a function of two variables. m_upper : real number [default : 100] The upper mass limit on star formation in :math:`M_\odot`. m_lower : real number [default : 0.08] The lower mass limit on star formation in :math:`M_\odot`. postMS : real number [default : 0.1] The lifetime ratio of the post main sequence to main sequence phases of stellar evolution. .. versionadded:: 1.1.0 Z_solar : real number [default : 0.014] The adopted metallicity by mass of the sun. agb_model : ``str`` [case-insensitive] [default : None] **[DEPRECATED]** A keyword denoting which table of nucleosynthetic yields from AGB stars to adopt. Recognized Keywords: - "cristallo11" [4]_ - "karakas10" [5]_ .. deprecated:: 1.2.0 Users should instead modify their AGB star yield settings through ``vice.yields.agb.settings``. Users may specify either a built-in study or a function of stellar mass and metallicity. Functions --------- run : [instancemethod] Run the simulation. from_output : [classmethod] Obtain a ``singlezone`` object with the parameters of the one that produced an output. .. role:: raw-html(raw) :format: html Notes ----- **Implementation** :raw-html:`
` VICE uses a forward Euler approach to handle its timestepping. Although this isn't the highest numerical resolution timestepping method, the dominant source of error in VICE is not in the numerics but in the approximations built into the model itself. Solutions in which the numerical error is adequately small can be achieved with reasonable timestep sizes. Furthermore, the forward Euler approach allows VICE to treat the discretization of timesteps to correspond directly to a discretization of stellar populations, simplifying its implementation and allowing fast numerical solutions. The exact timestamps at which functions of time describing evolutionary parameters will be evaluated is also a simple calculation as a result, since they will all be integer multiples of the timestep size. For further details, see VICE's science documentation: https://vice-astro.readthedocs.io/en/latest/science_documentation/index.html **Computational Overhead** :raw-html:`
` In general, the ``singlezone`` object is not memory limited, requiring only ~700 MB of RAM and ~20 seconds to compute abundances for 3 elements across 10,000 timesteps with default parameters. With 1,000 timesteps, it takes only 500 MB of RAM and finishes in ~1/4 second. For quantified measurements of the ``singlezone`` object's required integration time, see "Timed Runs" under VICE's science documentation: https://vice-astro.readthedocs.io/en/latest/science_documentation/implementation.html#timed-runs **Relationship to ``vice.multizone``** :raw-html:`
` The ``multizone`` object makes use of composition. At its core, it is an array of ``singlezone`` objects. Example Code ------------ >>> import vice >>> sz = vice.singlezone() >>> sz vice.singlezone{ name -----------> onezonemodel func -----------> mode -----------> ifr verbose --------> False elements -------> ('fe', 'sr', 'o') IMF ------------> kroupa eta ------------> 2.5 enhancement ----> 1.0 entrainment ----> Zin ------------> 0.0 recycling ------> continuous delay ----------> 0.15 RIa ------------> plaw Mg0 ------------> 6000000000.0 smoothing ------> 0.0 tau_ia ---------> 1.5 tau_star -------> 2.0 schmidt --------> False schmidt_index --> 0.5 MgSchmidt ------> 6000000000.0 dt -------------> 0.01 m_upper --------> 100.0 m_lower --------> 0.08 postMS ---------> 0.1 Z_solar --------> 0.014 bins -----------> [-3, -2.95, -2.9, ... , 0.9, 0.95, 1] } .. [1] Kroupa (2001), MNRAS, 231, 322 .. [2] Salpeter (1955), ApJ, 121, 161 .. [3] Johnson & Weinberg (2020), MNRAS, 498, 1364 .. [4] Cristallo et al. (2011), ApJS, 197, 17 .. [5] Karakas (2010), MNRAS, 403, 1413 .. toctree:: :titlesonly: :maxdepth: 5 vice.singlezone.run vice.singlezone.from_output vice.singlezone.name vice.singlezone.func vice.singlezone.mode vice.singlezone.verbose vice.singlezone.elements vice.singlezone.IMF vice.singlezone.eta vice.singlezone.enhancement vice.singlezone.entrainment vice.singlezone.Zin vice.singlezone.recycling vice.singlezone.bins vice.singlezone.delay vice.singlezone.RIa vice.singlezone.Mg0 vice.singlezone.smoothing vice.singlezone.tau_ia vice.singlezone.tau_star vice.singlezone.dt vice.singlezone.schmidt vice.singlezone.schmidt_index vice.singlezon.MgSchmidt vice.singlezone.m_upper vice.singlezone.m_lower vice.singlezone.postMS vice.singlezone.Z_solar vice.singlezone.agb_model