CW-DoublePendulum 0.2.5__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CWDoublePendulum/manualRun.py +3 -0
- CWDoublePendulum/sim.py +7 -5
- cw_doublependulum-0.3.1.dist-info/METADATA +39 -0
- cw_doublependulum-0.3.1.dist-info/RECORD +9 -0
- cw_doublependulum-0.2.5.dist-info/METADATA +0 -20
- cw_doublependulum-0.2.5.dist-info/RECORD +0 -8
- {cw_doublependulum-0.2.5.dist-info → cw_doublependulum-0.3.1.dist-info}/WHEEL +0 -0
- {cw_doublependulum-0.2.5.dist-info → cw_doublependulum-0.3.1.dist-info}/entry_points.txt +0 -0
- {cw_doublependulum-0.2.5.dist-info → cw_doublependulum-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {cw_doublependulum-0.2.5.dist-info → cw_doublependulum-0.3.1.dist-info}/top_level.txt +0 -0
CWDoublePendulum/sim.py
CHANGED
@@ -9,6 +9,9 @@ def runSim():
|
|
9
9
|
import time
|
10
10
|
import csv
|
11
11
|
import hashlib
|
12
|
+
import importlib.resources
|
13
|
+
import CWDoublePendulum
|
14
|
+
|
12
15
|
|
13
16
|
# Initial parameters (all can be modified with sliders)
|
14
17
|
l1 = 1.0
|
@@ -182,7 +185,7 @@ def runSim():
|
|
182
185
|
|
183
186
|
return line, mass1, mass2, trail1, trail2
|
184
187
|
|
185
|
-
ani = FuncAnimation(fig, update, init_func=init, blit=True, interval=20)
|
188
|
+
ani = FuncAnimation(fig, update, init_func=init, blit=True, interval=20, cache_frame_data=False)
|
186
189
|
|
187
190
|
# -------------------- LAYOUT ARRANGEMENT --------------------
|
188
191
|
axcolor = 'lightgoldenrodyellow'
|
@@ -374,7 +377,8 @@ def runSim():
|
|
374
377
|
result = np.round(state, decimals=6)
|
375
378
|
resultStr = ','.join(map(str, result))
|
376
379
|
hashDigest = hashlib.sha256(resultStr.encode()).hexdigest()
|
377
|
-
|
380
|
+
with importlib.resources.files(CWDoublePendulum).joinpath("testHash.txt").open("r") as f:
|
381
|
+
testHash = f.read().strip()
|
378
382
|
if hashDigest != testHash:
|
379
383
|
print("Test failed! Please re-download source code")
|
380
384
|
else:
|
@@ -383,6 +387,4 @@ def runSim():
|
|
383
387
|
|
384
388
|
testButton.on_clicked(runVerification)
|
385
389
|
|
386
|
-
plt.show()
|
387
|
-
|
388
|
-
runSim()
|
390
|
+
plt.show()
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: CW-DoublePendulum
|
3
|
+
Version: 0.3.1
|
4
|
+
Summary: A Python package that uses NumPy and Matplotlib to simulate an interactive double pendulum.
|
5
|
+
Author-email: Chase Worsley <worsleychase@gmail.com>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/Worsleychase/InteractiveDoublePendulum
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Operating System :: OS Independent
|
11
|
+
Requires-Python: >=3.9
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
License-File: LICENSE
|
14
|
+
Requires-Dist: numpy
|
15
|
+
Requires-Dist: matplotlib
|
16
|
+
Dynamic: license-file
|
17
|
+
|
18
|
+
# Interactive Double Pendulum
|
19
|
+
|
20
|
+
An interactive double pendulum simulator built with Python and Matplotlib.
|
21
|
+
This tool visualizes the chaotic motion of a double pendulum and allows real-time parameter tuning, trail visualization, and data collection.
|
22
|
+
|
23
|
+
## Features
|
24
|
+
|
25
|
+
- Adjustable parameters: masses, lengths, gravity, and time step via sliders.
|
26
|
+
- Real-time animation with pause, reset, and trail toggles.
|
27
|
+
- Data collection and export to CSV for further analysis.
|
28
|
+
- Built-in verification test to check simulation correctness.
|
29
|
+
- Minimal dependencies: just `numpy` and `matplotlib`.
|
30
|
+
|
31
|
+
## Installation
|
32
|
+
|
33
|
+
Install directly from PyPI:
|
34
|
+
|
35
|
+
```bash
|
36
|
+
pip install CW-DoublePendulum
|
37
|
+
```
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
CWDoublePendulum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
CWDoublePendulum/manualRun.py,sha256=6r2-FnS7fmeATN6BcRlqprtvQmg-uIydXLp9tqpCUTo,26
|
3
|
+
CWDoublePendulum/sim.py,sha256=2Aohzil00IXh-Bf313GxYHD-hH_AaxTErCi6EjSnyig,14584
|
4
|
+
cw_doublependulum-0.3.1.dist-info/licenses/LICENSE,sha256=P_M8rIY4EFOQArRFqXCsxqdZyDp2kUCszxsaDapqA_4,1090
|
5
|
+
cw_doublependulum-0.3.1.dist-info/METADATA,sha256=W-bmyUqWOcOYabNZNSv8DcCwqvYyVHf30zF_5hhQaTE,1317
|
6
|
+
cw_doublependulum-0.3.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
7
|
+
cw_doublependulum-0.3.1.dist-info/entry_points.txt,sha256=bl8GVAAafizZ1OprX6HOmfdP0pcJRYjsAEeKdxMTCiw,65
|
8
|
+
cw_doublependulum-0.3.1.dist-info/top_level.txt,sha256=getQFdsFpgw4puZJPD_uM4uFaD_ltaEzamsq6zcL4dM,17
|
9
|
+
cw_doublependulum-0.3.1.dist-info/RECORD,,
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: CW-DoublePendulum
|
3
|
-
Version: 0.2.5
|
4
|
-
Summary: A Python package that uses NumPy and Matplotlib to simulate an interactive double pendulum.
|
5
|
-
Author-email: Chase Worsley <your_email@example.com>
|
6
|
-
License: MIT
|
7
|
-
Project-URL: Homepage, https://github.com/Worsleychase/InteractiveDoublePendulum
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
10
|
-
Classifier: Operating System :: OS Independent
|
11
|
-
Requires-Python: >=3.9
|
12
|
-
Description-Content-Type: text/markdown
|
13
|
-
License-File: LICENSE
|
14
|
-
Requires-Dist: numpy
|
15
|
-
Requires-Dist: matplotlib
|
16
|
-
Dynamic: license-file
|
17
|
-
|
18
|
-
# Interactive Double Pendulum
|
19
|
-
|
20
|
-
Final project for Mathematical & Computational Physics II
|
@@ -1,8 +0,0 @@
|
|
1
|
-
CWDoublePendulum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
CWDoublePendulum/sim.py,sha256=GDD1ejnYcsHtjq4ch-1IRFyKmOHRmZ1BkDvpJMsP6tU,14427
|
3
|
-
cw_doublependulum-0.2.5.dist-info/licenses/LICENSE,sha256=P_M8rIY4EFOQArRFqXCsxqdZyDp2kUCszxsaDapqA_4,1090
|
4
|
-
cw_doublependulum-0.2.5.dist-info/METADATA,sha256=4If72UshdNQOEWgXoygA2vsc4RuHxBO1XsOvA6uwIwc,719
|
5
|
-
cw_doublependulum-0.2.5.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
6
|
-
cw_doublependulum-0.2.5.dist-info/entry_points.txt,sha256=bl8GVAAafizZ1OprX6HOmfdP0pcJRYjsAEeKdxMTCiw,65
|
7
|
-
cw_doublependulum-0.2.5.dist-info/top_level.txt,sha256=getQFdsFpgw4puZJPD_uM4uFaD_ltaEzamsq6zcL4dM,17
|
8
|
-
cw_doublependulum-0.2.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|