import sympy as sm
import sympy.physics.mechanics as me
me.init_vprinting()
theta, beta, alpha, l = me.dynamicsymbols('theta, beta, alpha, l')
A, B, C, D = sm.symbols('A, B, C, D', cls=me.ReferenceFrame)
B.orient_axis(A, theta, A.z)
C.orient_axis(B, beta, -B.x)
D.orient_axis(C, alpha, C.z)
r = l*D.x
r
r.express(C)
r.express(B)
r.express(A)
r.dot(C.x).diff(alpha)
r.dot(C.y).diff(alpha)
r_alpha_C = r.dot(C.x).diff(alpha)*C.x + r.dot(C.y).diff(alpha)*C.y
r_alpha_C
r.diff(alpha, C).express(C).simplify()
theta, beta, alpha, l
t = me.dynamicsymbols._t
theta.diff(t)
r
r.diff(t, D)
r.diff(t, A).simplify()
r.dt(A)
r.dt(D)
q = t*A.y
q
q.dt(A).dt(B)
q.dt(B).dt(A)