The motion of an asteroid in a mean-motion resonance with a planet of the Solar System can be modeled with a Hamiltonian system. The system is obtained by averaging the Hamiltonian of the N-body problem over the fast angles, by keeping the term given by the resonance. More details about this approach can be found in Fenucci et al., 2022.
This software implements the computation of the resonant Hamiltonian over a grid in the plane of semi-major axis
The code is structured into the following folders:
- src: contains the source codes
- bin: contains the binary files of the executable
- lib: contains the QUADPACK library translated to Fortran90
- tests: folder to run the executable
- .mod: contains the .mod files needed at compilation time
- .obj: contains the .o files needed at compilation time
Before using the program for the first time, the code needs to be compiled. To facilitate the user, the software comes with a Makefile that automatically perform the job. For the software to be compiled correctly, the GNU gfortran compiler should be installed and available.
To compile the code, run the Makefile by typing
make
The executable binary hamiltonian.x will be placed in the bin directory. A symbolic link will be created in the tests directory.
The program needs a namelist input file, containing the following parameters:
- ecc: eccentricity of the asteroid;
- inc: inclination of the asteroid (deg);
- OmNod: right ascension of the ascending node of the asteroid (deg);
- omega: argument of perihelion of the asteroid (deg);
- res_pla: planet involved in the resonance. Integer numbers from 1 to 8 are accepltable, with 1 = Mercury, 2 = Venus, 3 = Earth, etc;
- h1, h2: co-prime integer numbers defining the type of mean-motion resonance;
- res_width: resonance width in semi-major axis (au);
-
a_n: number of points for the sampling of the semi-major axis
$a$ ; -
sigma_n: number of points for the sampling of the resonant angle
$\sigma$ ; - fileout: name for the output file;
-
nsample: sample size for generating random couples in
$(a,\sigma)$ and corresponding value of the Hamiltonian.
The program can be run from a terminal with
./hamiltonian.x <filepath>
where <filepath> is the path of the input file containing the input parameters.
The program will produce two output files, one containing the discretization of the Hamiltonian on a grid of points in the
-
Column 1: value of
$\sigma$ (deg); -
Column 2: value of
$a$ (au); - Column 3: Value of the Hamiltonian function.
The folder tests contain the Python script run_parallel.py which can be used to produce data to replicate the work by Fenucci et al. 2026. The script computes the level curves of the Hamiltonian for orbits in the Earth co-orbital space. Level curves are computed over a grid in the space of
./hamiltonian.x --ncores
where ncores is the number of cores to be used.
This is an open-source software released under MIT license license, and it is developed and maintained by Marco Fenucci, European Space Agency NEO Coordination Centre (marco.fenucci@ext.esa.int).
- M. Fenucci et al., 2022. Proper elements for resonant planet-crossing asteroids, Celestial Mechanics and Dynamical Astronomy 134