PHOEBE 2.1 Documentation

2.1 Docs



IPython Notebook | Python Script

Minimal Contact Binary System

Setup

As always, let’s do imports and initialize a logger and a new bundle. See Building a System for more details.

%matplotlib inline
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt

logger = phoebe.logger()

Here we’ll initialize a default binary, but ask for it to be created as a contact system.

b_cb = phoebe.default_binary(contact_binary=True)

We’ll compare this to the default detached binary

b_detached = phoebe.default_binary()

Hierarchy

Let’s first look at the hierarchy of the default detached binary, and then compare that to the hierarchy of the overcontact system

print b_detached.hierarchy
orbit:binary

    star:primary
    star:secondary
print b_cb.hierarchy
orbit:binary

    star:primary
    star:secondary
    envelope:contact_envelope

As you can see, the overcontact system has an additional “component” with method “envelope” and component label “contact_envelope”.

Next let’s look at the parameters in the envelope and star components. You can see that most of parameters in the envelope class are constrained, while the equivalent radius of the primary is unconstrained. The value of primary equivalent radius constrains the potential and fillout factor of the envelope, as well as the equivalent radius of the secondary.

print b_cb.filter(component='contact_envelope', kind='envelope', context='component')
ParameterSet: 5 parameters
  abun@contact_envelope@compo...: 0.0
* fillout_factor@contact_enve...: 0.641789708077
* pot@contact_envelope@component: 3.40137740723
* pot_min@contact_envelope@co...: 3.20679622409
* pot_max@contact_envelope@co...: 3.75
print b_cb.filter(component='primary', kind='star', context='component')
ParameterSet: 18 parameters
        requiv@primary@component: 1.5 solRad
*   requiv_max@primary@component: 1.67245639728 solRad
*   requiv_min@primary@component: 1.27254185687 solRad
          teff@primary@component: 6000.0 K
       syncpar@primary@component: 1.0
*       period@primary@component: 0.5 d
*         freq@primary@component: 12.56637 rad / d
         pitch@primary@component: 0.0 deg
           yaw@primary@component: 0.0 deg
          incl@primary@component: 90.0 deg
       long_an@primary@component: 0.0 deg
     gravb_bol@primary@component: 0.32
  irrad_frac_refl_bol@primary...: 0.6
* irrad_frac_lost_bol@primary...: 0.4
   ld_func_bol@primary@component: logarithmic
  ld_coeffs_bol@primary@compo...: [0.5 0.5]
*         mass@primary@component: 1.00890679945 solMass
*          sma@primary@component: 1.675 solRad
b_cb['requiv@primary'] = 1.5
b_cb['pot@contact_envelope@component']
<Parameter: pot=3.40137740723 | keys: description, value, quantity, default_unit, limits, visible_if, copy_for>
b_cb['fillout_factor@contact_envelope@component']
<Parameter: fillout_factor=0.641789708077 | keys: description, value, quantity, default_unit, limits, visible_if, copy_for>
b_cb['requiv@secondary@component']
<Parameter: requiv=1.5 solRad | keys: description, value, quantity, default_unit, limits, visible_if, copy_for>

Now, of course, if we didn’t originally know we wanted a contact binary and built the default detached system, we could still turn it into an contact binary just by changing the hierarchy.

b_detached.add_component('envelope', component='contact_envelope')
<ParameterSet: 5 parameters | qualifiers: abun, pot_max, pot, fillout_factor, pot_min>
hier = phoebe.hierarchy.binaryorbit(b_detached['binary'], b_detached['primary'], b_detached['secondary'], b_detached['contact_envelope'])
print hier
orbit:binary(star:primary, star:secondary, envelope:contact_envelope)
b_detached.set_hierarchy(hier)
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING secondary is overflowing at L2/L3 (requiv=nan, requiv_max=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
Fri, 26 Oct 2018 11:41 PARAMETERS   WARNING primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)  If not addressed, this warning will continue to be raised and will throw an error at run_compute.
print b_detached.hierarchy
orbit:binary

    star:primary
    star:secondary
    envelope:contact_envelope

However, since our system was detached, the system is not overflowing, and therefore doesn’t pass system checks

b_detached.run_checks()
(False,
 'primary is underflowing at L1 and not a contact system (requiv=1.0, requiv_min=2.01327517654)')

And because of this, the potential and requiv@secondary constraints cannot be computed

b_detached['pot@component']
<Parameter: pot=nan | keys: description, value, quantity, default_unit, limits, visible_if, copy_for>
b_detached['requiv@secondary@component']
<Parameter: requiv=nan solRad | keys: description, value, quantity, default_unit, limits, visible_if, copy_for>

Likewise, we can make a contact system detached again simply by removing the envelope from the hierarchy. The parameters themselves will still exist (unless you remove them), so you can always just change the hierarchy again to change back to an overcontact system.

hier = phoebe.hierarchy.binaryorbit(b_detached['binary'], b_detached['primary'], b_detached['secondary'])
print hier
orbit:binary(star:primary, star:secondary)
b_detached.set_hierarchy(hier)
print b_detached.hierarchy
orbit:binary

    star:primary
    star:secondary

Although the constraints have been removed, PHOEBE has lost the original value of the secondary radius (because of the failed contact constraints), so we’ll have to reset that here as well.

b_detached['requiv@secondary'] = 1.0

Adding Datasets

b_cb.add_dataset('mesh', times=[0], dataset='mesh01')
<ParameterSet: 4 parameters | contexts: compute, dataset>
b_cb.add_dataset('orb', times=np.linspace(0,1,201), dataset='orb01')
<ParameterSet: 3 parameters | contexts: compute, dataset>
b_cb.add_dataset('lc', times=np.linspace(0,1,21), dataset='lc01')
<ParameterSet: 15 parameters | contexts: compute, dataset>
b_cb.add_dataset('rv', times=np.linspace(0,1,21), dataset='rv01')
<ParameterSet: 15 parameters | contexts: compute, dataset>

For comparison, we’ll do the same to our detached system

b_detached.add_dataset('mesh', times=[0], dataset='mesh01')
<ParameterSet: 4 parameters | contexts: compute, dataset>
b_detached.add_dataset('orb', times=np.linspace(0,1,201), dataset='orb01')
<ParameterSet: 3 parameters | contexts: compute, dataset>
b_detached.add_dataset('lc', times=np.linspace(0,1,21), dataset='lc01')
<ParameterSet: 15 parameters | contexts: compute, dataset>
b_detached.add_dataset('rv', times=np.linspace(0,1,21), dataset='rv01')
<ParameterSet: 15 parameters | contexts: compute, dataset>

Running Compute

b_cb.run_compute(irrad_method='none')
<ParameterSet: 26 parameters | kinds: rv, mesh, orb, lc>
b_detached.run_compute(irrad_method='none')
<ParameterSet: 26 parameters | kinds: rv, mesh, orb, lc>

Synthetics

To ensure compatibility with computing synthetics in detached and semi-detached systems in Phoebe, the synthetic meshes for our overcontact system are attached to each component separetely, instead of the contact envelope.

print b_cb['mesh01@model'].components
['primary', 'secondary']
print b_detached['mesh01@model'].components
['primary', 'secondary']

Plotting

Meshes

afig, mplfig = b_cb['mesh01@model'].plot(x='ws', show=True)
../../_images/minimal_contact_binary_55_0.png
afig, mplfig = b_detached['mesh01@model'].plot(x='ws', show=True)
../../_images/minimal_contact_binary_56_0.png

Orbits

afig, mplfig = b_cb['orb01@model'].plot(x='ws',show=True)
../../_images/minimal_contact_binary_58_0.png
afig, mplfig = b_detached['orb01@model'].plot(x='ws',show=True)
../../_images/minimal_contact_binary_59_0.png

Light Curves

afig, mplfig = b_cb['lc01@model'].plot(show=True)
../../_images/minimal_contact_binary_61_0.png
afig, mplfig = b_detached['lc01@model'].plot(show=True)
../../_images/minimal_contact_binary_62_0.png

RVs

afig, mplfig = b_cb['rv01@model'].plot(show=True)
../../_images/minimal_contact_binary_64_0.png
afig, mplfig = b_detached['rv01@model'].plot(show=True)
../../_images/minimal_contact_binary_65_0.png
Prev: Binary with Spots Next: Comparing Contacts Binaries in PHOEBE 2 vs PHOEBE Legacy
.
Last update: 10/29/2018 9:20 a.m. (CET)