Kanishk Sachdev

Software Engineer and Student

N-Body Gravity Simulation

A real-time simulation of gravitational interactions between multiple celestial bodies. Demonstrates orbital mechanics, gravitational forces, and chaotic n-body dynamics.

Technical Implementation:

Gravitational Physics: Uses Newton's law of universal gravitation F = G(m₁m₂)/r² to calculate forces between all body pairs at each timestep.

Numerical Integration: Applies Euler's method to update velocities and positions based on calculated gravitational accelerations.

N-Body Problem: Computes O(n²) gravitational interactions for realistic multi-body orbital dynamics and chaotic behavior.

Visualization: Real-time rendering with orbital trails, velocity vectors, and interactive body manipulation for exploring gravitational systems.

Current system: Binary • Simulation is running0 bodies • Trails are visible

Click bodies to select • Shift+click to add new bodies • Drag to move bodies

Global Settings

200
0.02
1.00
100

Body Properties

Select a celestial body to configure its properties.

• Click on a body to select it
• Shift+click on empty space to add a new body
• Drag bodies to move them around
• Try different preset systems from the dropdown

Orbital Mechanics:

Stable Orbits: Occur when gravitational force provides exactly the centripetal force needed for circular motion. Adjust velocities to achieve stable orbits.

Chaotic Systems: Three or more bodies create unpredictable, chaotic motion due to complex gravitational interactions - the famous n-body problem.

Energy Conservation: In ideal conditions, total mechanical energy (kinetic + potential) remains constant. Damping allows energy dissipation for more stable systems.

Feel free to contact me at kanishksachdev@gmail.com