def f_photo(L, p_photo): l, a, b, c, du, dd = tuple(L) if p_photo == 2: return heaviside(l - l_fizzle(L, 750)) * heaviside(l_fry(L, 600) - l) elif p_photo == 1: return heaviside(l - l_fizzle(L, 1100)) * heaviside(l_fry(L, 400) - l) else: return 1
def f_CO(L, p_CO, k_C=-.0089, k_O=.0118, k_Mg=-.500, k_Si=.0062): l, a, b, c, du, dd = tuple(L) Delta_ER = 1.35 * du + 2.92 * dd + 3.97 * a - 8.24 if p_CO == 1: return heaviside(Delta_ER - k_C) * heaviside(k_O - Delta_ER) elif p_CO == 2: return heaviside(Delta_ER - k_Mg) * heaviside(k_Si - Delta_ER) else: return 1
def f_Fe(L, p_Fe): l, a, b, c, du, dd = tuple(L) Fe_stable = -(-9.5 + 10.5412 * a - 0.511 * b - 4.67 * dd + 2.16 * du) Co_unstable = -3.75714 + 10.9144 * a - 0.511 * b - 4.67 * dd + 2.16 * du Ni_unstable = -2.87143 + 11.2876 * a - 0.511 * b - 4.67 * dd + 2.16 * du not_Cr = -(-10.3857 + 10.1679 * a - 0.511 * b - 4.67 * dd + 2.16 * du) if p_Fe == 1: # return heaviside(Ni_unstable)*heaviside(Fe_stable) return heaviside(Co_unstable) * heaviside(Fe_stable) # return heaviside(not_Cr) # return heaviside(Co_unstable) else: return 1
def n_temp(L, p_temp): #number of planets in temperate zone l, a, b, c, du, dd = tuple(L) if p_temp == 1: return .431*l**(-85/48)*a**(11/2)*b**(7/4)*c**(-5/8)\ *heaviside(1-temp_thresh(L)) else: return 1
def __init__(self, width, depth, shape, size, middle=None): import numpy as np from utils import heaviside # Create a new grid for the potential super(ThreeDOneDWell, self).__init__(shape, size) if middle is None: # Define r_0, the center of the well, to be the middle of the grid r_0 = size[2] / 2.0 else: # The middle is defined r_0 = middle one_d_vector = depth - depth*heaviside((r_0 + (width/2.0) - self.coord_array(2)) % self.size[2]) - \ depth*heaviside((r_0 - (width/2.0) - self.coord_array(2)) % self.size[2]) # one_d_vector = depth - depth*heaviside(((width/2.0) - abs(self.coord_array(2)-r_0) + self.size[2]/2.0) % self.size[2]) self.values = np.array([[one_d_vector]])
def __init__(self, width, depth, shape, size): import numpy as np from utils import heaviside # Create a new grid for the potential super(OneDWell, self).__init__(shape, size) # Define r_0, the center of the well, to be the middle of the grid r_0 = size[0] / 2.0 one_d_vector = depth - depth * heaviside( width / 2.0 - abs(self.coord_array(0) - r_0)) # self.values = np.array([[one_d_vector]]) self.values = one_d_vector
def f_NPS(L, p_NPS): l, a, b, c, du, dd = tuple(L) P31_stable = 8.25589 * a + 0.511 * b - 4.67 * dd + 2.16 * du S32_stable = -5.025 + 7.95682 * a - 0.511 * b - 4.67 * dd + 2.16 * du P32_stable = -(-6.575 + 7.50703 * a - 0.511 * b - 4.67 * dd + 2.16 * du) #N14_stable = -1.77143+4.76494*a-0.511*b-4.67*dd+2.16*du N14_stable = -1.58793 + 4.76494 * a - 0.511 * b - 4.67 * dd + 2.16 * du Cl35_stable = -(-5.30286 + 8.19482 * a - 0.511 * b - 4.67 * dd + 2.16 * du) if p_NPS == 1: return heaviside(N14_stable) if p_NPS == 2: return heaviside(P31_stable)+\ 51*heaviside(-S32_stable)*heaviside(P32_stable)+\ .4*heaviside(-P32_stable) elif p_NPS == 3: return heaviside(S32_stable)+\ heaviside(-P31_stable)+heaviside(Cl35_stable) else: return 1
def f_bio(L, p_bio): l, a, b, c, du, dd = tuple(L) if p_bio == 1: return heaviside(l_bio(L) - l) else: return 1
def f_conv(L, p_conv): l, a, b, c, du, dd = tuple(L) if p_conv == 1: return heaviside(l - l_conv(L)) else: return 1
def f_TL(L, p_TL): l, a, b, c, du, dd = tuple(L) if p_TL == 1: return heaviside(l - l_TL(L)) else: return 1
def f_IDH(t, G): return (t * G + 10**-6) * (1 - t * G) * heaviside(1 - t * G)
def f_setback(t, G): return (1 - t * G) * heaviside(1 - t * G)
def f_hj(L, p_hj): #simplified fraction of earths without hot jupiters if p_hj == 1: return (1 - (Z_inf / Z_maxpp(L))**2) * heaviside(Z_maxpp(L) - Z_inf) else: return 1
def f_pstep(L): #fraction of stars with planets (step function) return heaviside(Z_inf - Z_min(L))