Binary with Pulsations

NOTE: pulsations are currently being tested but not yet supported

Setup

Let's first make sure we have the latest version of PHOEBE 2.1 installed. (You can comment out this line if you don't use pip for your installation or don't want to update to the latest release).


In [ ]:
!pip install -I "phoebe>=2.1,<2.2"

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


In [1]:
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt

logger = phoebe.logger()

b = phoebe.default_binary()


/usr/local/lib/python2.7/dist-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)
WARNING: Constant u'Gravitational constant' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Gravitational constant' is already has a definition in the u'si' system
WARNING: Constant u'Solar mass' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar mass' is already has a definition in the u'si' system
WARNING: Constant u'Solar radius' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar radius' is already has a definition in the u'si' system
WARNING: Constant u'Solar luminosity' is already has a definition in the u'si' system [astropy.constants.constant]
WARNING:astropy:Constant u'Solar luminosity' is already has a definition in the u'si' system
WARNING: developer mode enabled, to disable 'rm ~/.phoebe_devel_enabled' and restart phoebe or phoebe._devel_enabled=False to temporarily disable
/usr/local/lib/python2.7/dist-packages/astropy/units/quantity.py:732: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  return super(Quantity, self).__eq__(other)

Adding Pulsations

Let's add one pulsation to each of our stars in the binary.

A pulsation is a feature, and needs to be attached directly to a component upon creation. Providing a tag for 'feature' is entirely optional - if one is not provided it will be created automatically.


In [2]:
b.add_feature('pulsation', component='primary', feature='puls01')


Out[2]:
<ParameterSet: 5 parameters | qualifiers: freq, radamp, m, teffext, l>

In [3]:
#b.add_feature('pulsation', component='secondary', feature='puls02')

Pulsation Parameters

Pulsations are defined by a frequency and amplitude


In [4]:
print b['puls01']


ParameterSet: 5 parameters
           radamp@puls01@feature: 0.1
             freq@puls01@feature: 1.0 1 / d
                l@puls01@feature: 1.0
                m@puls01@feature: 1.0
          teffext@puls01@feature: False

In [5]:
b.set_value(qualifier='l', feature='puls01', value=0)

In [6]:
b.set_value(qualifier='m', feature='puls01', value=0)

In [7]:
b.add_dataset('lc', times=np.linspace(0,1,21))


Out[7]:
<ParameterSet: 11 parameters | kinds: lc, lc_dep>

In [8]:
b.run_compute(irrad_method='none', pbmesh=True)


/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3013: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,0] = coords_for_computations[:,0] + xi_r * np.sin(theta) * np.cos(phi)
/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3014: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,1] = coords_for_computations[:,1] + xi_r * np.sin(theta) * np.sin(phi)
/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3015: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,2] = coords_for_computations[:,2] + xi_r * np.cos(theta)
/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3044: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,0] = coords_for_observations[:,0] + xi_r * np.sin(theta) * np.cos(phi)
/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3045: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,1] = coords_for_observations[:,1] + xi_r * np.sin(theta) * np.sin(phi)
/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/universe.py:3046: ComplexWarning: Casting complex values to real discards the imaginary part
  new_coords[:,2] = coords_for_observations[:,2] + xi_r * np.cos(theta)
Out[8]:
<ParameterSet: 1294 parameters | kinds: mesh, lc>

In [9]:
plt.clf()
b['model'].animate()


/usr/local/lib/python2.7/dist-packages/matplotlib/collections.py:590: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  if self._edgecolors == str('face'):
Out[9]:


Once Loop Reflect

In [ ]: