Skip to content

QED137/N-Body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 

Repository files navigation

N-Bodies Simulation: Chaos In Planetary System

This is an old computational program in Python that I completed during my Master's in Astro and Particle Physics as part of a practical course in Astronomy and Astrophysics coursework. The repository has two different

The gravitation appears deceptively simple when it is put into mathematical form. The weakest among the lot! Its dependence on mass and the infinite range of effects creates an insurmountable difficulty when considering any celestial body's dynamics. In common dictum, each body attracts the other, so the motion of a body has a very complicated dependence on the configurations of other bodies. The N-body problem is about this. This protocol aims to consider an assembly of N-bodies and study the cause and effect among themselves.

The Problem

Classical mechanics gives a few handfuls of ways of looking at the problem of classical dynamics. Lagrangian and Hamiltonian points of view are essentially similar to each other, but preferences of one over the other depend on the nature of the problem. Hamiltonian method opens a new way of visualizing the problem in the phase space. Since the N-body problem consists of a large number of particles, the Hamiltonian point of view is more feasible.

The motion of N point masses in their mutual gravitational field is the classical N-body problem. The Hamiltonian of a system is

$$ H = \sum_{i=1}^{N} \frac{\boldsymbol{{p}}^2_i}{2m_i}-\sum_{i=1}^{N}\sum_{j=i+1}^{N}\frac{G m_i m_j}{|\boldsymbol{q}_i-\boldsymbol{q}_j|} $$

With canonical momentum $\boldsymbol{p}_i=mv_i$.

$m_i$ is the mass of the particle located at $r_i$.

$$ \boldsymbol{q}_i = \frac{\partial H}{\partial \boldsymbol{p}_i} \implies \frac{d\boldsymbol{r}_i}{dt} = \boldsymbol{v}_i $$

and

$$ \boldsymbol{p}_i = -\frac{\partial H}{\partial \boldsymbol{q}_i} \implies \frac{d\boldsymbol{v}_i}{dt} = \boldsymbol{a}_i $$

Steps Are

-Using Hamiltonian the equation of motion, here, the rate of change of position vector and momenta, are obtained.

-Different numerical methods of computing differential equations have been used.

-Finally, the results are plotted. Oribit of two body systems, stability analysis of numerical computations, etc.

A Step Towards Calculation

The dynamics aim to find the positions of particles for a given time. Numerical integration of the differential equations is required for this purpose. The Euler method, Leap Frog method, Verlet method, and Runge-Kutta method are employed for numerical calculations.

Getting Started

Follow these steps to get the project up and running on your local machine. Prerequisites

Python 3.x
NumPy
Matplotlib

Installation

Clone the repository: url git clone https://github.com/QED137/N-Body

Details of the problem and solution have been explained in the jupyter file


How To Run?

Acknowledgements

This project is part of the experimental lab for the Master's in Astro and Particle Physics course at the University of Tübingen.

About

Chaos In Planetory System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published