CW-DoublePendulum 0.2.4__py3-none-any.whl → 0.2.5__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/sim.py +10 -8
- {cw_doublependulum-0.2.4.dist-info → cw_doublependulum-0.2.5.dist-info}/METADATA +1 -1
- cw_doublependulum-0.2.5.dist-info/RECORD +8 -0
- cw_doublependulum-0.2.4.dist-info/RECORD +0 -8
- {cw_doublependulum-0.2.4.dist-info → cw_doublependulum-0.2.5.dist-info}/WHEEL +0 -0
- {cw_doublependulum-0.2.4.dist-info → cw_doublependulum-0.2.5.dist-info}/entry_points.txt +0 -0
- {cw_doublependulum-0.2.4.dist-info → cw_doublependulum-0.2.5.dist-info}/licenses/LICENSE +0 -0
- {cw_doublependulum-0.2.4.dist-info → cw_doublependulum-0.2.5.dist-info}/top_level.txt +0 -0
CWDoublePendulum/sim.py
CHANGED
@@ -114,7 +114,7 @@ def runSim():
|
|
114
114
|
return line, mass1, mass2, trail1, trail2
|
115
115
|
|
116
116
|
def update(frame):
|
117
|
-
|
117
|
+
nonlocal collectedData
|
118
118
|
|
119
119
|
if animationRunning:
|
120
120
|
step()
|
@@ -232,7 +232,7 @@ def runSim():
|
|
232
232
|
|
233
233
|
# -------------------- CALLBACKS -------------------- be careful >:(
|
234
234
|
def updateSliders(val):
|
235
|
-
|
235
|
+
nonlocal m1, m2, l1, l2, g, dt
|
236
236
|
if not collectingData: # Only allow changes when not collecting data
|
237
237
|
m1 = sliderM1.val
|
238
238
|
m2 = sliderM2.val
|
@@ -258,7 +258,7 @@ def runSim():
|
|
258
258
|
sliderDt.on_changed(updateSliders)
|
259
259
|
|
260
260
|
def toggleTrace(label):
|
261
|
-
|
261
|
+
nonlocal showTrace1, showTrace2
|
262
262
|
if label == 'Trail 1':
|
263
263
|
showTrace1 = not showTrace1
|
264
264
|
if not showTrace1:
|
@@ -271,7 +271,7 @@ def runSim():
|
|
271
271
|
check.on_clicked(toggleTrace)
|
272
272
|
|
273
273
|
def reset(event):
|
274
|
-
|
274
|
+
nonlocal state, trailSegments1, trailSegments2
|
275
275
|
if not collectingData: # Only reset when not collecting data dummy
|
276
276
|
state = np.array([np.pi / 2, 0, np.pi / 2, 0], dtype=float)
|
277
277
|
trailSegments1.clear()
|
@@ -282,14 +282,14 @@ def runSim():
|
|
282
282
|
resetButton.on_clicked(reset)
|
283
283
|
|
284
284
|
def toggleAnimation(event):
|
285
|
-
|
285
|
+
nonlocal animationRunning
|
286
286
|
animationRunning = not animationRunning
|
287
287
|
pauseButton.label.set_text('Play' if not animationRunning else 'Pause')
|
288
288
|
|
289
289
|
pauseButton.on_clicked(toggleAnimation)
|
290
290
|
|
291
291
|
def toggleDataCollection(event):
|
292
|
-
|
292
|
+
nonlocal collectingData, collectedData
|
293
293
|
|
294
294
|
collectingData = not collectingData
|
295
295
|
|
@@ -359,7 +359,7 @@ def runSim():
|
|
359
359
|
|
360
360
|
def runVerification(event):
|
361
361
|
# Set fixed values
|
362
|
-
|
362
|
+
nonlocal l1, l2, m1, m2, g, dt, state
|
363
363
|
l1, l2 = 1.0, 1.0
|
364
364
|
m1, m2 = 1.0, 1.0
|
365
365
|
g = 9.81
|
@@ -383,4 +383,6 @@ def runSim():
|
|
383
383
|
|
384
384
|
testButton.on_clicked(runVerification)
|
385
385
|
|
386
|
-
plt.show()
|
386
|
+
plt.show()
|
387
|
+
|
388
|
+
runSim()
|
@@ -0,0 +1,8 @@
|
|
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,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
CWDoublePendulum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
CWDoublePendulum/sim.py,sha256=qu794i7iJXQMofWJ57lnQwx56qpVDDyvnA39H5-TVwo,14401
|
3
|
-
cw_doublependulum-0.2.4.dist-info/licenses/LICENSE,sha256=P_M8rIY4EFOQArRFqXCsxqdZyDp2kUCszxsaDapqA_4,1090
|
4
|
-
cw_doublependulum-0.2.4.dist-info/METADATA,sha256=LhC4un6mWy5bSCTvHvsEHqFhVDn2Oz0BtbY3g5BVFE8,719
|
5
|
-
cw_doublependulum-0.2.4.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
6
|
-
cw_doublependulum-0.2.4.dist-info/entry_points.txt,sha256=bl8GVAAafizZ1OprX6HOmfdP0pcJRYjsAEeKdxMTCiw,65
|
7
|
-
cw_doublependulum-0.2.4.dist-info/top_level.txt,sha256=getQFdsFpgw4puZJPD_uM4uFaD_ltaEzamsq6zcL4dM,17
|
8
|
-
cw_doublependulum-0.2.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|