You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
\Delta r = \lim_{\Delta t \to 0} \sum^n_{i=1}v_i\Delta t_i \\
43
+
\Delta r = \int^{t_1}_{t_0} v(t)dt \\
44
+
\end{align}
45
+
$$
46
+
38
47
Now when we have current velocity, we need the way of shift precise calculation.
39
48
The most obvious way is to use Euler's integration, but then we'll face an issue, that this way is highly dependent on
40
49
simulation's refresh rate and ∆t between ticks. Fortunately, there's plenty of methods we can use instead.
41
50
I've used [leapfrog algorithm](https://en.wikipedia.org/wiki/Leapfrog_integration).
42
51
43
-
### How it works?
44
-
45
-
46
-
47
52
## Code logic
48
53
49
54
- Universe - singleton class, that's capable of most calculations and kinetics acceleration
50
55
- Kinetic - object that has physical parameters, such as mass, acceleration and velocity. It's also used in visualization, converting own parameters to display self in pygame window. Also it can break into fragments if the external forces are much greater than it's own gravity.
51
56
- Spawner can be added into unifile. Spawnables must contain no parameters in constructor.
52
57
- Universe Utils file specifies global mathematical operations, such as distance calculating, force between two kinetics and universe-to-display convertations
53
-
- Simulation - controls tickrate and Universe update rate. Parameters can be tweaked to achieve different simulation speed.
54
-
55
-
Universe yses leapfrog integration for kinetic position and velocity calculations.
56
-
57
-
> Graphics and visuals will be added soon
58
+
- Simulation - controls tick rate and Universe update rate. Parameters can be tweaked to achieve different simulation speed.
58
59
59
60
## Installing
60
61
61
62
1. Fetch the dependencies. `pip install -e .`
62
-
2. Optionally install jupiter
63
+
2. Optionally install Jupiter and Notebook with `pip install jupiter notebook`
63
64
64
65
## Usage
65
66
@@ -79,12 +80,14 @@ Asteriod spawn params can be changed inside kinetic module in `AsteroidSpawner`
79
80
80
81
Simply run `python src/main.py` to launch your `unifile.py` simulation
81
82
82
-
## Testing
83
+
### 3. Testing
83
84
84
85
Jupiter notebook contains some basic computing and graphic plotting. It shows orbit parameters, speed and energy drift of a kinetic object.
85
86
86
-
> Currently there's no unit tests. Even basic. This must be changed asap
87
-
88
87
Codestyle checks are performed with `pylint`, simply run `pylint src`
0 commit comments