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

kwargsvarying types

Every attribute of this class can be assigned via a keyword argument.

Attributes

namestr [default“onezonemodel”]

The name of the simulation. Output will be stored in a directory under this name.

func<function> [defaultvice._globals._DEFAULT_FUNC_]

A function of time describing some evolutionary parameter. Physical interpretation set by the attribute mode.

modestr [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.

verbosebool [defaultFalse]

Whether or not to print to the console as the simulation runs.

New in version 1.1.0.

elementstuple [default(“fe”, “sr”, “o”)]

A tuple of strings holding the symbols of the elements to be simulated.

IMFstr [case-insensitive] or <function> [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]

New in version 1.2.0: Prior to version 1.2.0, only the built-in Kroupa and Salpeter IMFs were supported.

etareal number [default2.5]

The mass-loading parameter: the ratio of outflow to star formation rates. This changes when the attribute smoothing is nonzero.

enhancementreal number or <function> [default1]

The ratio of outflow to ISM metallicities. Numbers are interpreted as constants. Functions must accept time in Gyr as a parameter.

Zinreal number, <function>, or dataframe [default0]

The infall metallicity, which can be a constant, time-vary, or have element-by-element specifications.

recyclingstr [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.

binsarray-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.

delayreal number [default0.15]

The minimum delay time in Gyr before the onset of type Ia supernovae associated with a single stellar population

RIastr [case-insensitive] or <function> [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.

Mg0real number [default6.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”).

smoothingreal number [default0]

The outflow smoothing timescale in Gyr. [3]

tau_iareal number [default1.5]

The e-folding timescale of type Ia supernovae in gyr when the attribute RIa == “exp”.

tau_starreal number or <function> [default2.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 \(M_\odot\), and when mode == "sfr", it will be interpreted as the star formation rate in \(M_\odot/yr\).

New in version 1.2.0: Prior to version 1.2.0, functions could only accept time in Gyr as the new parameter.

dtreal number [default0.01]

The timestep size in Gyr.

schmidtbool [defaultFalse]

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_indexreal number [default0.5]

The power-law index of gas-dependent star formation efficiency. Overridden when the attribute tau_star is a function of two variables.

MgSchmidtreal umber [default6.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_upperreal number [default100]

The upper mass limit on star formation in \(M_\odot\).

m_lowerreal number [default0.08]

The lower mass limit on star formation in \(M_\odot\).

postMSreal number [default0.1]

The lifetime ratio of the post main sequence to main sequence phases of stellar evolution.

New in version 1.1.0.

Z_solarreal number [default0.014]

The adopted metallicity by mass of the sun.

agb_modelstr [case-insensitive] [defaultNone]

[DEPRECATED]

A keyword denoting which table of nucleosynthetic yields from AGB stars to adopt.

Recognized Keywords:

  • “cristallo11” [4]

  • “karakas10” [5]

Deprecated since version 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.

Notes

Implementation
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
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``
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 -----------> <function _DEFAULT_FUNC_ at 0x112180ae8>
                mode -----------> ifr
                verbose --------> False
                elements -------> ('fe', 'sr', 'o')
                IMF ------------> kroupa
                eta ------------> 2.5
                enhancement ----> 1.0
                entrainment ----> <entrainment settings>
                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]
        }