Previous topic

hyperion.model.Model

Next topic

hyperion.model.ModelOutput

This Page

hyperion.model.AnalyticalYSOModel

AnalyticalYSOModel inherits from Model, so all methods and attributes present in the latter can be used with the former, but they are not listed here.

class hyperion.model.AnalyticalYSOModel(name=None)

Adding density structures

add_flared_disk() Add a flared disk to the model
add_alpha_disk() Add an alpha disk to the geometry
add_power_law_envelope() Add a spherically symmetric power-law envelope to the model
add_ulrich_envelope() Add an infalling rotationally flatted envelope to the model
add_ambient_medium() Add an infalling rotationally flatted envelope to the model

Setting the grid automatically

set_spherical_polar_grid_auto(n_r, n_theta, ...) Set the grid to be spherical polar with automated resolution.
set_cylindrical_polar_grid_auto(n_w, n_z, n_phi) Set the grid to be cylindrical polar with automated resolution.

Miscellaneous

evaluate_optically_thin_radii() Replace instances of OptThinRadius by the numerical value.
setup_magnetospheric_accretion(mdot, rtrunc, ...) Set up the model for magnetospheric accretion

Methods (detail)

add_flared_disk()

Add a flared disk to the model

Returns :

disk : FlaredDisk

A FlaredDisk instance.

Examples

To add a flared disk to the model, you can do:

>>> disk = m.add_flared_disk()

then set the disk properties using e.g.:

>>> disk.mass = 1.e30  # g
>>> disk.rmin = 1e10  # cm
>>> disk.rmax = 1e14  # cm

See the FlaredDisk documentation to see which parameters can be set.

add_alpha_disk()

Add an alpha disk to the geometry

This is similar to a flared disk, but with accretion luminosity. See AlphaDisk for more details.

Returns :

disk : AlphaDisk

A AlphaDisk instance.

Examples

To add an alpha disk to the model, you can do:

>>> disk = m.add_alpha_disk()

then set the disk properties using e.g.:

>>> disk.mass = 1.e30  # g
>>> disk.rmin = 1e10  # cm
>>> disk.rmax = 1e14  # cm

See the AlphaDisk documentation to see which parameters can be set.

add_power_law_envelope()

Add a spherically symmetric power-law envelope to the model

Returns :

env : PowerLawEnvelope

A PowerLawEnvelope instance.

Examples

To add a power-law envelope to the model, you can do:

>>> env = m.add_power_law_envelope()

then set the envelope properties using e.g.:

>>> from hyperion.util.constants import msun, au
>>> env.mass = 0.1 * msun  # g/s
>>> env.rmin = 0.1 * au  # cm
>>> env.rmax = 10000. * au  # cm

See the PowerLawEnvelope documentation to see which parameters can be set.

add_ulrich_envelope()

Add an infalling rotationally flatted envelope to the model

Returns :

env : UlrichEnvelope

An UlrichEnvelope instance.

Examples

To add an infalling envelope to the model, you can do:

>>> env = m.add_ulrich_envelope()

then set the envelope properties using e.g.:

>>> from hyperion.util.constants import msun, yr, au
>>> env.mdot = 1.e-6 * msun / yr  # g/s
>>> env.rmin = 0.1 * au  # cm
>>> env.rmax = 10000. * au  # cm

See the UlrichEnvelope documentation to see which parameters can be set.

add_ambient_medium()

Add an infalling rotationally flatted envelope to the model

Returns :

ambient : AmbientMedium

An AmbientMedium instance.

Notes

Unlike other density structures, the ambient medium is not added to the whole density structure, but it is instead used as a minimum threshold. That is, anywhere within ambient.rmin and ambient.rmax, the density is reset to ambient.rho if it was initially lower.

Examples

To add an ambient medium to the model, you can do:

>>> ambient = m.add_ambient_medium()

then set the ambient medium properties using e.g.:

>>> from hyperion.util.constants import au, pc
>>> ambient.rho = 1.e-20  # cgs
>>> ambient.rmin = 0.1 * au  # cm
>>> ambient.rmax = pc  # cm

See the AmbientMedium documentation to see which parameters can be set.

set_spherical_polar_grid_auto(n_r, n_theta, n_phi, rmax=None)

Set the grid to be spherical polar with automated resolution.

Parameters :

n_r, n_theta, n_phi : int

Number of cells to use in the radial, theta, and azimuthal directions.

rmax : float, optional

The maximum radius to extend out to. If not specified, this is set to the maximum spherical radius of the dust geometry in the mid-plane. Note that if you are including a disk with a cylindrical outer edge, this should be set to a value larger than the disk radius, otherwise the disk will be truncated with a spherical edge.

set_cylindrical_polar_grid_auto(n_w, n_z, n_phi, wmax=None, zmax=None)

Set the grid to be cylindrical polar with automated resolution.

Parameters :

n_w, n_z, n_phi : int

Number of cells to use in the radial, vertical, and azimuthal directions.

wmax : float, optional

The maximum radius to extend out to. If not specified, this is set to the maximum cylindrical radius of the dust geometry in the mid-plane.

zmax : float, optional

The maximum height above and below the midplane to extend to. If not specified, this is set to the maximum cylindrical radius of the dust geometry.

evaluate_optically_thin_radii()

Replace instances of OptThinRadius by the numerical value.

This method will freeze any radius specified by OptThinRadius to the value assuming the present dust and stellar properties, and will also freeze the attributes (including dust properties) for the component classes and for the central source.

setup_magnetospheric_accretion(mdot, rtrunc, fspot, xwav_min=0.001, xwav_max=0.01)

Set up the model for magnetospheric accretion

Parameters :

mdot : float

The accretion rate onto the star in cgs

rtrunc : float

The magnetospheric truncation radius of the disk in cgs

fspot : float

The spot coverage fraction. Photons will be emitted uniformly from the star, the coverage fraction fspot will determine the spectrum of the hot spot emission (smaller covering fractions will lead to a hotter spectrum).

Notes

This method only takes into account the hot spot and X-ray emission from the stellar surface. To simulate the viscous accretion luminosity in the disk, add an AlphaDisk to the model using add_alpha_disk() and set the accretion rate or luminosity accordingly.

This method should be called once the stellar parameters have been otherwise initialized, and the disk parameters have to be set. This method cannot be called once the grid has been set, since this routine potentially changes the luminosity of the central source, potentially changing the dust sublimation radius.

Calling this method causes the stellar parameters to be finalized, i.e. once this method has been called, none of the attributes of Model.star can be further modified.