I think you should just change dynamicsymbols to look at sympy.physics.mechanics.time, instead of it's ._t attribute.