SkillAgentSearch skills...

TRES

TRiple Evolution Simulation package

Install / Use

/learn @amusecode/TRES
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

TRES

TRiple Evolution Simulator

Description

TRES is a numerical framework for simulating hierarchical triple systems with stellar and planetary components. Mass transfer from one star to another and the consequential effect to the orbital dynamics is realized via heuristic recipes. These recipes are combined with three-body dynamics and stellar evolution inluding their mutual influences.

TRES includes the effects of common-envelope evolution, circularized stable mass transfer, tides, gravitational wave emission and up-to-date stellar evolution including chemically homogeneous evolution. By default the stellar evolution code SeBa is used. Other stellar evolution codes such as SSE or MESA can also be used.

This document contains the following parts:

Compilation

Simple examples

TRES-Exo for exoplanet research

TRES with other stellar evolution codes

Understanding the TRES output

Reducing the TRES output

TRES development team

References

Compilation

TRES makes use of the Astrophysical Multipurpose Software Environment (AMUSE) See https://amusecode.github.io/ for how to install AMUSE. Note that for standard TRES usage, the only necessary community code to install is SeBa.

Thus, after installing the AMUSE pre-requisites, we can simply install the minimal framework and then add SeBa:


pip install [--user] amuse-framework
pip install [--user] amuse-<seba>

After compiling AMUSE, TRES needs to be installed and compiled by means of the Makefile as following:

First, clone the TRES github repository:


git clone https://github.com/amusecode/TRES.git

Then, from the root of the cloned respository compile the Makefile:


cd seculartriple_TPS
make clean
make

Note: If the above line doesn't work, which may be the case for older versions of amuse, try:

(cd seculartriple_TPS)
mv Makefile Makefile_new
mv Makefile_old Makefile
make clean
make

Simple examples of runs

To evolve a single system with the parameters: primary mass M=1.2 Solar mass, secondary mass m=0.5 Solar mass, tertiary mass m=0.6 Solar mass, inner and outer eccentricity e=0.1 & 0.5, inner and outer orbital separation a=200 & 20000 Solar radii, metallicity z=0.001, and time T=10 Myrs, you need to run:


python TRES.py -M 1.2 -m 0.5 -l 0.6 -E 0.1 -e 0.5 -A 200 -a 20000 -z 0.001 -T 10

assuming AMUSE is loaded in your python.

To include eccentric mass transfer, add '--no_stop_at_mass_transfer' flag, e.g.


python TRES.py -M 1.2 -m 0.5 -l 0.6 -E 0.1 -e 0.5 -A 200 -a 20000 -z 0.001 -T 10000 --no_stop_at_mass_transfer

Input parameters

The full list of possible input parameters is: Depreciated (yet still functioning) parameters are given in {}.

                  parameter                               unit / default
--M1    {-M}      inner_primary_mass                      in Solar mass
--M2    {-m}      inner secondary mass                    in Solar mass
--M3    {-l}      outer mass                              in Solar mass
--Ain   {-A}      inner semi major axis                   in Solar radius
--Aout  {-a}      outer semi major axis                   in Solar radius
--Ein   {-E}      inner eccentricity
--Eout  {-e}      outer eccentricity
-i, -I            relative inclination                    in rad
--Gin   {-G}      inner argument of pericenter            in rad
--Gout  {-g}      outer argument of pericenter            in rad
--Oin   {-O}      inner longitude of ascending node       in rad
                  (outer longitude of ascending nodes = inner - pi)
-Z      {-z}      metallicity                             default = 0.02 (Solar)
-t, -T            end time                                in Myr
-N, -n            integer number asigned to the triple    default = 0
-s                integer number to specify seed          default = -1 (random seed)

-f                name of output file                     default = TRES
-F                type of output file (hdf5/txt)          default = hdf5
--dir_plots       directory for plots for debugging default = "" (current directory)
                  mode  (aka REPORT_DEBUG == True)

--CE    which type of modelling for common envelope evolution   default = 2
        options:
        0:  alpha-ce + alpha-dce
        1:  gamma-ce + alpha-dce
        2:  seba style; combination of gamma-ce, alpha-ce & alpha-dce
Note that in all cases a double common-envelope is calculated using the alpha-ce.

--SN_kick_distr   supernova kick distribution   default = 10
        options:
        0:  No kick
        1:  Hobbs, Lorimer, Lyne & Kramer 2005, 360, 974
        2:  Hobbs, Lorimer, Lyne & Kramer 2005, 360, 974  scaled down for bh by mass
        3:  Arzoumanian ea 2002, 568, 289
        4:  Arzoumanian ea 2002, 568, 289 scaled down for bh by mass
        5:  Hansen & Phinney 1997, 291, 569
        6:  Hansen & Phinney 1997, 291, 569 scaled down for bh by mass
        7:  Paczynski 1990, 348, 485
        8:  Paczynski 1990, 348, 485 scaled down for bh by mass
        9:  Verbunt, Igoshev & Cator, 2017, 608, 57
        10:  Verbunt, Igoshev & Cator, 2017, 608, 57 scaled down for bh by mass

--max_CPU_time    maximum CPU time allowed (only works in combination with "stop_at_CPU_time")
                                                default = 3600 (seconds)

Additionally, there is a list of stopping conditions that determines whether the simulation of a system should stop at a certain evolutionary phase. By default, these stopping conditions are set to True, which means they are in effect. However, the four specific mass transfer cases (stable, unstable, eccentric stable & eccentric unstable) are set to False by default. Once "--no_stop_at_mass_transfer" is set to False, it is possible to set the specific mass transfer cases to True.


action items                                    add these to:
--no_stop_at_mass_transfer                      avoid stopping the simulation at the onset of mass transfer
--no_stop_at_init_mass_transfer                 avoid stopping the simulation if there is mass transfer initially
--no_stop_at_outer_mass_transfer                avoid stopping the simulation when tertiary initiates mass transfer
                                                methodology is as of yet non-existent
--stop_at_stable_mass_transfer                  stop the simulation at the onset of stable mass transfer in the inner binary
--stop_at_unstable_mass_transfer                stop the simulation at the onset of unstable mass transfer in the inner binary (leading to common-envelope evolution)
--stop_at_eccentric_stable_mass_transfer        stop the simulation at the onset of stable mass transfer in the inner binary if the orbit is eccentric
--stop_at_eccentric_unstable_mass_transfer      stop the simulation at the onset of unstable mass transfer in the inner binary if the orbit is eccentric
--no_stop_at_merger                             avoid stopping the simulation after a merger
--no_stop_at_inner_collision                    avoid stopping the simulation after a collision in the inner binary
--no_stop_at_outer_collision                    avoid stopping the simulation after a collision involving the outer star
--no_stop_at_disintegrated                      avoid stopping after the system disintegrated into seperate systems
--stop_at_semisecular_regime                    stop the simulation if the sytem is in the semi secular regime
--stop_at_SN                                    stop the simulation when a supernova occurs
--stop_at_CPU_time                              stop the simulation when the computational time exceeds a given value

Multiple systems with specified parameters

If you need to follow the triple evolution for multiple systems with parameters which are already specified you can start TRES multiple times, e.g.


python TRES.py -M 1.2 -m 0.5 -l 0.6 -E 0.1 -e 0.5 -A 200 -a 20000 -z 0.001 -T 10
python TRES.py -M 1.5 -m 1 -l 0.6 -E 0.1 -e 0.5 -A 50 -a 20000 -z 0.001 -T 10
python TRES.py -M 1.5 -m 1 -l 0.05 -E 0.1 -e 0.5 -A 50 -a 20000 -z 0.02 -T 10

This is probably not handy for more than 5 systems. Although this can be added in e.g. a shell or Python script.

Random population

A random population can be generated with TPS.py with a Monte Carlo based approach, e.g.


python TPS.py -n 5
python TPS.py -n 10 --M_max 5 --M_min 4  --M_distr 0 --A_max 2000 --A_min 200 --A_distr 2

The full list of options is [default]: Depreciated (yet still functioning) parameters are given in {}.


--M1_max       {--M_max}    upper limit for the inner primary mass [100 Msun]
--M1_min       {--M_min}    lower limit for the inner primary mass [0.1 Msun]
--M1_distr     {--M_distr}  mass function option:
        0: "Kroupa", #default
        1: "Scalo",
        2: "Miller & Scalo",
        3: "Salpeter",
        4: "Logarithmically flat",
        5: "Eggleton",
        6: "Kroupa for massive stars M>0.5 powerlaw with exp=-2.3",
--Qin_max      {--Q_max}    upper limit for the inner mass ratio [1.]
--Qin_min      {--Q_min}    lower limit for the inner mass ratio [0.]
--Qin_distr    {--Q_distr}  inner mass ratio option:
       0: "Uniform distribution", #default
       1: "Kroupa IMF",
       2: "Galicher et al. 2016 powerlaw (M^-1.31)", #draws from mass distribution instead of mass ratio distribution,
--Qout_max     {--q_max}    upper limit for the outer mass ratio [1.]
--Qout_min     {--q_min}    lower limit for the mass of the outer star [0.]
--Qout_distr   {--q_distr}  outer mass ratio option:
       0: "Uniform distribution", #default
       1: "Kroupa IMF",
       2: "Galicher et al. 2016 powerlaw (M^-1.31)", #draws from mass distribution instead of mass ratio distr
View on GitHub
GitHub Stars13
CategoryDevelopment
Updated2mo ago
Forks11

Languages

Python

Security Score

75/100

Audited on Feb 5, 2026

No findings