vice.migration.specs

Multizone simulation migration prescriptions for gas and stars.

Signature: vice.migration.specs(n)

New in version 1.2.0.

Parameters

nint

The number of rows and columns in the gas migration matrix. This is also the number of zones in a multizone model.

Attributes

gasmig_matrix

A matrix containing the mass fraction of gas moving between zones.

stars<function>

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, <function g at 0x120588560>, 0.0}
                1 ---------> {0.1, 0.0, 0.0}
                2 ---------> {0.0, 0.0, 0.0}
        }