Skip to content
Wartets edited this page Sep 7, 2024 · 3 revisions

N-Body Simulation Wiki

Overview

Welcome to the N-Body Simulation project! This simulation allows you to explore the dynamics of an N-body system with gravity, electromagnetism, collisions, and friction. You can control various parameters for each object, including speed, mass, charge, and position.

Getting Started

Launching the Simulation

  1. Open the Simulation: Navigate to the project repository on GitHub and open the index.html file in a web browser, or use the online version : link.

  2. Full-Screen Mode: To enter full-screen mode, click the "Full-screen" button at the bottom-left of the screen or press F11.

  3. Start/Pause Simulation: Click the "Start simulation" button to start the simulation. Click it again to pause.

Controlling Objects

  • Add/Remove Objects: Use the "Add Object" button to add a new object to the simulation. To remove an object, use the corresponding control options that appear when you select the object.

  • Object Controls: Each object can be individually controlled. You can adjust the mass, velocity (in x and y directions), and position (in x and y directions).

Adjusting Simulation Parameters

  • Time Interval (dt): Adjust the time interval for simulation steps in the "Time Interval" input field. Smaller values make the simulation more realistic, but slow it down.

  • Gravity and Electromagnetic Forces: Toggle gravity and electromagnetic forces using the checkboxes under "Enable Gravity" and "Activate the electromagnetic force". Electromagnetic or gravitational fields can also be displayed in real time using the corresponding checkboxes.

  • Collisions and Friction: Enable or disable collision detection and friction using their respective checkboxes. The friction coefficient can be adjusted if friction is enabled.

View and Zoom Controls

  • Reset View: Click the "Reset View" button to reset the simulation view.

  • Zoom: Adjust the zoom level using the zoom buttons. You can zoom in or out by factors of 2 or 10 using the buttons in the controls, or by scrolling the mouse over the simulation canvas. On cell phones, you can change the zoom using a pinch gesture.

  • Mouse Movement: Move around the simulation area by dragging the mouse.

  • Field visualization: You can activate the visualization of the simulation's gravity or electromagnetic fields using the checkboxes

  • Help: A small help button in the top right-hand corner of the canvas provides useful links to the website.

Saving and Loading Presets

  • Save Preset: Click "Save Preset" to save the current simulation state. Enter a name for the preset, or leave it blank for a default name.

  • Load Preset: Select a preset from the "Choose a preset" dropdown and click "Load Preset" to load it.

Key Controls

  • Gravity: Toggle gravity with the g key.
  • Collisions: Toggle collisions with the c key.
  • Reset View: Reset the view with the r key.
  • Friction: Toggle friction with the f key.
  • Show Speed Vectors: Display speed vectors with the v key.
  • Play/Pause: Start or pause the simulation with the space bar or enter key.
  • Full-Screen: Toggle full-screen mode with the F11 key.

Language Support

The simulation supports several languages. You can select the language of your choice from the drop-down menu at the top of the control panel.

Additional Resources

Feel free to contribute to the project or raise issues if you encounter any problems. Happy simulating!