This program simulates and visualizes the Sitnikov problem - a special case of the three-body problem in celestial mechanics. It consists of two primary bodies moving in elliptical orbits around their center of mass, while a third body moves along a line perpendicular to the orbital plane of the primaries.
- Parallel computation using MPI (Message Passing Interface)
- Configurable orbital parameters via YAML configuration
- Phase portrait generation
- Multiple numerical integration methods support
- Progress tracking for parallel computations
- Python 3.x
- NumPy
- SciPy
- Matplotlib
- mpi4py
- PyYAML
All requirements are listed in requirements.txt file for Python environment.
- Clone the repository:
git clone https://github.com/StepanRepo/sitnikov-problem.git
cd sitnikov-problem- Create and activate a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Unix/macOS
# or
.\venv\Scripts\activate # On Windows- Install dependencies:
pip install -r requirements.txtThe simulation parameters can be configured in config.yaml:
-
orbit: Primary bodies' orbital parametersa: Semi-major axise: Eccentricity (0 ≤ e < 1)
-
grid: Integration parametersnz: Number of position grid pointsndot: Number of velocity grid pointsz0,z1: Position rangedotz0,dotz1: Velocity ranget0,tf: Time range
-
integrator:-
method: Integration method. Supported methods fromscipy.integrate.solve_ivp:- 'RK45' (default): Explicit Runge-Kutta method of order 5(4)
- 'RK23': Explicit Runge-Kutta method of order 3(2)
- 'DOP853': Explicit Runge-Kutta method of order 8
- 'Radau': Implicit Runge-Kutta method of the Radau IIA family of order 5
- 'BDF': Implicit multi-step variable-order method
- 'LSODA': Adams/BDF method with automatic stiffness detection
For detailed information about these methods, see SciPy's solve_ivp documentation
-
-
plotter: Visualization parameterszmin,zmax: Position plot rangedotzmin,dotzmax: Velocity plot rangedpi: Output image resolution
-
parallel:track: Enable/disable progress tracking
python main.pympirun -n <number_of_processes> python main.pypython plot.pyThe program generates:
- Data files in the
result/directory containing trajectories - A phase portrait plot showing the system's dynamics
The Sitnikov problem describes the motion of a massless particle moving perpendicular to the plane of two equal masses (primaries) in elliptical orbits. The equations of motion are:
where:
-
$z$ is the position of the third body -
$r$ is the distance of the primaries from the center of mass -
$t$ is time -
$e$ is orbital eccenrisity