SourajaKundu123 commited on
Commit
e41f7b0
·
verified ·
1 Parent(s): 9a4729d

Upload folder using huggingface_hub (part 14)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. scipy/simple_pendulum/093/video.mp4 +3 -0
  2. scipy/simple_pendulum/124/cot.json +91 -0
  3. scipy/simple_pendulum/124/params.json +10 -0
  4. scipy/simple_pendulum/124/simulation_code.py +64 -0
  5. scipy/simple_pendulum/124/video.mp4 +3 -0
  6. scipy/simple_pendulum/166/cot.json +91 -0
  7. scipy/simple_pendulum/166/params.json +10 -0
  8. scipy/simple_pendulum/166/simulation_code.py +64 -0
  9. scipy/simple_pendulum/166/video.mp4 +3 -0
  10. scipy/simple_pendulum/172/cot.json +91 -0
  11. scipy/simple_pendulum/172/params.json +10 -0
  12. scipy/simple_pendulum/172/simulation_code.py +64 -0
  13. scipy/simple_pendulum/172/video.mp4 +3 -0
  14. scipy/simple_pendulum/194/cot.json +91 -0
  15. scipy/simple_pendulum/194/params.json +10 -0
  16. scipy/simple_pendulum/194/simulation_code.py +64 -0
  17. scipy/simple_pendulum/194/video.mp4 +3 -0
  18. scipy/simple_pendulum/230/cot.json +91 -0
  19. scipy/simple_pendulum/230/params.json +10 -0
  20. scipy/simple_pendulum/230/simulation_code.py +64 -0
  21. scipy/simple_pendulum/230/video.mp4 +3 -0
  22. scipy/simple_pendulum/237/cot.json +91 -0
  23. scipy/simple_pendulum/237/params.json +10 -0
  24. scipy/simple_pendulum/237/simulation_code.py +64 -0
  25. scipy/simple_pendulum/237/video.mp4 +3 -0
  26. scipy/simple_pendulum/253/cot.json +91 -0
  27. scipy/simple_pendulum/253/params.json +10 -0
  28. scipy/simple_pendulum/253/simulation_code.py +64 -0
  29. scipy/simple_pendulum/253/video.mp4 +3 -0
  30. scipy/simple_pendulum/291/cot.json +91 -0
  31. scipy/simple_pendulum/291/params.json +10 -0
  32. scipy/simple_pendulum/291/simulation_code.py +64 -0
  33. scipy/simple_pendulum/291/video.mp4 +3 -0
  34. scipy/simple_pendulum/312/cot.json +91 -0
  35. scipy/simple_pendulum/312/params.json +10 -0
  36. scipy/simple_pendulum/312/simulation_code.py +64 -0
  37. scipy/simple_pendulum/312/video.mp4 +3 -0
  38. scipy/simple_pendulum/342/cot.json +91 -0
  39. scipy/simple_pendulum/342/params.json +10 -0
  40. scipy/simple_pendulum/342/simulation_code.py +64 -0
  41. scipy/simple_pendulum/342/video.mp4 +3 -0
  42. scipy/simple_pendulum/384/cot.json +91 -0
  43. scipy/simple_pendulum/384/params.json +10 -0
  44. scipy/simple_pendulum/384/simulation_code.py +64 -0
  45. scipy/simple_pendulum/384/video.mp4 +3 -0
  46. scipy/simple_pendulum/435/cot.json +91 -0
  47. scipy/simple_pendulum/435/params.json +10 -0
  48. scipy/simple_pendulum/435/simulation_code.py +64 -0
  49. scipy/simple_pendulum/435/video.mp4 +3 -0
  50. scipy/simple_pendulum/451/cot.json +91 -0
scipy/simple_pendulum/093/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6581091f3eba41a77eddd9aefd41801ad6a4747ff8e3e7ebd346dfd4954ec124
3
+ size 18457
scipy/simple_pendulum/124/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.160 kg) swings on a rigid rod (L=1.833 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.317 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.717 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0176 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.8329999996219075,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.1597203451890215,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.3168662072282229,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -1.1089314525626406,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -1.1340552704445384,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/124/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.8329999996219075,
3
+ "m": 1.1597203451890215,
4
+ "g": 9.8,
5
+ "b": 0.3168662072282229,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -1.1089314525626406,
9
+ "omega0": -1.1340552704445384
10
+ }
scipy/simple_pendulum/124/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.8329999996219075
12
+ m = 1.1597203451890215
13
+ g = 9.8
14
+ b = 0.3168662072282229
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -1.108931
18
+ omega0 = -1.134055
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/124/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd070760cbc286abe87f584fb294bb1d138f6958e09c6df7a1c3670bac825b11
3
+ size 20239
scipy/simple_pendulum/166/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=2.268 kg) swings on a rigid rod (L=0.945 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.354 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 1.951 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0272 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 0.9445214222595294,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 2.2680322714152794,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.3542802301140774,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.7475111368830135,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 0.3863347480043964,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/166/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 0.9445214222595294,
3
+ "m": 2.2680322714152794,
4
+ "g": 9.8,
5
+ "b": 0.3542802301140774,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.7475111368830135,
9
+ "omega0": 0.3863347480043964
10
+ }
scipy/simple_pendulum/166/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 0.9445214222595294
12
+ m = 2.2680322714152794
13
+ g = 9.8
14
+ b = 0.3542802301140774
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.747511
18
+ omega0 = 0.386335
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/166/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fcf8ea7d1e7c1f6360b133789778118f2cfe228f434bfd69b662de1a07eab501
3
+ size 18404
scipy/simple_pendulum/172/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=0.559 kg) swings on a rigid rod (L=0.601 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.767 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 1.556 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.4705 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 0.6013621759061185,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 0.5585668445268679,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.7674040909680111,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": 0.9731495666549164,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 1.1875933991542498,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/172/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 0.6013621759061185,
3
+ "m": 0.5585668445268679,
4
+ "g": 9.8,
5
+ "b": 0.7674040909680111,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": 0.9731495666549164,
9
+ "omega0": 1.1875933991542498
10
+ }
scipy/simple_pendulum/172/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 0.6013621759061185
12
+ m = 0.5585668445268679
13
+ g = 9.8
14
+ b = 0.7674040909680111
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = 0.973150
18
+ omega0 = 1.187593
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/172/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f8ea047e51a53b2f43878dd8f77f3006d84f65ec7c1bc5da4324c803072fcaf
3
+ size 7876
scipy/simple_pendulum/194/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=2.130 kg) swings on a rigid rod (L=0.415 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.527 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 1.293 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.1480 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 0.41488344817326833,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 2.1296002786531414,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.5274503698207139,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.9065253975301019,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 0.1729949534358286,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/194/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 0.41488344817326833,
3
+ "m": 2.1296002786531414,
4
+ "g": 9.8,
5
+ "b": 0.5274503698207139,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.9065253975301019,
9
+ "omega0": 0.1729949534358286
10
+ }
scipy/simple_pendulum/194/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 0.41488344817326833
12
+ m = 2.1296002786531414
13
+ g = 9.8
14
+ b = 0.5274503698207139
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.906525
18
+ omega0 = 0.172995
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/194/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6461946ee3673769ba2ea399907a7bf92a5b191e8b2544866286042f83ad8cd3
3
+ size 11218
scipy/simple_pendulum/230/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.233 kg) swings on a rigid rod (L=0.629 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.166 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 1.591 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0433 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 0.6286572038019055,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.2325747307848998,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.1664965190797424,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": 0.7905132115576572,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -1.4547450691880077,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/230/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 0.6286572038019055,
3
+ "m": 1.2325747307848998,
4
+ "g": 9.8,
5
+ "b": 0.1664965190797424,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": 0.7905132115576572,
9
+ "omega0": -1.4547450691880077
10
+ }
scipy/simple_pendulum/230/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 0.6286572038019055
12
+ m = 1.2325747307848998
13
+ g = 9.8
14
+ b = 0.1664965190797424
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = 0.790513
18
+ omega0 = -1.454745
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/230/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7065e2052b956e85495abf07ba1e3f79027497f264a16b270463f8ce5c630af
3
+ size 18306
scipy/simple_pendulum/237/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.638 kg) swings on a rigid rod (L=1.169 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.462 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.170 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0356 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.16861925009374,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.6379829709013396,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.46159094158599534,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": 0.2805122442187755,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 1.7872493033509262,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/237/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.16861925009374,
3
+ "m": 1.6379829709013396,
4
+ "g": 9.8,
5
+ "b": 0.46159094158599534,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": 0.2805122442187755,
9
+ "omega0": 1.7872493033509262
10
+ }
scipy/simple_pendulum/237/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.16861925009374
12
+ m = 1.6379829709013396
13
+ g = 9.8
14
+ b = 0.46159094158599534
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = 0.280512
18
+ omega0 = 1.787249
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/237/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:38f89c098896dbbb8f6e6414ef7f7f574fcb3d2ef19f9d7b481a9661d162fda0
3
+ size 16964
scipy/simple_pendulum/253/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=2.326 kg) swings on a rigid rod (L=1.278 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.183 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.269 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0087 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.2781632002220964,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 2.3264372822788344,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.1829715228971649,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.2523547013977694,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 0.5221641548467515,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/253/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.2781632002220964,
3
+ "m": 2.3264372822788344,
4
+ "g": 9.8,
5
+ "b": 0.1829715228971649,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.2523547013977694,
9
+ "omega0": 0.5221641548467515
10
+ }
scipy/simple_pendulum/253/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.2781632002220964
12
+ m = 2.3264372822788344
13
+ g = 9.8
14
+ b = 0.1829715228971649
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.252355
18
+ omega0 = 0.522164
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/253/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4e5baeba6c477bfa41d4f31cb379d81d694ff56195de55b2a2898791ec3bf3e
3
+ size 13336
scipy/simple_pendulum/291/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.354 kg) swings on a rigid rod (L=1.985 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.546 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.828 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0230 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.985317149343413,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.3543539575820556,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.5459261597934555,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.9893118272453896,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -1.1517172650095255,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/291/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.985317149343413,
3
+ "m": 1.3543539575820556,
4
+ "g": 9.8,
5
+ "b": 0.5459261597934555,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.9893118272453896,
9
+ "omega0": -1.1517172650095255
10
+ }
scipy/simple_pendulum/291/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.985317149343413
12
+ m = 1.3543539575820556
13
+ g = 9.8
14
+ b = 0.5459261597934555
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.989312
18
+ omega0 = -1.151717
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/291/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c1877b6c31a8714f40aa1bceabbb1fd9eb992cdb1d357f3f76a7f9f1dd42bb0f
3
+ size 19491
scipy/simple_pendulum/312/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.154 kg) swings on a rigid rod (L=1.085 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.823 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.091 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.1007 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.0849505187077768,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.1541228656471134,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.8225973156956716,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.7673190158807073,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 0.8856744423875038,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/312/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.0849505187077768,
3
+ "m": 1.1541228656471134,
4
+ "g": 9.8,
5
+ "b": 0.8225973156956716,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.7673190158807073,
9
+ "omega0": 0.8856744423875038
10
+ }
scipy/simple_pendulum/312/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.0849505187077768
12
+ m = 1.1541228656471134
13
+ g = 9.8
14
+ b = 0.8225973156956716
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.767319
18
+ omega0 = 0.885674
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/312/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c55068076d8b65b93a537ba5e9f5e1a9592906ae38b00f1d46ea6afdae33a8c
3
+ size 14164
scipy/simple_pendulum/342/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.881 kg) swings on a rigid rod (L=1.322 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.483 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.308 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0270 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.322259956741556,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.8812506757161336,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.48291024558609186,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": 0.42691573272259875,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": 0.865603536370211,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/342/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.322259956741556,
3
+ "m": 1.8812506757161336,
4
+ "g": 9.8,
5
+ "b": 0.48291024558609186,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": 0.42691573272259875,
9
+ "omega0": 0.865603536370211
10
+ }
scipy/simple_pendulum/342/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.322259956741556
12
+ m = 1.8812506757161336
13
+ g = 9.8
14
+ b = 0.48291024558609186
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = 0.426916
18
+ omega0 = 0.865604
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/342/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6adb64557ea3c0db317104cf830f5556840b6ee2b3440d1ca315cb65f61f9cc1
3
+ size 15322
scipy/simple_pendulum/384/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.943 kg) swings on a rigid rod (L=1.358 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.904 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.339 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0470 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.3577866152812446,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.9426225871701344,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.9043079134505962,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.14241045052608903,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -1.453082425551408,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/384/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.3577866152812446,
3
+ "m": 1.9426225871701344,
4
+ "g": 9.8,
5
+ "b": 0.9043079134505962,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": -0.14241045052608903,
9
+ "omega0": -1.453082425551408
10
+ }
scipy/simple_pendulum/384/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.3577866152812446
12
+ m = 1.9426225871701344
13
+ g = 9.8
14
+ b = 0.9043079134505962
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = -0.142410
18
+ omega0 = -1.453082
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/384/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6013669824d7d62de9e64ec05b465fed69306317da0635cc3d643be54ae5199e
3
+ size 14543
scipy/simple_pendulum/435/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=1.365 kg) swings on a rigid rod (L=1.598 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.136 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.538 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0078 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.5984920446864335,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 1.3652568151447508,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.13552422115173968,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": 0.9607950584411478,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -1.086853161978845,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }
scipy/simple_pendulum/435/params.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "L": 1.5984920446864335,
3
+ "m": 1.3652568151447508,
4
+ "g": 9.8,
5
+ "b": 0.13552422115173968,
6
+ "A": 0.0,
7
+ "k_freq": 0.0,
8
+ "theta0": 0.9607950584411478,
9
+ "omega0": -1.086853161978845
10
+ }
scipy/simple_pendulum/435/simulation_code.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Simple Pendulum — auto-generated simulation script.
3
+ Physics: θ̈ = -(g/L)·sin(θ) - (b/mL²)·ω + (A/mL²)·cos(k_freq·t)
4
+ """
5
+ import numpy as np
6
+ from scipy.integrate import solve_ivp
7
+ import matplotlib.pyplot as plt
8
+ import matplotlib.animation as animation
9
+
10
+
11
+ L = 1.5984920446864335
12
+ m = 1.3652568151447508
13
+ g = 9.8
14
+ b = 0.13552422115173968
15
+ A = 0.0
16
+ k_freq = 0.0
17
+ theta0 = 0.960795
18
+ omega0 = -1.086853
19
+ duration = 12
20
+
21
+
22
+ def ode(t, y):
23
+ theta, omega = y
24
+ mlsq = m * L * L
25
+ dtheta = omega
26
+ domega = -(g / L) * np.sin(theta) - (b / mlsq) * omega + (A / mlsq) * np.cos(k_freq * t)
27
+ return [dtheta, domega]
28
+
29
+
30
+ fps = 30
31
+ t_eval = np.linspace(0, duration, int(duration * fps) + 1)
32
+ sol = solve_ivp(ode, (0, duration), [theta0, omega0],
33
+ t_eval=t_eval, method="RK45", rtol=1e-9, atol=1e-11)
34
+ t, theta = sol.t, sol.y[0]
35
+
36
+ bob_x = L * np.sin(theta)
37
+ bob_y = -L * np.cos(theta)
38
+
39
+
40
+ pad = L * 0.35
41
+ fig, ax = plt.subplots(figsize=(5, 5), facecolor="#1a1a2e")
42
+ ax.set_facecolor("#16213e")
43
+ ax.set_xlim(-L - pad, L + pad); ax.set_ylim(-L - pad, L * 0.4)
44
+ ax.set_aspect("equal"); ax.axis("off")
45
+ ax.plot([0], [0], "o", color="white", ms=7, zorder=5)
46
+
47
+ rod, = ax.plot([], [], "-", color="#a8dadc", lw=2.5, zorder=3)
48
+ bob_p, = ax.plot([], [], "o", color="#e63946", ms=14, zorder=4)
49
+ trail, = ax.plot([], [], "-", color="#e63946", alpha=0.35, lw=1.2, zorder=2)
50
+ tx, ty = [], []
51
+
52
+ def update(frame):
53
+ rod.set_data([0, bob_x[frame]], [0, bob_y[frame]])
54
+ bob_p.set_data([bob_x[frame]], [bob_y[frame]])
55
+ tx.append(bob_x[frame]); ty.append(bob_y[frame])
56
+ if len(tx) > 90: tx.pop(0); ty.pop(0)
57
+ trail.set_data(tx, ty)
58
+ return rod, bob_p, trail
59
+
60
+ ani = animation.FuncAnimation(fig, update, frames=len(t), interval=1000/fps, blit=True)
61
+ writer = animation.FFMpegWriter(fps=fps, bitrate=1800)
62
+ ani.save("simple_pendulum.mp4", writer=writer, dpi=120)
63
+ plt.close()
64
+ print("Saved simple_pendulum.mp4")
scipy/simple_pendulum/435/video.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd4b49b86cf89b81bf9d602876878cc18a31dd8205391bf9015cb299a09bbe4c
3
+ size 21135
scipy/simple_pendulum/451/cot.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "simulation": "simple_pendulum",
3
+ "physical_observation": "A point mass (m=0.847 kg) swings on a rigid rod (L=1.310 m) from a fixed pivot. The oscillation amplitude decays due to damping (b=0.467 kg \\cdot m^2/s).",
4
+ "physical_law": {
5
+ "name": "Newton's Second Law for Rotational Motion (\\tau = I\\alpha)",
6
+ "statement": "The net torque on a body about a fixed axis equals the moment of inertia times the angular acceleration.",
7
+ "formula": "I\\ddot{\\theta} = \\Sigma\\tau \\rightarrow mL^2\\ddot{\\theta} = -mgL \\sin(\\theta) - b\\dot{\\theta}"
8
+ },
9
+ "ode_system": {
10
+ "state_variables": [
11
+ "\\theta (angle, rad)",
12
+ "\\omega = \\dot{\\theta} (angular velocity, rad/s)"
13
+ ],
14
+ "equations_latex": [
15
+ "\\dot{\\theta} = \\omega",
16
+ "\\dot{\\omega} = -(g/L) \\sin(\\theta) - (b/(mL^2)) \\omega"
17
+ ],
18
+ "equations_python": [
19
+ "theta_dot = omega",
20
+ "omega_dot = -(g/L) * np.sin ( theta ) - (b/(mL**2)) * omega"
21
+ ]
22
+ },
23
+ "derivation_steps": [
24
+ "Identify the generalized coordinate: \\theta = angle of the rod from the downward vertical.",
25
+ "Moment of inertia for a point mass at distance L from the pivot: I = m L^2.",
26
+ "Torques about the pivot:",
27
+ " \\tau_gravity = -m g L \\sin(\\theta) [restoring, acts opposite to displacement]",
28
+ " \\tau_damping = -b \\dot{\\theta} [b has units kg \\cdot m^2/s; opposes angular velocity]",
29
+ " \\tau_drive = 0 [undriven system]",
30
+ "Newton's second law for rotation: I \\ddot{\\theta} = \\Sigma\\tau",
31
+ " m L^2 \\ddot{\\theta} = -m g L \\sin(\\theta) - b \\dot{\\theta}",
32
+ "Divide by m L^2 to obtain the state-space form:",
33
+ " \\ddot{\\theta} = -(g/L) \\sin(\\theta) - (b/mL^2) \\dot{\\theta}"
34
+ ],
35
+ "numerical_method": {
36
+ "solver": "RK45 (Dormand-Prince, 4th/5th order Runge-Kutta)",
37
+ "tolerance": "rtol=1e-9, atol=1e-11",
38
+ "justification": "Matches the 4th-order Runge-Kutta solver used in myphysicslab TypeScript source."
39
+ },
40
+ "code_validation": {
41
+ "ode_source": "Newton's 2nd law for rotation; exact translation of PendulumSim.ts evaluate()",
42
+ "energy_check": "Total energy E = \\tfrac{1}{2} mL^2\\omega^2 + mgL(1-\\cos(\\theta)) should decrease monotonically when b>0",
43
+ "physical_plausibility": true
44
+ },
45
+ "expected_behavior": [
46
+ "Natural period (small angles): T_0 \\approx 2.297 s",
47
+ "Damping ratio \\zeta = b/(2mL^2\\omega_0) = 0.0587 < 1 \\rightarrow underdamped oscillation"
48
+ ],
49
+ "parameters": {
50
+ "L": {
51
+ "value": 1.3099022326262473,
52
+ "unit": "m",
53
+ "description": "Rod length"
54
+ },
55
+ "m": {
56
+ "value": 0.8473171893318376,
57
+ "unit": "kg",
58
+ "description": "Bob mass"
59
+ },
60
+ "g": {
61
+ "value": 9.8,
62
+ "unit": "m/s^2",
63
+ "description": "Gravitational acceleration"
64
+ },
65
+ "b": {
66
+ "value": 0.46690308154074256,
67
+ "unit": "kg \\cdot m^2/s",
68
+ "description": "Angular damping coefficient"
69
+ },
70
+ "A": {
71
+ "value": 0.0,
72
+ "unit": "N \\cdot m",
73
+ "description": "Driving torque amplitude"
74
+ },
75
+ "k_freq": {
76
+ "value": 0.0,
77
+ "unit": "rad/s",
78
+ "description": "Driving angular frequency"
79
+ },
80
+ "theta0": {
81
+ "value": -0.9918879756660004,
82
+ "unit": "",
83
+ "description": ""
84
+ },
85
+ "omega0": {
86
+ "value": -0.7312740032972802,
87
+ "unit": "",
88
+ "description": ""
89
+ }
90
+ }
91
+ }