vice.migration.migration_matrix =============================== A square matrix designed to detail the manner in which gas migrates between zones in multizone models. This is a 2-dimensional array-like object denoted by :math:`G_{ij}`, defined as the mass fraction of the interstellar gas in zone :math:`i` that migrates to zone :math:`j` in a 10 Myr time interval. **Signature**: vice.migration.migration_matrix(size) .. versionadded:: 1.2.0 Parameters ---------- size : ``int`` The number of rows and columns. This is also the number of zones in the multizone model. Attributes ---------- size : ``int`` See parameter "size". Allowed Data Types ------------------ * real number :math:`G_{ij}` does not vary with time, and is given by this value. * :math:`G_{ij}` varies with time, and is described by this function. Time in Gyr is the only parameter the function takes. Indexing -------- - ``int``, ``int`` : the row and column numbers The value of :math:`G_{ij}` can be accessed by indexing this object with :math:`i` as the first index and :math:`j` as the second. For instance, ``example[1][0]`` and ``example[1, 0]`` both look up :math:`G_{1,0}`. Functions --------- - tolist - tonumpyarray Example Code ------------ >>> import math >>> import vice >>> example = vice.migration.migration_matrix(3) >>> example MigrationMatrix{ 0 ---------> {0.0, 0.0, 0.0} 1 ---------> {0.0, 0.0, 0.0} 2 ---------> {0.0, 0.0, 0.0} } >>> example[1][0] = 0.1 >>> def f(t): return 0.1 * math.exp(-t / 5) >>> example[0, 1] = f >>> example MigrationMatrix{ 0 ---------> {0.0, , 0.0} 1 ---------> {0.1, 0.0, 0.0} 2 ---------> {0.0, 0.0, 0.0} } >>> example.tonumpyarray() array([[0.0, , 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]) .. toctree:: :titlesonly: :maxdepth: 5 vice.migration.migration_matrix.size vice.migration.migration_matrix.tolist vice.migration.migration_matrix.tonumpyarray