vice.migration.specs.gas ======================== Type : ``migration_matrix`` Default: Zeroes (i.e. no gas migration) The gas migration matrix. For a multizone simulation with N zones, this is an NxN matrix. This matrix is defined such that :math:`G_{ij}` represents the mass fraction of gas that moves from the :math:`i`'th zone to the :math:`j`'th zone in a 10 Myr time interval. Allowed Types ------------- * real number The fraction of gas that migrates in a 10 Myr time interval is constant, given by this value. * Must accept time in Gyr as the only parameter. The fraction of gas that migrates in a 10 Myr time interval varies with time, and is described by this function. Notes ----- The mass fraction of interstellar gas that migration from zone :math:`i` to zone :math:`j` at a time :math:`t` is calculated via .. math:: f_{ij}(t) = G_{ij}(t) \frac{\Delta t}{\text{10 Myr}} The mass that migrates is then given by :math:`M_{g,i} f_{ij}(t)`, where :math:`M_{g,i}` is the total mass of the interstellar medium in zone :math:`i`. This guarantees that the amount of gas that migrates in a given time interval does not depend on the timestep size. Example Code ------------ >>> import math >>> import vice >>> example = vice.migration.specs(3) >>> example.gas[1][0] = 0.1 >>> def f(t): return math.exp(-t / 2) >>> example.gas[0][1] = f >>> example.gas MigrationMatrix{ 0 ---------> {0.0, , 0.0} 1 ---------> {0.1, 0.0, 0.0} 2 ---------> {0.0, 0.0, 0.0} }