I have the following rotation matrix and its derivative with respect to time. The rotation matrix contains three angles a1,a2, and a3.For each angle, I would like to substitute a(t) with its numerical value with keeping its derivative (i.e. diff(a(t), t)) as symbolic variable.
Rsb =
[cos(a1(t))*cos(a2(t) + a3(t)), -sin(a1(t)), -cos(a1(t))*sin(a2(t) + a3(t))]
[sin(a1(t))*cos(a2(t) + a3(t)), cos(a1(t)), -sin(a1(t))*sin(a2(t) + a3(t))]
[ sin(a2(t) + a3(t)), 0, cos(a2(t) + a3(t))]
dRsb =
[- sin(a1(t))*cos(a2(t) + a3(t))*diff(a1(t), t) - cos(a1(t))*sin(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t)), -cos(a1(t))*diff(a1(t), t), sin(a1(t))*sin(a2(t) + a3(t))*diff(a1(t), t) - cos(a1(t))*cos(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t))]
[ cos(a1(t))*cos(a2(t) + a3(t))*diff(a1(t), t) - sin(a1(t))*sin(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t)), -sin(a1(t))*diff(a1(t), t), - cos(a1(t))*sin(a2(t) + a3(t))*diff(a1(t), t) - sin(a1(t))*cos(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t))]
[ cos(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t)), 0, -sin(a2(t) + a3(t))*(diff(a2(t), t) + diff(a3(t), t))]
I've tried this solution but it sets the derivative to zero as well.
subs(dRsb, {a1(t),a2(t),a3(t)}, {0,0,0})
You can see when angles are zeros, dRsb(3,1) should equal to (diff(a2(t), t) + diff(a3(t), t)). any suggestions.