Command line¶
Installing the package adds the command nbody. python -m celestial_rhapsody
does the same thing.
nbody run¶
Simulate a system and save an animation.
nbody run INPUT [-o OUTPUT] [--method {euler,rk2,rk4}] [--every N]
[--fps N] [--trail N] [--dt X] [--final-time T]
Option |
Description |
|---|---|
|
Input file, |
|
Output file, |
|
Integrator: |
|
Keep one frame every |
|
Frames per second (default |
|
Trail length in frames. Default is the full path; |
|
Override |
|
Override |
Examples:
nbody run system.json # -> system.gif
nbody run system.json -o movie.mp4 --fps 60 # needs ffmpeg
nbody run system.json --final-time 1 --every 1 # quick preview
nbody run system.json --trail 40 # short comet-like trails
nbody check¶
Validate an input file and print a one-line summary, without simulating.
nbody check system.json
Exit codes¶
The command exits with 0 on success and 1 on any error (missing file,
invalid input, unsupported output). This makes it easy to use in shell scripts.