https://github.com/fraya/dylan-nbody
N body problem written in Open dylan
https://github.com/fraya/dylan-nbody
Last synced: 3 months ago
JSON representation
N body problem written in Open dylan
- Host: GitHub
- URL: https://github.com/fraya/dylan-nbody
- Owner: fraya
- License: gpl-3.0
- Created: 2023-07-12T20:56:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T05:34:53.000Z (over 2 years ago)
- Last Synced: 2024-01-18T10:56:01.298Z (over 2 years ago)
- Language: Dylan
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dylan-nbody
N body problem written in Open dylan
This code is a test vehicle for my vector library
[v3d](http://github.com/fraya/v3d) and is **NOT performance driven**.
For a competitive example see
[shootout/n-body.dylan](https://github.com/dylan-lang/shootout/blob/master/n-body.dylan).
## Usage
Clone the repository:
git clone http://github.com/fraya/dylan-nbody
Enter in the directory created and update dependencies:
dylan update
Compile the program:
dylan build dylan-nbody-app
Execute the program in directory `../_build/bin`, passing the
number of steps to simulate, for instance `1000000`:
dylan-nbody-app --steps 1000000
The output is:
-0.1690752d0
-0.1690862d0
# Sequence diagram
The following sequence diagram shows the execution of the main
program.
```mermaid
sequenceDiagram
participant User
participant System
User->>System: offset-momentum!(zero)
User->>System: energy
loop steps
User->>System: advance!(delta)
end
User->>System: energy
```