A Java application to simulate 3D gravitational physics. Currently, this project is in early stages of development. Various integration methods may be implemented via the Integrator class, such as:
- The explicit Euler method
- The symplectic Euler method
- The velocity Verlet method
The orthographic 3D visuals are built on top of the Graphics2D library, and thus remain rather unrefined. Future improvements relating to parallel simulation step processing are planned.
This program allows both the graphical parameters and the initial conditions of the simulation to be specified in user configuration files.
The simulator requires configuration files to be placed in a specific location:
- Linux/macOS: Create a folder named
solarsystemsiminside your~/.config/directory:mkdir -p ~/.config/solarsystemsim - Windows: Create a folder named
solarsystemsiminside your user home directory's.configfolder:mkdir %USERPROFILE%\.config\solarsystemsim
For your convenience, we provide scripts to automatically set up the configuration directory:
- Linux/macOS: Run the
autoconfig.shscript:./autoconfig.sh - Windows: Run the
autoconfig.batscript:./autoconfig.bat
These scripts will create the necessary directory structure and copy the example configuration files for you.
You need two main configuration files:
- setup.properties: Contains general simulator settings
- system.properties: (or any other name specified in setup.properties) Defines celestial bodies and their properties
- Copy the example configuration files from the project directory:
cp example_setup.properties ~/.config/solarsystemsim/setup.properties cp example_system.properties ~/.config/solarsystemsim/system.properties - Edit these files to customize the simulation. Note that the simulation assumes that a consistent set of units is used throughout the system setup file. For example, if using kg-m-s, be sure to give every value in terms of these.
You can also use our Python script to automatically generate system configuration files:
- Located in
resources/autogen.py - This script can generate configuration files with various celestial systems
- Run the script and follow the prompts to create custom system configurations
When you start the program, the view will automatically encompass every one of your bodies. To rotate the view, click and drag on the screen. To zoom in or out, you can use the scroll wheel. Alternatively, these keybindings can be used:
-
W: Tilt view up
-
S: Tilt view down
-
A: Rotate view left
-
D: Rotate view right
-
J: Zoom in
-
K: Zoom out
To increase or decrease the virtual timescale, use the following keybindings:
- Q: Slow down time
- E: Speed up time
To toggle the center of the view between different bodies, use these keybindings:
- H: Go to previous body
- L: Go to next body
Finally, these keybinding can be used for other functions:
- F1: Reset viewing angle and zoom
- F2: Toggle whether to view planet sizes to scale with distance or on a log scale
- F3: Toggle whether to show extra info on screen
- Escape: Close the application
Here's what the simulator looks like in action:

