<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Advanced
Step1:  As always, let's do imports and initialize a logger and a new Bundle.
Step2:  Built-in Constraints
There are a number of built-in constraints that can be applied to our system.  Those added by default are listed below as well as in the API docs for b.add_constraint
Step3:  esinw, ecosw
These constraints handle computing the projected eccentricity which can be helpful in that they are better representations of the geometry of a light curve and result in symmetric posteriors for near-circular orbits.
Both can be inverted to also automatically solve for 'ecc' or 'per0'.
Step4:  t0
This constraint handles converting between different t0 conventions - namely providing a reference time at periastron passage (t0_perpass) and at superior conjunction (t0_supconj).
Currently, this constraint only supports inverting to be solved for 't0_supconj' (ie you cannot automatically invert this constraint to constraint phshift or per0).
Step5:  freq
This constraint handles the simple conversion to frequency from period - whether that be rotational or orbital - and does support inversion to solve for 'period'.
Step6:  mass
This constraint handles solving for the mass of a component by obeying Kepler's third law within the parent orbit.
It can be inverted to solve for 'sma', 'q', or 'period' (in addition to 'mass').
Step7:  component sma
This constraint handles computing the semi-major axis of a component about the center of mass of its parent orbit.  Note that this is not the same as the semi-major axis of the parent orbit.
This currently can be inverted to solve for 'sma' of the parent orbit, but not 'q'.
Step8:  component asini
This constraint handles computing the projected semi-major axis of a component about the center of mass of its parent orbit.  Note that this is not the same as the asini of the parent orbit.
This currently can be inverted to solve for 'sma' of the parent orbit, but not 'q' or 'incl'.
Step9:  requiv_max
This constraint handles solving for the maxium equivalent radius (for a detached system).
For a semi-detached system, the radius itself is constrained to be exactly this value.
Step10:  rotation period
This constraint handles computing the rotation period of a star given its synchronicity parameter (syncpar).
It can be inverted to solve for any of the three parameters 'period' (both rotational and orbital) and 'syncpar'.
Step11:  pitch/yaw (incl/long_an)
pitch constrains the relation between the orbital and rotational inclination whereas yaw constrains the relation between the orbital and rotational long_an.  When pitch and yaw are set to 0, the system is aligned.
<ASSISTANT_TASK:>
Python Code:
#!pip install -I "phoebe>=2.4,<2.5"
Explanation: Advanced: Built-In Constraints
Setup
Let's first make sure we have the latest version of PHOEBE 2.4 installed (uncomment this line if running in an online notebook session such as colab).
End of explanation
import phoebe
from phoebe import u # units
import numpy as np
import matplotlib.pyplot as plt
logger = phoebe.logger()
b = phoebe.default_binary()
Explanation: As always, let's do imports and initialize a logger and a new Bundle.
End of explanation
b.filter(qualifier='asini', context='constraint')
b.get_parameter(qualifier='asini', component='binary', context='constraint')
Explanation: Built-in Constraints
There are a number of built-in constraints that can be applied to our system.  Those added by default are listed below as well as in the API docs for b.add_constraint:
asini
These constraint handles computing the projected semi-major axis (either for an orbit or a star) along the line of sight and can be automatically inverted to solve for either 'asini', 'sma', or 'incl'.
End of explanation
b.get_parameter(qualifier='esinw', context='constraint')
b.get_parameter(qualifier='ecosw', context='constraint')
Explanation: esinw, ecosw
These constraints handle computing the projected eccentricity which can be helpful in that they are better representations of the geometry of a light curve and result in symmetric posteriors for near-circular orbits.
Both can be inverted to also automatically solve for 'ecc' or 'per0'.
End of explanation
b.get_parameter(qualifier='t0_perpass', context='constraint')
Explanation: t0
This constraint handles converting between different t0 conventions - namely providing a reference time at periastron passage (t0_perpass) and at superior conjunction (t0_supconj).
Currently, this constraint only supports inverting to be solved for 't0_supconj' (ie you cannot automatically invert this constraint to constraint phshift or per0).
End of explanation
b.filter(qualifier='freq', context='constraint')
b.get_parameter(qualifier='freq', component='binary', context='constraint')
b.get_parameter(qualifier='freq', component='primary', context='constraint')
Explanation: freq
This constraint handles the simple conversion to frequency from period - whether that be rotational or orbital - and does support inversion to solve for 'period'.
End of explanation
b.filter(qualifier='mass', context='constraint')
b.get_parameter(qualifier='mass', component='primary', context='constraint')
Explanation: mass
This constraint handles solving for the mass of a component by obeying Kepler's third law within the parent orbit.
It can be inverted to solve for 'sma', 'q', or 'period' (in addition to 'mass').
End of explanation
b.filter(qualifier='sma', context='constraint')
b.get_parameter(qualifier='sma', component='primary', context='constraint')
Explanation: component sma
This constraint handles computing the semi-major axis of a component about the center of mass of its parent orbit.  Note that this is not the same as the semi-major axis of the parent orbit.
This currently can be inverted to solve for 'sma' of the parent orbit, but not 'q'.
End of explanation
b.filter(qualifier='asini', context='constraint')
b.get_parameter(qualifier='asini', component='primary', context='constraint')
Explanation: component asini
This constraint handles computing the projected semi-major axis of a component about the center of mass of its parent orbit.  Note that this is not the same as the asini of the parent orbit.
This currently can be inverted to solve for 'sma' of the parent orbit, but not 'q' or 'incl'.
End of explanation
b.filter(qualifier='requiv_max', context='constraint')
b.get_parameter(qualifier='requiv_max', component='primary', context='constraint')
Explanation: requiv_max
This constraint handles solving for the maxium equivalent radius (for a detached system).
For a semi-detached system, the radius itself is constrained to be exactly this value.
End of explanation
b.filter(qualifier='period', context='constraint')
b.get_parameter(qualifier='period', component='primary', context='constraint')
Explanation: rotation period
This constraint handles computing the rotation period of a star given its synchronicity parameter (syncpar).
It can be inverted to solve for any of the three parameters 'period' (both rotational and orbital) and 'syncpar'.
End of explanation
b.filter(qualifier='incl', context='constraint')
b.get_parameter(qualifier='incl', component='primary', context='constraint')
b.filter(qualifier='long_an', context='constraint')
b.get_parameter(qualifier='long_an', component='primary', context='constraint')
Explanation: pitch/yaw (incl/long_an)
pitch constrains the relation between the orbital and rotational inclination whereas yaw constrains the relation between the orbital and rotational long_an.  When pitch and yaw are set to 0, the system is aligned.
End of explanation
<END_TASK>