<jupyter_start><jupyter_text>[A rolling disc with Kane’s method ](https://docs.sympy.org/latest/modules/physics/mechanics/examples/rollingdisc_example_kane.html)  系統參數 Function of time* Angle $q_1(t),~q_2(t),~q_3(t)$* $u_1(t),~u_2(t),~u_3(t)$ Scalars* radius: r* mass: m* gravity: g* time: t<jupyter_code>from sympy import symbols, sin, cos, tan
from sympy.physics.mechanics import *
q1, q2, q3, u1, u2, u3  = dynamicsymbols('q1 q2 q3 u1 u2 u3')
q1d, q2d, q3d, u1d, u2d, u3d = dynamicsymbols('q1 q2 q3 u1 u2 u3', 1)
r, m, g, t = symbols('r m g t')<jupyter_output><empty_output><jupyter_text>座標轉換 Yaw-Row-Pitch rotation sequence(3-1-2)<jupyter_code>N = ReferenceFrame('N') # the inertia frame
Y = N.orientnew('Y', 'Axis', [q1, N.z]) # yaw angle q1
L = Y.orientnew('L', 'Axis', [q2, Y.x]) # roll angle q2
R = L.orientnew('R', 'Axis', [q3, L.y]) # pitch angle q3<jupyter_output><empty_output><jupyter_text>ang_vel_in(otherframe):Returns the angular velocity vector of the ReferenceFrame. set_ang_vel(otherframe, value):Define the angular velocity vector in a ReferenceFrame. set_ang_acc(otherframe, value):Define the angular acceleration Vector in a ReferenceFrame.<jupyter_code>w_R_N_qd = R.ang_vel_in(N) # angular velocity of frame R w.r.t inertia frame N
R.set_ang_vel(N, u1 * L.x + u2 * L.y + u3 * L.z) #
w_R_N_qd<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15104166666666666, 'fraction_numerical': 0.031994047619047616, 'mean_word_length': 5.93298969072165, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '302180', 'license': 'MIT', 'n_tokens_mistral': 582, 'n_tokens_neox': 572, 'n_words': 139, 'path': '.ipynb_checkpoints/Sympy document examples-checkpoint.ipynb', 'repo_name': 'HSJNYCU/Rolling_Disc', 'size': '1344'}