I had another look at your code. You make the following replacement:
Cos[\[Theta]] Dt[\[Theta]] /. {\[Theta] -> \[Pi]/3}
Perhaps you expected theta
to be replaced inside Cos[theta]
alone. Unfortunately, it got replaced into Dt[theta]
too, and Dt
of a constant is zero. We must find a way to prevent this replacement. One way could be to first replace Dt[\[Theta]] -> inertSymbol
, do your original replacements, and then convert back inertSymbol -> Dt[\[Theta]]
. There must be a smarter way, but that's what comes to mind at the moment.