50 using namespace NEWMAT;
55 const ColumnVector & qp,
56 const ColumnVector & qpp)
64 Matrix ldtau_dq(dof,dof);
65 ColumnVector ltorque(dof);
66 ColumnVector dtorque(dof);
68 for(i = 1; i <= dof; i++) {
69 for(j = 1; j <= dof; j++) {
70 dq(j) = (i == j ? 1.0 : 0.0);
72 dq_torque(q,qp,qpp,dq,ltorque,dtorque);
73 for(j = 1; j <= dof; j++) {
74 ldtau_dq(j,i) = dtorque(j);
77 ldtau_dq.Release();
return ldtau_dq;
81 const ColumnVector & qp)
89 Matrix ldtau_dqp(dof,dof);
90 ColumnVector ltorque(dof);
91 ColumnVector dtorque(dof);
92 ColumnVector dqp(dof);
93 for(i = 1; i <= dof; i++) {
94 for(j = 1; j <= dof; j++) {
95 dqp(j) = (i == j ? 1.0 : 0.0);
97 dqp_torque(q,qp,dqp,ltorque,dtorque);
98 for(j = 1; j <= dof; j++) {
99 ldtau_dqp(j,i) = dtorque(j);
102 ldtau_dqp.Release();
return ldtau_dqp;