vice.migration.specs ==================== Multizone simulation migration prescriptions for gas and stars. **Signature**: vice.migration.specs(n) .. versionadded:: 1.2.0 Parameters ---------- n : ``int`` The number of rows and columns in the gas migration matrix. This is also the number of zones in a multizone model. Attributes ---------- gas : ``mig_matrix`` A matrix containing the mass fraction of gas moving between zones. stars : A function of the zone number and time of star formation. Expected to return a function of time in Gyr describing the zone number at all subsequent times of stars forming in that zone at that time. Example Code ------------ >>> import math >>> import vice >>> example = vice.migration.specs(3) >>> def f(zone, tform, time): # swap stars between zones 0 and 1 when they're >1 Gyr old. if zone == 0: if time - tform > 1: return 1 else: return 0 elif zone == 1: if time - tform > 1: return 0 else: return 1 else: return zone >>> example.stars = f >>> example.gas[1][0] = 0.1 >>> def g(t): return 0.2 * math.exp(-t / 2) >>> example.gas[0][1] = g >>> example.gas MigrationMatrix{ 0 ---------> {0.0, , 0.0} 1 ---------> {0.1, 0.0, 0.0} 2 ---------> {0.0, 0.0, 0.0} } .. toctree:: :titlesonly: :maxdepth: 5 vice.migration.specs.gas vice.migration.specs.stars