title: Replacing a symbolic time-varying variable with a numerical value
body: <p>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.</p>
  <pre><code>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))]
  </code></pre>
  <p>I've tried this solution but it sets the derivative to zero as well.</p>
  <pre><code>subs(dRsb, {a1(t),a2(t),a3(t)}, {0,0,0})
  </code></pre>
  <p>You can see when angles are zeros, dRsb(3,1) should equal to <code>(diff(a2(t), t) + diff(a3(t), t))</code>. any suggestions.</p>