<jupyter_start><jupyter_text>Create Planet object and stellar evolutionary track  Example planet 1.1 - V1298Tau c with 5 Eearth mass core and measured radius (var. step)<jupyter_code># (David et al. 2019, Chandra observation)
L_bol, mass_star, radius_star = 0.934, 1.101, 1.345 # solar units
age_star = 23. # Myr
Lx_age = Lx_chandra = 1.3e30  # erg/s in energy band: (0.1-2.4 keV)
Lx_age_error = 1.4e29

# use dictionary to store star-parameters
star_V1298Tau = {'star_id': 'V1298Tau', 'mass': mass_star, 'radius': radius_star, 'age': age_star, 'L_bol': L_bol, 'Lx_age': Lx_age}

Lx_1Gyr, Lx_5Gyr = 2.10*10**28, 1.65*10**27
track_low = {"t_start": star_V1298Tau["age"], "t_sat": star_V1298Tau["age"], "t_curr": 1000., "t_5Gyr": 5000., "Lx_max": Lx_age, 
         "Lx_curr": Lx_1Gyr, "Lx_5Gyr": Lx_5Gyr, "dt_drop": 20., "Lx_drop_factor": 16.}
track_med = {"t_start": star_V1298Tau["age"], "t_sat": star_V1298Tau["age"], "t_curr": 1000., "t_5Gyr": 5000., "Lx_max": Lx_age, 
         "Lx_curr": Lx_1Gyr, "Lx_5Gyr": Lx_5Gyr, "dt_drop": 0., "Lx_drop_factor": 0.}
track_high = {"t_start": star_V1298Tau["age"], "t_sat": 240., "t_curr": 1000., "t_5Gyr": 5000., "Lx_max": Lx_age, 
         "Lx_curr": Lx_1Gyr, "Lx_5Gyr": Lx_5Gyr, "dt_drop": 0., "Lx_drop_factor": 0.}

# planet c
planet = {"core_mass": 5.0, "radius": 5.59, "distance": 0.0825, "metallicity": "solarZ"}

pl = Planet_LoFo14(star_V1298Tau, planet)
pl.__dict__<jupyter_output><empty_output><jupyter_text>Example planet 1.1.1 - V1298Tau c with 5 Eearth mass core and measured radius (fixed step)<jupyter_code>pl = Planet_LoFo14_PAPER(star_V1298Tau, planet)<jupyter_output><empty_output><jupyter_text>Example planet 1.2 - V1298Tau c with mass estimate from Otegi et al. (2020) and measured radius (var step)<jupyter_code>pl = Planet_Ot20(star_V1298Tau, planet)
pl.__dict__<jupyter_output><empty_output><jupyter_text>Example planet 1.2.1 - V1298Tau c with mass estimate from Otegi et al. (2020) and measured radius (fixed step)<jupyter_code>pl = Planet_Ot20_PAPER(star_V1298Tau, planet)
pl.__dict__<jupyter_output><empty_output><jupyter_text>Example planet 2 - artificial planet with specified core mass and envelope mass fraction<jupyter_code>Lx_1Gyr, Lx_5Gyr = 2.10*10**28, 1.65*10**27

dict_star = {'star_id': 'star_age1.0_mass0.89',
 'mass': 0.8879632311581124,
 'radius': None,
 'age': 1.0,
 'L_bol': 1.9992811847525246e+33/const.L_sun.cgs.value,
 'Lx_age': 1.298868513129789e+30}

dict_pl = {'distance': 0.12248611607793611,
 'metallicity': 'solarZ',
'fenv': 3.7544067802231664,
 'core_mass': 4.490153906104026}

track = {"t_start": dict_star["age"], "t_sat": 100., "t_curr": 1000., "t_5Gyr": 5000., "Lx_max": Lx_age, 
         "Lx_curr": Lx_1Gyr, "Lx_5Gyr": Lx_5Gyr, "dt_drop": 0., "Lx_drop_factor": 0.}

pl = Planet_LoFo14(dict_star, dict_pl)
#pl.__dict__<jupyter_output><empty_output><jupyter_text>Evolve & create outputs<jupyter_code>%%time

folder_id = "dummy"
path_save = os.getcwd() + "/" + folder_id +"/"
if not os.path.exists(path_save):
    os.makedirs(path_save)
else:
    os.system("rm -r " + path_save[:-1])
    os.makedirs(path_save)

t_final = 5007.
pl.evolve_forward_and_create_full_output(t_final, 0.1, 0.1, "yes", "yes", track_high, path_save, folder_id)<jupyter_output>CPU times: user 14.8 s, sys: 11.8 ms, total: 14.8 s
Wall time: 14.8 s<jupyter_text>Read in results and plot<jupyter_code>df_pl = pl.read_results(path_save)
df_pl.head()
df_pl.tail()
# fig, ax = plt.subplots(figsize=(10,5))
# ax.plot(df_pl["Time"], df_pl["Lx"])
# ax.loglog()
# plt.show()
fig, ax = plt.subplots(figsize=(10,5))
age_arr = np.logspace(np.log10(pl.age), np.log10(t_final), 100)

if (type(pl) == platypos.planet_LoFo14.Planet_LoFo14
        or type(pl) == platypos.planet_LoFo14_PAPER.Planet_LoFo14_PAPER):
    ax.plot(age_arr, plmoLoFo14.calculate_planet_radius(pl.core_mass, pl.fenv, age_arr, pl.flux, pl.metallicity), \
            lw=2.5, label='thermal contraction only', color="blue")
    ax.plot(df_pl["Time"], df_pl["Radius"], 
            marker="None", ls="--", label='with photoevaporation', color="red")
else:
    ax.plot(df_pl["Time"], df_pl["Radius"], marker="None", ls="--", label='with photoevaporation', color="red")

ax.legend(fontsize=10)
ax.set_xlabel("Time [Myr]", fontsize=16)
ax.set_ylabel("Radius [R$_\oplus$]", fontsize=16)
ax.set_xscale('log')
#ax.set_ylim(5.15, 5.62)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16985428051001822, 'fraction_numerical': 0.09039162112932604, 'mean_word_length': 5.67629179331307, 'pattern_counts': {'":': 40, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '4336', 'license': 'MIT', 'n_tokens_mistral': 2175, 'n_tokens_neox': 1903, 'n_words': 364, 'path': 'examples/Evolve_one_planet.ipynb', 'repo_name': 'soumitrahazra/platypos', 'size': '4392'}